Photoshop Technique – Masking Complex Areas

10 Keys to Photoshop CS2Ever have to strip the backround out of an image that was so complex and detailed you didn’t know where to start? Let me share with you a great technique for masking very complex areas like hair that would take forever to mask using more traditional techniques. This tutorial is excerpted from my upcoming book, 10 Keys to Photoshop CS2 . [Note: Link points to a pre-release version of the book, the final release will likely have a lower price tag.]

ps_book-essentials_022.jpgHere’s the image we will use as an example. In this case the hair creates a complex area to mask out that is complicated by the short depth of field which gives it sharp edges in some places and softer edges in others. Let’s say we wanted to place this subject on another background. How do we make this easier?

With your image open, go to your Channels palette and click on each individual channel in turn (Red, Green, and Blue for an RGB image) and examine them (your image will turn to black and white when you do this). What you are looking for is the channel that has the most contrast between the area you want to mask (or select) and the background it’s on.


ps_book-essentials_025.jpg

Once you have decided which channel offers the most contrast, duplicate it by dragging it to the new channel icon at the bottom of the Channels palette (in my case I chose the blue channel). Be sure you are now working on the copy of your channel or you will change the color of your image (your new channel should have the word ‘copy’ appearing after the name of the channel).

Next we need to maximize the contrast between the area you want to select and it’s background. We need to end up with an image that contains just black and white with no shades of gray. It doesn’t matter which area is which, we can always invert the selection later. For example if your trying to separate a model’s black hair from a gray background, you want to make her hair go completely black, and the background to go completely white. To start, open the Levels dialog (Command-L (Mac) or Ctrl-L (PC) or Image > Adjust > Levels), and experiment with the input sliders to increase the contrast without causing either area to blend together. ps_book-essentials_028.jpgDrag the Black input slider to the right to darken the shadow areas and drag the Highlight slider to the left to lighten the highlight areas. Use the midtone slider to push the mid-tones in whatever direction is appropriate to your image. You just want to increase the contrast between the area you want to keep and the area you want to remove. Be careful not to go too far or you change the shape of the edges of your mask.

When your done this step your images will have changed from something like this:

ps_book-essentials_027.jpg
To something like this:
ps_book-essentials_029.jpg

Next we are going to make use of the Dodge and Burn tools to help us increase the contrast further. Select the Burn tool and set it’s range set to shadows in the options bar at the top of your screen. This way it will only affect the shadow areas of the image (and some mid-tones). Now use it to burn down (darken) the dark areas of the image until they go black. Switch to the Dodge tool with it’s range set to highlights to lighten the light areas until they become white. Usually you will need to switch back and forth between these tools as you go. Be careful of areas that are near a middle gray as these can easily be dodged or burned the wrong way. Pay particular attention to the edges. Here’s what our example image looks like after this step:

ps_book-essentials_030.jpg

In areas not close to an edge (or too near middle gray to burn or dodge effectively), fill in with the brush tool set to black or white as needed. Your image should now be comprised of only black and white, like this:

ps_book-essentials_032.jpg

To complete this masking technique, we need a mask that is black in the areas we want to conceal, and white in the areas we want to reveal. Since the channel we’ve created in this case is the opposite, we need to invert the selection (Image > Adjustments > Invert). Next Command-click (Mac) or Ctrl-click (PC) on the channel thumbnail to load the channel as a selection. I like to feather my selections by 1 pixel (Select > Feather…) for a more realistic edge.

ps_book-essentials_033.jpgWith the selection loaded, click on the RGB channel to get back to your full image and switch back to the Layers palette to choose the layer you want to apply this selection to. If you are still working with a background layer at this point, double-click on it’s name and click OK in the dialog that comes up to make it an editable layer. Finally (with your selection still active) add a layer mask by clicking the Add Layer Mask icon at the bottom of the Layers palette. You will see a mask icon appear next to your image thumbnail in the layers palette, and the masked areas (the black areas of the mask icon) will disappear. Your image should now look like the one below:

ps_book-essentials_034.jpg

All that’s left is to add a layer containing the background below this masked layer.

Here’s a bonus tip: If after you drop in a background you still have a fringe of the former backgrounds color left do this: Select the layer mask you created in the abouve tutorial and run a Gaussian Blur filter (Filter > Blur >Gaussian Blur) just enough to soften the edges of the mask a bit, say a setting of 3-7 or so. Then select Image > Adjust > Levels and when you move the mid-tone slider it will expand and contract the mask. The black point and white point sliders will now control the hardness of the edge. Just tune the mask using those sliders and click OK when you get the result you want!

Was this tutorial helpful to you? What else would you like to see tutorials on? Leave a comment and let me know…

Leave a comment:



Spam Protection by WP-SpamFree