• Please use real names.

    Greetings to all who have registered to OPF and those guests taking a look around. Please use real names. Registrations with fictitious names will not be processed. REAL NAMES ONLY will be processed

    Firstname Lastname

    Register

    We are a courteous and supportive community. No need to hide behind an alia. If you have a genuine need for privacy/secrecy then let me know!
  • Welcome to the new site. Here's a thread about the update where you can post your feedback, ask questions or spot those nasty bugs!

Photoshop - two blend modes: metaphor and mathematical reality

Doug Kerr

Well-known member
In Photoshop, a layer's blend mode defines how what is on the layer (as perhaps "modulated" by any mask on the layer) interacts with the content of layer(s) below in forming the composite image.

Two of the modes that are often called into play are the Multiply and Screen modes. I have been interested in seeing just what they do.

There are widely-circulated metaphors whose purpose is to let the reader grasp broadly what is going on when that blend mode is in use. I have been interested in going beyond the metaphors and determining, and then articulating, exactly what happens.

This note reports my findings on these two blend modes.

***********

Multiply blend mode

The metaphor

The common metaphor for this mode involves having a transparency carrying each of the two images to be "combined" ad holding them in a stack and looking through them (or putting the stack into your slide projector, if it will tolerate that).

Thus, if for example both slides carry the same image, what we now see is darker overall, and the lower tonal values "fall off faster" than with a single slide.

This metaphor is certainly useful in coming to grips with the overall concept.

What actually happens mathematically is a bit different.

The math

I will use here "C" to mean any of the RGB coordinates, R, G, and B. The mathematical rule governing the combination of the two pixels at any spot of the two-layer structure will be shown in terms of the variable "C"; it actually applies to R, to G, and to B, but there is no point in my writing the same equation three times with different victims.

Assume that there is no mask in effect on any of the layers.

For some pixel of interest on the lower layer, C1 will be the coordinate (a proxy for R, or G, or B). For the corresponding pixel on the upper layer. C0 will be the coordinate for the pixel in the composite image. Then:

C0=(C1*C2)/255

The 255 gets into the deal because we are speaking of C on a 0-255 scale, and the basic mathematical concept of multiplying the coordinates requires variables on a 0-1 scale.

The long way to do this is:

C0=((C1/255)*(C2/255))*255

The first two 255's convert C1 and C2 into a 0-1 scale. The last "255" puts the answer back into the familiar 0-255 scale.

Of course, if we simplify this, we get the equation I first stated.

One use

One use that is suggested for the Multiply blend mode is to take two copies of the image and combine them using the Multiply blend mode. (Sometimes this is done by using an adjustment layer with the adjustment set to "none" to play the role of a duplicate of the layer below.)

The result if this is exactly the same as if we had used a Curves adjustment with a curve having the form:

C'=(C^2)255

Screen blend mode

The metaphor

This mode, as near as I can tell, gets its name from the metaphor.

The common metaphor for this mode involves a transparency carrying each of the images, each in its own slide projector, both aimed (in perfect register) at the same screen.

Thus, the luminance of the composite image, at each spot, is the sum of the luminance of the two component images for that spot.

An obvious difference between the metaphor and what we know to be true is that for a spot that, on each image, had "maximum possible" luminance ("fully transparent" on the slide, C=255 in the digital image), the composite image would have twice the maximum possible luminance, which is not - - possible.

Well, maybe the reality is that in the composite image, we have not the sum of the two luminances, but maybe half that (which we could describe as their average).

But in fact, what really happens isn't that either.

In fact, putting aside the matter of absolute luminance, the "on screen image" in the metaphor will look exactly like either of the images would on screen. In fact, if we use the Screen blend mode in Photoshop to combine two identical images, the composite has a wholly different tonal scale distribution that the original (more on that later).

I consider this metaphor completely useless.

The math

We will use the same conventions as in the earlier discussion.

Then, for any given pixel location in the two images being combined, for any color coordinate:

C0=C1 + C2 - ((C1*C2)/255)

The "255" here is part of the same deal discussed earlier.

One use

What happens if we take two copies of the same image and combine them using the Screen blend mode?

We find that when C for both images is 255, for the composite it will be 255.

When C for both images is 0, for the composite it will be 0.

When C for both images is 128, for the composite it will be 192.

This is not half the summation of the luminances. For C=255, a luminance half the sum of two of those would be represented by C=255. For C=0, a luminance half the sum of two of those would be represented by C=0. For C=128, a luminance half the sum of two of those would be represented by C=128.

In this exercise, we have essentially applied a curve that bowes up in the middle, pushing up the "midtones". I have not yet determined what actual curve would do the same thing. Ach aye the noo.

Best regards,

Doug
 

Jonas Wendorf

New member
One simple way to visualize the "opposing" blend modes (Multiply - Screen; Linear Dodge - Linear Burn etc.), is to just use two invert adj. layers.

First go to your base layer and place an invert layer above.
After that set the layer you want to blend to the according mode (i.e. Multiply). Place another invert layer above this layer with a clipping mask to it.
Now place just another invert layer right above the whole stack and you should be left with a result that looks exactly like a straight on screen (with the use of a total of 3 invert layers).

Now since you already now, that Multiply is just C=A*B (C is the result, A the current layer, B the background layer; I find this notation a little easier to grasp) and we now that invert is C=1-A, we can just combine this to see that screen is C=1-((1-A)*(1-B)) or C=-A*B+A+B.


I didn't scale the values to the 0-1 interval btw., because in 16bpc and 32bpc it'd look differently (with a division through 32768 and 1).

Btw.: A nice website that gives you most of the formulas for the different blending modes is this one: http://www.simpelfilter.de/en/basics/mixmods.html
 

Doug Kerr

Well-known member
It appears that if we use a Curves adjustment layer (with blend mode Normal), with a curve made from the default (linear) curve by grabbing its center (C=127) and hauling it up until the output coordinate is 192, this will have essentially the identical effect on the image as using a duplicate layer (or an adjustment layer set to "no adjustment') with blend mode Screen.

Fun stuff!

Best regards,

Doug
 

Doug Kerr

Well-known member
Hi, Jonas,

One simple way to visualize the "opposing" blend modes (Multiply - Screen; Linear Dodge - Linear Burn etc.), is to just use two invert adj. layers.

First go to your base layer and place an invert layer above.
After that set the layer you want to blend to the according mode (i.e. Multiply). Place another invert layer above this layer with a clipping mask to it.
Now place just another invert layer right above the whole stack and you should be left with a result that looks exactly like a straight on screen (with the use of a total of 3 invert layers).

Now since you already now, that Multiply is just C=A*B (C is the result, A the current layer, B the background layer; I find this notation a little easier to grasp) and we now that invert is C=1-A, we can just combine this to see that screen is C=1-((1-A)*(1-B)) or C=-A*B+A+B.


I didn't scale the values to the 0-1 interval btw., because in 16bpc and 32bpc it'd look differently (with a division through 32768 and 1).

Neat. Nice presentation. I'll spend some time with that soon.

Btw.: A nice website that gives you most of the formulas for the different blending modes is this one: http://www.simpelfilter.de/en/basics/mixmods.html

Fabulous! Thank you so much.

Best regards,

Doug
 

Doug Kerr

Well-known member
Hi, Jonas,

It was only recently that I realized that an adjustment layers work by having "content" that is an exact copy of the layer below except that it is modified (everywhere on it) by the specified adjustment (which might be "none" in the case of many adjustments that have adjustable parameters that an be set to "neutral").

Your exercise helps illuminate the working of this.

Thanks.

Best regards,

Doug
 
Top