Difference and Exclusion
By Nikolai Sklobovsky
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.
Lets see how they work.
First of all, lets 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.
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.
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.
Lets 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.
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.
Now the text really stands out of the background, especially in Difference mode.
Its 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.
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.
Difference mode still shows some color-inverting effect, at least when its 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?
In Exclusion mode well get just gray. Nothing but gray.
In Difference mode well 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.
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), its 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.
You can see the confirmation of these rules in the picture of the image blended with itself in Exclusion mode.