Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Blend modes (or Mixing modes) in digital image editing are used to determine how two layers are blended into each other. Version 8 has functionality to perform binary and basic alpha blending but nothing for the other standard blend modes (ImageCompose only works with two layers).

So the question is:

How can I extend ImageCompose to work with multiple layers with masks in any the standard modes such as Dissolve, Darken, or Soft Light... etc?

share|improve this question
It would be helpful if you would include some example operations with full syntax; I don't have those modes under version7. – Mr.Wizard Jun 19 '12 at 18:28
Those modes don't exist, I guess I was asking for them. – M.R. Jul 16 '12 at 20:41
Mike, since this one seemed to emphasize multiple layers, and not new blend modes, why don't you post a new question specifically about implementing new blend modes – Mr.Wizard Jul 16 '12 at 20:47
Will do, so should I delete this one? – M.R. Jul 16 '12 at 20:49
I don't think you need to; someone may be looking for an answer to this one. Nevertheless it doesn't seem popular so go ahead if you please. – Mr.Wizard Jul 16 '12 at 21:29
up vote 3 down vote accepted

Couldn't you simply Fold ImageCompose onto a list of pairs of layers and blend modes?

Version 7 doesn't have those advanced blend modes as far as I recall, but a simple example using Alpha:

img = ExampleData /@ ExampleData["TestImage"][[25 ;; 27]];

  {img[[2]], 0.5}, {img[[3]], 0.2}

Mathematica graphics

share|improve this answer
Right, I guess I'm just missing the implementations of the different types of blending. – M.R. Jun 19 '12 at 21:43
@Mike perhaps I missed the core of your question. Does version 8 have modes such as "Dissolve, Darken, or Soft Light" in any capacity, or were you asking how to implement these? – Mr.Wizard Jun 19 '12 at 21:46
That looks very creepy. – s0rce Jun 23 '12 at 17:08
@s0rce yeah, it does. :^) – Mr.Wizard Jun 23 '12 at 17:57

Some of the other standard blend modes could also be realized with the help of these:

  • ImageAdd
  • ImageSubtract
  • ImageDifference
  • ImageMultiply
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.