Uses for the (New??) Subtract and Divide Blend Modes

There’s been a fair amount of interest around the Subtract and Divide blend modes that Adobe recently added to the Photoshop CS5 Layers panel. Subtract is not actually new; it’s been around forever in the Calculations and Apply Image dialog boxes. And even in the Layers panel, where Subtract is a freshman, you could achieve the same effect by inverting a Linear Burn layer. The Divide mode, meanwhile, is slightly-more authentically new. (Inverting a Color Dodge layer produces an identical effect, but previously there was no mode named Divide.) Even so, they have their uses. Which is why Blend Mode Man so enthusiastically contemplates their formulas below:

Photoshop CS5's Subtract and Divide modes

It’s okay if you’re afraid. You’d have to be as wicked-cool as Blend Mode Man to smile in the face of such bewildering information. Thankfully, it only gets easier from here. (But you’ll have to be member to read more.)

As you may know, blend modes operate on luminance levels on a channel-by-channel basis. Subtract and Divide make as the object of their formulas the active layer (the one that’s selected). To demonstrate, I’ll call the Active layer A and all the stuff behind it B, for Background.

For those of you comfortable with math, Subtract applies the formula B minus A. (Math haters, skip two paragraphs to “The net result.”) That is, Photoshop subtracts the active layer from the composite background of the various layers behind it. Divide applies the formula B divided by A. So divide the background stuff by the active layer.

Blend mode equations are “standardized,” meaning 0 is black and 1 is white. So subtracting white (the biggest number there is) from anything leaves 0, or black. Subtracting black leaves a pixel unchanged, because subtracting 0 does nothing. Meanwhile, dividing by white results in no change, because any number divided by 1 is itself. On the other hand, dividing by black technically leaves the result undefined. For example, 1 divided by 0 is, well frankly, infinity. You can fit as many s inside any number as you want because they’re empty, vaporous, no-footprint zeros. Photoshop’s solution (we can’t wander around with undefined pixels) is to render most results as white. The one exception: When black is divided by black, it remains black. Which wouldn’t have been my solution because it makes for small jagged patches of black. But that’s the way it is.

The net result: Subtract darkens an image like crazy. Divide lightens it by the same margin. These are two radical modes.

Okay, so all right, so what? How does that information pertain to one continuous-tone photograph blended with another?

A couple months back, programmer Chris Cox argued (on John Nack’s blog) that “Subtract and Divide are mostly intended for calibrated imaging (microscopy, astronomy, etc.).” Those folks aren’t me, but I’m happy to defer. Super-science geeks are my idea of excellent folk. He also adds, “Creative uses: those are just bonuses.” Of course, my job is to fill you in on the creative uses, so let’s see what we can come up with.

For ages, Subtract has been one of the go-to blend modes for preparing masks in Photoshop. It remains so from the Layers panel:

  1. Open a photograph of a person with lots of hair against a relatively plain background. Like the one from Stas Perov of the Fotolia image library, pictured with each and every tendril of free-flowing hair below.
    Select a base photograph
  2. Jump it to a new layer. (That is, press Ctrl+J or Cmd-J.)
  3. Choose Subtract from the blend mode flyout in the Layers panel. Because you’re subtracting every luminance level from itself, the result is 0, and the composite view turns entirely black. Don’t freak out; it’s standard behavior.
  4. If the model is dark-haired against a lighter background, switch to the rear layer and invert it by pressing Ctrl+I or Cmd-I. If the model is light-haired against a darker background, invert the active layer instead. And inverted the rear layer, Background, to produce the result below.
    Duplicate, apply Subtract, invert a layer
  5. Select the brush tool. Go with a fairly large brush size (in the hundreds of pixels) and change the Hardness to 0%. Change the blend mode in the options bar to Overlay. Paint with black to darken the background. Paint with white to lighten the hair. My result appears below.
    Paint with the brush tool set to the Overlay mode
  6. Go to the Channels panel. Peruse the Red, Green, and Blue channels to see which one offers the best edges and contrast. (Green might be your best bet here.) Duplicate that channel by dragging it onto the little page icon at the bottom of the panel. You now have a base alpha channel for further development into a hair mask.

In my case, those steps pretty well did the trick for masking the hair. I selected the arms and clothing using the pen tool and added those to the alpha channel. Here’s the model set against a new background using that very mask. The hair exhibits some gray fringing—a leftover from the old background—but that can be remedied with some compositional skills. And it ain’t half bad for maybe 5 minutes work.

The masked model against a sky background

Amazingly, you could for several versions of Photoshop do precisely the same thing with Linear Burn, either by inverting both layers (for dark hair against lighter backgrounds, as in my case) or neither (for light hair against darker backgrounds). If nothing else, I credit Subtract for bringing this to my attention.

So much for the slightly new Subtract mode. Let’s try a more trivial and creative project with Divide, that of compositing two images for a ghostly effect:

  1. Open two photos, one of one or more people against a white background, another of a dark background image. Below I reveal my two images, from Ron Chapple and Jumpingsack, respectively, again of the Fotolia image library.
    Two folks against a white background, and a dark background
  2. Select the people layer and apply the Divide mode. Bang, just like that, the formerly dark people against a light background become ghosts against a dark background, as pictured below.
    The ghosts of the Divide blend mode
  3. Now add a black object against a white background. This could be a scanned logo, a product element, any old dark isolated thing. My example below is a light bulb.
    A black object against a white background
  4. Turn the new object into a ghost by likewise applying the Divide blend mode. In my case, I also added a glow effect below the light bulb layer, which I set to the Linear Dodge (Add) mode. The result appears below.
    Divide turns the dark object light
  5. Moral: Divide takes dark stuff and makes it very, very bright. Here is a wide view of the warring partners, locked in a state of eternal love, admiration, mutual respect, and other-worldly conflict.
Here is a wide view of the Divide-mode ghosts

In conclusion, Subtract wants opposite layers with the dark foreground on top so the bright background pixels can subtract their way closer to black. Divide wants to render dark forground elements as ghosts, because the tiny (dark) luminance levels stand the best chance of dividing their way up to lightness. Think Color Dodge, except that dark is the lightening agent and white is treated as transparent.

For those looking for more information, this comes from my deep, 26-movie exploration of blending options in my upcoming video series, “Photoshop CS5 One-on-One: Mastery,” which I’m in the midst of recording for Mastery comes after Advanced, which I blogged about recently. In other words, there’s a whole lot more Photoshop information readying itself on the vast and expanding lip of a distant horizon.

Information that’ll make your hair curl. Information that’ll make your bulbs light. Information that’ll make you smarter, more informed, and thinking, “Wait a sec, what about this?” And like me when I think that, you’ll often be right. Blend Mode Man knows all. You and I float like high Opacity values and learn eventually and endlessly on the wings of time.

Next entry:Martini Hour 074, In Which Deke Gets Rid of the Shnivels

Previous entry:Martini Hour 073, In Which Colleen Experiences the Many Layer Effects of Deke


Share your feedback, work, homages, questions, wisecracks, advice, critiques, riffs, derision (within reason), frustrations, and love of all things graphical. Log in (or register) to lend your voice.