How to cut out hair in Photoshop using Channels and Refine Edge

Complex image extraction like hair is an absolute nightmare to work around with regular methods like selection tool or pen tool. There are many ways to cut out hair in photoshop but no single method is perfect for all sorts of images. It depends on the type of background the hair to be extracted from.  Whatever the method we follow, it is important to choose an image with good contrast between the subject and the background. Today we are going to work on two images with different type of backgrounds: solid background and complex background using two different methods. Having said that, let’s start our tutorial with first method of using channels in photoshop.

Final Result:

Resources:

Woman with long Spread hair

Woman 2

Sky

Cut out hair using Channels: Method 1

Step 1

Open up the image of a woman with long spread hair on dark blue background in photoshop.

 

Step 2

 

Open the “Channels” palette (windows >> Channels). Click on each channel (Red, Blue, Green) to find which channel offers the best contrast  between the hair and the background(Ignore the body, we can select it using pen tool). From the sample we can see, Red channel has the best contrast.

Step 3

Duplicate the Red Channel (Right click on the channel and press Duplicate Channel).

By selecting the duplicate Red Channel, open Levels (Ctrl + L). Set the following properties in the Levels to maximize the contrast (Make sure to retain the fine details of strands of hair).

Step 4

In this step, let’s turn the background to solid black. Select soft brush, set foreground and background to black and white respectively.  Set blending mode of the brush to “overlay” at the top and opacity to 25%. This set up will allows us to maximize the highlights and shadows. Select black color and start painting carefully along the edges of the hair in dark or gray areas, select white color and paint over bright areas of the hair. Repeat this process, until you get the result something like this…..

Set blending of the brush to “Normal” and select white color and paint to over face…

Using pen tool or lasso polygonal tool select the body and fill it with white color. Fill rest of the dark areas with black color.

Press Ctrl + left Click on the channel (Red Copy) to make selection of it.

Go to layers panel, select the subject layer and click on the “Add layermask”.

Place a sky image below the subject layer to see the mask effect.

The result looks really good, however if you place it against a dark background you may see a halo effect around the edges of the hair. To fix this problem, we will duplicate the sky background place it at the top of the subject and right click on it (duplicate sky image) and “select create clipping mask”. Copy the layer mask of the subject over to the clipping mask(duplicate sky image) and invert the layer mask (Ctrl + I) and set the layer’s blending mode to “color”.

Note: Instead of using background as a clipping mask, you can simply use empty clipping mask layer and paint over the edges using same color as hair or you can use clone stamping. It’s all about which option works better.

So, this is how you can work with channels to cut out hair from the background. Now, let’s move on to the next method.

Cut out hair using Refine Edge: Method 2

Step 1

Open up the following image in photoshop. Notice the background is not a solid background, but there is good contrast between the hair and the background.

Create a new layer with solid color background just below the subject.

Step 2

Using a pen tool(P) or polygonal lasso tool(l) , draw a rough selection around the subject.

Click on the “Refine Edge” (Ctrl + Alt + R) option at the top (or go to Menu  Bar at the top  Select >> Refine Edge).

This will mask the subject and opens up the Refine Edge dialog box.  There are two main sections in the dialog box to consider : View Mode and Edge detection. View Mode  section offers a list of views to choose from, you can choose which ever suits better. These modes allows  us to check the result as we tweak the settings. For this tutorial I choose “On Black(B)” which place the subject on a black background.

Step 3

Just below the view mode section, there is a Edge detection  section, this is where all the amazing stuff happens.  In this section, you can find Smart Radius check box and Radius slider. As you move  the Radius Slider to the right, the selection you made around the subject will expand. To see exactly how much it is expanded check the “Show Radius(J)”box  in view Mode section.

Note: The above image only shows how much the selection is expanded not the exact selection. If you turn off  “Show radius(J)”  by un checking the box will show you the exact selection.

Step 4

For this tutorial, I set Radius Slider to 202.6px and uncheck the “Show Radius” in the view Mode section to see the selection of hair more precisely.

As you can see from the above image, Radius slider did an amazing job in selecting  fine details of hair further away from the initial selection. But the selection is not that accurate, you can see the background that appears around the edges. This is where “Smart Radius” comes in handy. If you enable the Smart Radius by clicking in the check box, this will tighten up the selection around the edges of the hair like this…

We can manually refine the edges using a brush in the Refine Edge panel. Select the brush and paint over the areas in the images to select the hair.

Finally, hit the ok button  to make the selection and click on the “Add layer mask” to add mask to the layer.

Note: To fix the halo effect around the edges of  the hair, you can add clipping mask to the subject which we discussed in the first method.

I hope that you find this tutorial helpful.