Extracting Hair More Precisely
Our project is looking pretty good. We selected the person in the original shot, and lots of hair detail came along for the ride to the new background. But if you zoom in and really look closely at your edges, you'll probably see a problem. In my example, there's some gray left over from Jessica's original background image (see Figure 10). It's visible in this example because I placed the selection on a bright background.
You might remember that I previewed the selection on a black background in the Refine Edge dialog; I couldn't see all that gray coming through. That just goes to show you that the background plays a big role in compositing! If I had placed my model on a dark background, I wouldn't need to bother with the edges. But since that's not the case, let's look at a way to refine the hair edges even more. We're going to use a layer style called Inner Glow. It's become my go-to technique for refining hair edges.
- Click the Add Layer Style icon at the bottom of the Layers panel and choose Inner Glow. When the dialog opens, click the Color swatch toward the top of the dialog to open the color picker. Then click an area somewhere in the person's hair that's closest to the overall hair color around it, as shown in Figure 11a. (Don't click on any dark roots or shadows.) This step sets the color of the glow, as shown in Figure 11b.
- Depending on how far the background encroaches on the hair, adjust the Size setting to make sure that you'll be taking all of it away. Then adjust the Opacity setting at the top of the dialog to make the fix brighter or darker, depending on how bright the new background is (see Figure 12). When you're done, click OK to close the dialog.
- This trick works great, but it leaves us with one tiny problem. The Inner Glow effect is applied to the entire photo. In my example, even the edges of Jessica's jacket get that glow. Now, in this photo I actually like all that radiance. I think it works, since Jessica has so much natural light coming from behind her from the background. If that look doesn't work for your particular photo, you can remove the effect from areas where you don't want it. Choose Layer > Layer Style > Create Layer. This command puts the effect on its own layer, so it's no longer a layer style (see Figure 13).
- Click the Add Layer Mask icon at the bottom of the Layers panel. Select the Brush tool and set your foreground color to black. Then just paint away the inner glow from any areas where you don't want it (see Figure 14a and Figure 14b).
As I mentioned before, this trick is one of my favorites for refining wispy hair edges. It's the one I turn to most often when selecting hair. As you can see in Figure 15a and Figure 15b, regardless of whether I zoom in or zoom out, Jessica's hair looks pretty great against the background where I've placed her. Pretty cool, huh?