Sub topic 2
Why hair and fur resist ordinary selections
This chapter explains why a normal selection fails on hair and fur. It assumes you know what layers, the Layers panel, and the Tools panel are. It also assumes you have seen marching ants and know that a layer mask hides pixels where it is black and shows them where it is white. Knowing the cause of the problem will help you choose the right setting later, in the Select and Mask workspace.
What a selection can and cannot say
A selection in Photoshop is stored as a grayscale map with one value for every pixel. A value of 255 means fully selected. A value of 0 means not selected. Values in between mean partly selected. Photoshop draws the marching ants along the 50 percent line of that map. The ants are only a drawing of the map. The map itself can hold smooth gradations.
This matters because a selection tool does not have to produce a hard edge. If it only produces 0 and 255, you get a stair-stepped cutout. If it produces values between 0 and 255, you get partial transparency, which is what hair needs.
A layer mask uses the same kind of map. Black hides, white shows, and gray shows partially. Converting a selection to a mask copies those values across, so a selection that holds soft values makes a mask that holds soft values.
Why hair is a special case
Hair and fur differ from most other subjects in four ways.
- Strands are thinner than a pixel. A single hair may be a fraction of a pixel wide at normal photo resolution. Each pixel it crosses is a blend of hair color and background color, and no pixel is purely hair.
- Strands overlap the background. Between and around the strands, the background shows through. A pixel in a wispy area might be 30 percent hair and 70 percent background.
- The boundary has no single line. A shoulder or a coat has an edge you can trace. Hair has a zone, sometimes dozens of pixels deep, where subject and background are mixed.
- Strands are often low in contrast. Dark hair against a dark background, or blonde fur against a pale wall, gives tools little difference to detect.
The result is that the correct answer for these pixels is a fractional opacity, not a yes or no.
Why a hard-edged selection fails
Tools such as the Lasso, the Polygonal Lasso, and the Pen tool turned into a selection all draw a definite boundary. Each pixel ends up inside or outside. Applied to hair, this gives one of two bad outcomes.
- The boundary runs through the hair. The strands outside the line are cut away, and the hair looks shaved or helmet-like. The strands inside the line keep their original background pixels, so the cutout carries a visible patch of the old background.
- The boundary runs outside the hair. Every strand is kept, but so is all the background between them. When you place the cutout on a new background, a light or dark block shows around the head.
You can soften the selection with Feather. This blurs the edge by a fixed radius in pixels. It makes the cut less abrupt, but it blurs the whole edge equally. It does not find individual strands. It also leaves the old background color inside the blurred band.
The second problem: color contamination
Opacity is only half the problem. Look at a pixel that is 30 percent hair and 70 percent blue sky. Its color is a mix, so it looks bluish. If you keep that pixel at 30 percent opacity and place it on a white background, it will not look like hair. It will look like a pale blue speck. Across many strands this produces a faint colored outline known as fringing, or a halo.
Fixing this requires changing the edge pixels' color so they match the subject, not only changing their opacity. Photoshop handles this later with Decontaminate Colors, which has its own chapter. For now, keep the principle in mind. Good hair cutouts need both correct partial opacity and correct edge color.
| Problem | What goes wrong | Which setting addresses it later |
|---|---|---|
| Hard 0 or 255 boundary | Strands are chopped off or surrounded by old background | Edge Detection and the Refine Edge Brush |
| Uniform feathering | Whole edge goes blurry, strands are not found | Replace with targeted refinement |
| Color from old background | Colored halo on a new background | Decontaminate Colors |
| Low contrast strands | Tool cannot see the strand | Manual painting with the Refine Edge Brush |
Seeing the problem for yourself
You can check how a selection holds up with a short experiment. Open a photo with a visible hair edge and use the Quick Selection tool on the subject. Then follow these steps.
- With the selection active, click the Add Layer Mask button at the bottom of the Layers panel.
- Zoom to 200 percent or more at the hair edge.
- Create a new solid color fill layer in a strongly different color, for example bright orange, and drag it below the subject layer.
- Look at the edge. Note any missing strands, any blocky patches, and any colored outline.
Compare that result to a layer mask made later in this tutorial. The difference shows what the refinements do.
You can also look at the mask itself. Alt-click (Option-click on Mac) the mask thumbnail to view the mask in grayscale. A mask that works on hair shows a soft gray zone with fine light lines running out of it. A mask that fails shows a crisp white shape with a clean boundary.
Why background and subject choice matter
How hard a particular photo is depends on conditions you can often judge before you start.
- Contrast between hair and background. A dark head against a bright window is easy to separate. A dark head on a dark wall is hard.
- Background detail. A flat, out-of-focus background gives the tools clean information. A busy, sharp background such as leaves or a bookshelf mixes with the strands.
- Sharpness of the hair. Hair that is in focus has clear strands. Hair that is motion-blurred or out of focus forms a soft haze, which is actually easier to mask with partial opacity but gives less detail to find.
- Backlighting. Light behind the subject makes a bright rim on the hair. This often looks good on the original but can leave a bright edge when moved to a darker scene.
- Resolution. More pixels across the strand means better separation. Very small or heavily compressed files lose strands to JPEG artifacts.
A callout is worth keeping in mind here.
Common mistakes at this stage
- Over-refining a bad base. If the first selection cuts deep into the head or leaves large background pockets, no later setting will fix it cleanly. Start with a good base. The next chapters cover how to get one.
- Judging on the original background. The edge may look fine against the photo's own sky and still fail on white. Always check on a contrasting background.
- Zooming out too far. At 25 percent zoom, halos and missing strands are invisible. Check at 100 percent or higher.
- Using Feather as the main fix. Feather hides problems by blurring them. It does not recover lost hair.
How this shapes the workflow
The nature of the problem decides the order of the steps in this tutorial.
- Get a fast base selection of the solid parts of the subject.
- Judge that base and correct obvious errors.
- Open Select and Mask and use view modes to see the edge against different backgrounds.
- Let the edge tools find soft, partial-opacity zones around the hair.
- Paint back strands the automation missed.
- Remove background color from the edge pixels.
- Output to a layer mask so everything stays editable.
Each later chapter targets one part of the problem described here. The base selection handles the body of the subject, where a hard edge is fine. The refinement tools handle the hair zone, where fractional opacity is required. Decontaminate Colors handles the color mixing in those same pixels.
Exercise
A coworker draws a precise Pen tool path around a dog's head, converts it to a selection, and adds a layer mask. On a white background, the dog's fur looks chopped, with a thin dark outline. Name two separate reasons for this result and what each means for the mask.
Show answer
First, the Pen path is a hard boundary, so every pixel is fully in or out. Fur strands thinner than a pixel cannot be partly transparent, so they are cut off or kept with their old background. The mask needs soft gray values at the edge. Second, the kept edge pixels still carry color from the old dark background, which shows as a dark outline on white. The edge color needs to be cleaned, which Decontaminate Colors does later. Feathering would blur the edge but would fix neither cause.
Exercise
A selection's marching ants show a clean line around a subject. Does that mean the selection has no partial values? How can you check?
Show answer
No. The ants are drawn at the 50 percent level of the selection map, so soft values can exist on both sides of the line. To check, save the selection to a channel or convert it to a layer mask, then Alt-click (Option-click on Mac) the mask thumbnail to view it in grayscale. Gray pixels near the edge are partial selection values.
Exercise
You have two photos. In photo A, a person with dark hair stands in front of a bright, blurred window. In photo B, a person with dark hair stands in front of a dark, sharp bookshelf. Which is harder to mask, and why?
Show answer
Photo B is harder. Dark hair on a dark, detailed background gives the tools little contrast to detect strands, and the sharp shelf lines mix with the hair strands. In photo A, the strong contrast and smooth background make the hair zone easy to detect.