How to use calculations in Photoshop to help mask from channels

When using channels to mask an object from a fairly simple background but one that is too complex for the wand or color range tools there is a technique that can be used to cut down the amount of time you spend brushing into the areas you want to mask and the calculations command is the key to this, here’s how it works.

Tutorial images

Lollipop

Step one

First thing we need to do is open up the lollipop image in Photoshop and make the channels palette visible. We will need to make a copy of the red channel and rename it highs and a copy of the blue channel and rename it lows. To copy a channel you can drag the layer to the new channel icon at the bottom of the palette.

Creating duplicate channels in photoshop

With the highs channel selected open up the levels dialog box (ctrl+L) and pull the black amount right the way in and the same with the amount of white. You will also need to adjust the gamma slightly to bring the whites right up. If you don’t have any experience with the levels command then simply put in the values below.

The levels command window for highs

Next we want to do the same with the lows channel and adjust the levels again but this time we want to make sure that our black areas, especially the hairs and detail on the hands are not lost by pulling the gamma slider over to bring the black areas up nice and dark.

The levels command window for lows

Step two

Next we will open up the calculations dialog, image>calculations, and make sure our settings are going to give us the correct result. We want the blend mode set to screen, both layers will be set to background as that is our only layer, we want the top layer options to have the highs channel selected and not inverted, the bottom layer options to have the lows layer selected and inverted and the result should be set to new channel. Also make sure that mask is not selected.

The calculations command window

Hit OK and you should be left with a new channel called alpha 1. It isn’t perfect as the lolly has a blue that is very similar to the sky and there may be a few areas on the hand that need to be touched up but it is going to save us some time as we haven’t even used our brush yet!

Step three

With the new channel selected, Alpha 1, click the eye on the RGB channel to show the overlay of alpha 1 and we will use our brush tool set to white to tidy up the hand and fill in the blue of the lollipop. Easiest way to do this is to paint around the edge of the lollipop with a brush of about 90% hardness and then lasso select inside and just fill with white as below.

tidying up the new channel

Ctrl click our new channel’s thumbnail to select our masked area once you are happy you have it all touched in and then select the RGB channel to display the image with the marching ants around the hand and lollipop. Go back to the layers palette and hit ctrl+J to copy our selection to a new layer, create a new layer beneath it and fill it with a dark colour to view the result.

the result of the masking

If you have a blue halo around your layer as I did you can resolve this by using the refine edge tool. Reselect your new layers outline by ctrl clicking its thumbnail and open up the refine edge dialog, ctrl+alt+R or select>refine edge, and add some contraction and feathering to reduce the blue halo. Below are the settings I used but feel free to play around with the feathering and contrast to get the best result.

Using the refine edge tool

When you exit the refine edge dialog you will be left with your new selection, use it to add a layer mask and get rid of the blue halo or invert the selection, ctrl+shift+I, and delete it off. I always use layer masks myself.

the result

There you have it a fairly complex chop with a few easy to grasp techniques.

Tags: , ,

Posted on June 19th, 2009 under Photoshop tips. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Reply