Calculations work by blending two channels together, to create a third alpha channel
You can output to a new selection, or even a new document as well. Let’s compare all three methods.
- New Channel – You’ve always got the channel to use as a selection
- Selection – Fine, if you don’t want to re-use the selection.
- New Document – Creates a new Multichannel document. This will flatten all layers give you a Greyscale layer, with a single channel, which will look exactly the same as the layer.
So, New Channel is the obvious choice for creating masks, as you’ve always got the channel to reuse again.
Historically Calculations has been used to create masks of difficult subjects like flyaway hair.
I’ve created a YouTube video on Calculations here:
Here is the image I need to mask.
Of course, every image is different. But, I am only concerned with the flyaway hair. The blue jacket and the face will be easy to select using the Quick Selection Tool.
I am looking for a channel with most contrast between the flyaway hair and the background.
My process will be as follows:
1. Check all the channels individually, even try inverting the Channel, by going Command/Control “I” (the letter I)
Great for masking the face. Anything containing red in the image will be brighter. Hence, the background having hardly any red, (except in the bottom left corner), will be black. This channel will not be used for the hair, as there is very little contrast between the hair and the background. But, we can use the red channel to add the face to the hair.
With the much better contrast between the hair and the background.
An even better contrast between the hair and the background.
Now we need to run Calculations on the image.
My initial thought is to use the Blue, or Green Channel blended with the Red Channel.
Before we use the Calculations command I will point out now that the Blend Modes: Add and Subtract, will be the first choice as they offer the most control. That’s not to say the other Blend Modes will not work in some scenarios. Try Add and Subtract in the first instance when creating Alpha Masks. The exclusion modes, like Divide, can work also.
By the way, any channel that is not a colour channel, is an Alpha channel, i.e. a Mask Channel.
Right, let’s run the command by going: Image/Calculations…
The command will open with the settings used last, not always useful.
Our aim is to get the hair as white as possible. This is not an easy task, only experimenting will yield results. Even the most experienced Photoshop users will struggle to get the result right first time.
This is what I came up with, after several attempts.
The logic is quite simple in retrospect. The hair is dark on all channels because it has very little colour. Using the Blue, or Green Channel inverted is going make the hair brighter. We cannot use the Red channel inverted as there was little contrast between the hair and the background in the Red Channel
Using the Red Channel though, as the other channel makes sense, as we know the skin in the Red Channel is white.
Although I was initially concerned only about the flyaway hair adding the skin of the face in is a bonus, as my aim is to mask the whole woman.
Add and Subtract are very simple in their math. You are either adding Source 2 to Source 1 in the case of Add. Or, subtracting Source 2 from Source 1, in the case of Subtract.
As we are only dealing with greyscale, the adding together of two pixels will only make things brighter, and subtracting will make things darker. But, we can go above 255, and below 0. If we do exceed 255, or 0, we will only see pure black, and pure white on our screen, the number is still stored and passed on to Scale.
The scale has a range of one to two. The Scale works by dividing the output of the Add or Subtract blending. Any number divided by one changes nothing. As scale works by dividing the output, the image will get darker, if we raise it above one. The change is subtle, and not of much use for creating masks. Bottom line, don’t go above one, as the benefits are insignificant.
So, we’ve divided by one – which is no change. Now, the result is passed on to Offset, where we can make the image brighter up to 255, or darker down to -255.
Offset, is what really separates the Add, and Subtract from the other Blend Modes, making them useful for masking images.
From here on, we can refine the mask with a multitude of tools, usually starting with levels.
Bottom line. Look at your colour channels carefully, even invert (Command, or Control I). Pick the best two channels in terms of contrast against the background. If you don’t want to think too much about just playing around with add and subtract, reversing source 1 and 2, and tweak with Offset.
Above all play around. Even as selecting gets easier with time, Calculations is still the best for difficult subjects like flyaway hair.