Making a Difference

After the last hard topics, Difference Mode is refreshingly easy in Photoshop to understand:

Difference Mode: 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. Blending with white inverts the base color values; blending with black produces no change.

It’s easy for me to think about this when I consider RBG values. When you express a color in red-green-blue values, each color can have a value from 0 to 255. If you have red=0, green=0, and blue=0 (0-0-0), you end up with black. If you have 255-255-255 (red, green, and blue turned up all the way), you end up with white.

So let’s take a blue square with RGB value of 27-97-168 (you can tell from the numbers that it will be mostly blue, because red and green values are much lower) and put it on top of a white background. Let’s duplicate the blue square on another layer and set that one to Difference Mode and move it over. The white (255-255-255) will subtract the blue (27-97-168) and you’ll end up with an orange-ish color (228, 158, 87). Cool, huh?

If you passed first grade math, like me, you’ve probably figured out by now that if you duplicate a layer and keep the two layers centered together, then set the top one to Difference Mode, you’ll end up with a black area. Since the layers are identical, the colors subtract to 0-0-0, resulting in black.

A cool effect that you can achieve with Difference Mode is a black neon glow outline type effect.

1. Take a picture, any picture. (I’ll use the standard yellow rose picture that I’ve got.)

2. Duplicate the layer.

3. Set the top layer to Difference Mode. You’ll just see black at this point.

4. Go to Filter > Blur > Gaussian Blur (you can experiment with the other ones later, for fun) and play around with the radius. I set mine to 8 pixels, but it just depends on your picture.

5. The picture will start to form a faint neon effect. You should be able to see this from the preview. Find a setting that suits you and apply the blur effect.

Another neat application of this is the overlapping “cutout” effect, which can be used for a quick web graphic or logo.

1. Create two layers with shapes or text on them. This works best with solid shapes. The bottom layer should be black, the top layer should be white, and they should both be on a white background.

2. Set the top, white layer to Difference Mode, and you’ll immediately get an overlapping cutout effect!

Finally, one application that I hadn’t considered before is using Difference Mode to help you “stitch” two pictures together – like if you’re making a panorama, or if you’ve scanned a larger document by scanning smaller pieces of it. This web site describes it, but I’ll go over it briefly.

1. Let’s say that you have a large photo and a small scanner. You scan one side of the large photo, then the other side, with a small overlap in between.

2. In Photoshop, you make a new document big enough for the whole photo and drop in the two halves on their own layers. Recall that there is some overlap; you try to line them up painstakingly.

3. Setting the top layer to Difference Mode can help you line up the pictures more easily. Remember that if the overlap part is lined up perfectly, then the colors will subtract from each other, leaving a black stripe. So nudge the layer with the move tool or arrow key until you get as much of a black stripe as you can get with your scan. Turn the top layer back to Normal Mode and see how it looks!

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • MarkB

    So THAT’s how Difference mode works! :) Thanks for the informative blog!

    - Mark

  • Gerlie

    Your masterpiece is terrific. I learn a lot in here. Hope you can put more and more =)

    - Gerlie
    gerlie.demavivas@gmail.com
    Philippines…

  • Dave

    First time visisting your blog, but I will return. Thanks for the great and simply explained photoshop tips. These tips can make newbie material appear more proffesional.

  • jruyle

    Thanks for the information. I had wondered how easy that effect was (the logo).

  • Joe

    Excellent tip about stitching images!

  • Peter

    Hey – you might also mention that this could be considered an XOR of the two images. Identically colored pixels will show up black while non-identically colored pixels will show up in shades of grey (for black and white images). I just figured this out for myself tonite.