Blending modes: Difference and Exclusion

Tutorials and ReviewsTutorials and Reviews Registered Users, Retired Mod Posts: 138
edited May 18, 2005 in Tutorials
[imgr][/imgr]Blending modes: Difference and Exclusion

Tutorial by Nikolai.



The two modes we are about to explore have the following features in common:
• They both belong to the same “comparative” group that makes them neighbors in PS list of layers blending modes;
• Their effects can be sometimes similar, even with one operating strictly pixel-by-pixel and the other using certain average values;
• In other cases, especially if any amount of Gray is involved, they can be strikingly different;
• They are rightly considered by many experts to be the most “out there” (translation: non-intuitive) ones, especially when it comes to the color images.
100219836_tgTFM-O.jpg

Let’s see how they work.

First of all, let’s see what does PS Help system have to say about them:

Difference looks at the color information in each channel and subtracts either the blend color from the base color or the base color from the blend color, depending on which has the greater brightness value.

Exclusion creates an effect similar to but lower in contrast than the Difference mode.

In both cases, blending with white inverts the base color values. Blending with black produces no change.

Not much but enough to start.
99274503_A7qLi-O.jpg

If we put this theory to the test by creating a few lines of text on top of a simple black to-white gradient we can get the first feeling of how they work.

The identical blending modes on top of a colored background, however, deliver a totally different experience.
99274506_gZZ5o-O.jpg

Our text pretty much lost its original hunter green color and became¬Ö err, different (I added Drop Shadow style for better visibility).

Which immediately gives us a hint: these modes may work well when we need to put something like a logo or a copyright notice on top of a multicolored image (read: a normal photograph) and guarantee its visibility regardless of its location on the image.

Let’s give it a try.

I used a typical photo one would get of a band playing on some county fair. Some highlights, some shadows, some color costumes, some green grass.
99274508_NGJ8X-O.jpg

We are still using our hunter green text color.

As it was promised, both modes gave similar effect (Exclusion being slightly softer), both inverted text when it came to black or white base.

The situation changes quite dramatically if we use White as a text color.
99274530_ah2Me-O.jpg

Now the text really stands out of the background, especially in Difference mode.

It’s also easy to see on the bottom part of the letter X that Exclusion mode is somewhat partial to the gray areas.

And if we use Black – the text disappears totally, leaving us only with the Drop Shadow style.
99274569_Kfz7i-O.jpg

Hey, we just learned something!
No need to play with Fill slider if you want “shadow only” effect. Simply use your standard issue black text with the shadow and set mode to either Difference or Exclusion!

Now, what happens if we set the text mode to Gray?
Look – for the first time we can actually see the difference between the two modes.
99274577_5iZa7-O.jpg

Difference mode still shows some color-inverting effect, at least when it’s not on black or white, in which case it remains gray.

Exclusion mode simply stays gray.

This may give us some interesting ideas: what if we blend the whole image with gray?
99274584_AttHC-O.jpg

In Exclusion mode we’ll get just gray. Nothing but gray.

In Difference mode we’ll get some sort of a mix that is half positive, half negative.
The interesting fact: the resulting image stays the same even if you invert the original (Ctrl/Cmd + I), which is only natural if we keep in mind the formula for the Difference mode:

C = abs(A - B).

Since our gray B is exactly in the middle, it does not really matter whether our original A is inverted or not. What is important is how *far* its value is from our gray median.

99274588_LDrR6-O.jpg


I only found one mathematical explanation on how exactly the Exclusion mode works, namely in RetouchPro forum, in a nice tutorial submitted by Rexx.

It comes complete with the formula and even a graph. Please check the link (Exclusion is described closer to the bottom of the page), it’s worth it.

I would only like to borrow one paragraph from Rexx, who, IMHO, put it very nicely:

If A and B are very different, Exclusion produces white (per channel).

If A and B are both very dark or very bright, Exclusion produces Black.

If any of A or B is close to gray (128), Exclusion produces gray, no matter what the other layer is.

This still leaves a lot of uncharted territory, but at least it gives us few safe anchor points.
99274592_EFqXF-O.jpg

You can see the confirmation of these rules in the picture of the image blended with itself in Exclusion mode.







As it’s easy to see, Exclusion Mode really turned out to be a rather wild beast to tame.
I got the feeling that the most of its natural usage lies in the field of channel masking, where its black-gray-white oriented functionality and the three "Rexx Rules" mentioned above would provide at least somewhat expected results.
99274619_ojzf7-O.jpg

Other than that, I managed to produce some non-acid colors was when I:
1. Extracted the highlights (Ctrl/Cmd + Alt/Option + ~)
2. Copied them to a separate level (Ctrl/Cmd + J)
3. Inverted them (Ctrl/Cmd + I), and finally
4. Changed the mode to Exclusion.

To see the difference between the result and the original more clearly I also made a mask with a few windows, which I stroke with white and set in Difference mode to guarantee the edges to be always visible :-)

Another, somewhat similar, yet different image was produced when I:
1. Selected highlights again (Ctrl/Cmd + Alt/Option + ~)
2. Inverted the selection (Ctrl/Cmd + Shift + I)
3. Copied the resulting “shadows” to the new layer (Ctrl/Cmd + J), and
4. Set the mode to Exclusion.

99274628_LNswh-O.jpg

In both cases the resulting image was less saturated than the original.

Exclusive Difference

As we predicted from the very beginning, the two modes are hard to call intuitive.
99274630_zdk6L-O.jpg

Difference mode ended up being simpler of the two, essentially doing what it name implies.
Immediate application can include “image proofing”, black text becoming transparent and white text becoming inverted, and, as such, always visible.

Exclusion mode with it’s highly nonlinear formula and heavy gravitation towards pure gray can be either used for quick-and-dirty “gimme some weird colors” projects, or, on a much more sophisticated level, for separating shadows, highlights and mid-tones in the channel-based operations.
Sign In or Register to comment.