Sub topic 13
Checking the cutout on light, dark, and colored backgrounds
This chapter assumes you have finished refining a selection in Select and Mask and sent it to a layer with a layer mask, as covered in the previous chapter. You should be comfortable with the Layers panel, layer masks (white reveals, black hides), and adding a Solid Color fill layer.
A cutout that looks clean on the original photo can still fail on a new background. The old background hides some edge problems. This chapter shows how to test a cutout on several backgrounds and what each test reveals.
Why one background is not enough
A mask edge is made of partial transparency. Each edge pixel is partly subject and partly background. Two things decide how that pixel looks on a new background:
- The mask value. This is how much of the pixel is kept.
- The pixel's color. If Decontaminate Colors was not used, or did not fully work, that color may still contain the old background.
A pixel with leftover old background color is called contaminated. It looks fine against a similar color and wrong against a different one. If you shot a dark-haired subject against a bright sky, the contaminated edge pixels are tinted light blue. Placed on black, they glow. Placed on a light blue sky, you will not see them.
So test on at least three backgrounds:
| Test background | What it reveals |
|---|---|
| Light (white or pale gray) | Dark fringes, dark stray pixels, and edges that are too hard or too thick |
| Dark (black or deep gray) | Bright halos and light fringes left from a bright original background |
| Saturated color (such as green, red, or blue) | Color casts from the old background and strands that are too transparent |
Light and dark are opposites, so between them they expose both kinds of fringe. A saturated color catches tints that gray backgrounds hide.
Building a test background with fill layers
Do not paste a real photo yet. Solid color fill layers are quick to swap and make problems easy to see.
- In the Layers panel, make sure your cutout layer (with its layer mask) is selected.
- Choose Layer > New Fill Layer > Solid Color, or click the Create new fill or adjustment layer button at the bottom of the Layers panel and choose Solid Color.
- Pick a color and click OK.
- Drag the fill layer below the cutout layer in the stack.
Now double-click the fill layer's thumbnail whenever you want to change the color. You can switch from white to black to green in a few seconds without touching the cutout.
The order of layers should look like this:
Cutout layer (with layer mask)
Solid Color fill layer (test background)Because the mask stays on the cutout layer, nothing about the cutout changes while you test. This is the benefit of the non-destructive output you chose earlier.
A repeatable test routine
Work through the same steps each time, so you do not miss a background.
- Zoom to 100%. Press Ctrl+1 (Windows) or Cmd+1 (Mac). Edge problems are easy to misjudge at other zoom levels, because Photoshop resamples the view.
- Set the fill to white. Look along the whole hair outline, not just one spot. Pay attention to the top of the head and the places where hair crosses the original background's brightest or darkest areas.
- Set the fill to black. Look for glowing edges and pale outlines.
- Set the fill to a saturated color. Look for tints and for strands that vanish.
- Optionally, drop in a real replacement background. Match its brightness and color to the subject's lighting, or the cutout will look pasted in even if the edge is perfect.
Toggle the cutout layer's visibility on and off, or the fill color, to see changes quickly.
Reading the symptoms
Each symptom points to a likely cause. The fixes are covered in the troubleshooting chapter, so here the goal is to diagnose.
| What you see | Where you see it | Likely cause |
|---|---|---|
| Bright outline around dark hair | Black or dark backgrounds | Bright original background colors remain in edge pixels. Decontaminate Colors was off, or the amount was too low |
| Dark outline around light hair | White or light backgrounds | Same cause, with a dark original background |
| Colored tint along the edge | Saturated backgrounds | Color from the old background remains in edge pixels |
| Hard, cut-paper edge with no wispy strands | Any background, most visible on dark or light extremes | Radius was too low, or fine hair was never painted back with the Refine Edge Brush |
| Strands appear but look washed out or gray | Dark backgrounds | Mask values for strands are too low, or Contrast was pushed too high and flattened them |
| A soft, blurry band around the head | Any background | Too much Feather, or Shift Edge set too far outward |
| Patches of old background inside the hair | Any background | Interior areas were classified as subject, so the mask kept them fully opaque |
If more than one symptom shows up, fix them in this order: shape of the mask first, color fringing second. Fringing is easier to judge once the mask edge is right.
Inspecting the mask itself
When a problem is not obvious in color, look at the mask directly.
- Alt-click (Windows) or Option-click (Mac) the layer mask thumbnail to view the mask in grayscale on the canvas. Hair strands that you want visible should appear as light gray or white. Areas that should be gone should be black.
- Alt-click or Option-click the thumbnail again to return to the normal view.
- Press the backslash key (\\) while the mask is selected to show it as a red overlay on the image. This shows which parts of the image the mask hides.
Look for gray areas in places that should be solid. Gray inside the head, for example, means the subject will look partly see-through on new backgrounds. That problem is invisible on the original background but obvious on black.
Checking color contamination separately
You can isolate color problems from mask problems.
- Select the cutout layer, not the mask.
- Temporarily disable the layer mask by Shift-clicking its thumbnail. A red X appears over it.
- Look at the unmasked layer's edge pixels. If you used Decontaminate Colors with Output To set to New Layer with Layer Mask, the layer holds the cleaned colors, not the original photo.
Shift-click the thumbnail again to turn the mask back on.
Note what you are checking here. A layer with decontaminated colors should show pixels near the edges that have been recolored to match the subject, not the old background. If they still look like the old background, either Decontaminate Colors was not enabled or the original layer was output instead of a decontaminated copy.
Common mistakes when testing
- Testing only against white. White hides bright fringes. Always include black.
- Judging at a zoomed-out view. Hair detail disappears when the image is shrunk. Check at 100% and then at 200% in a few places.
- Testing with a photo background that is similar to the original. A matching background hides contamination, which defeats the test.
- Fixing the mask while looking at a fringe problem. Changing Radius will not remove a color tint. Change the tool that matches the symptom.
- Painting on the layer instead of the mask. If you fix a stray strand by painting black on the layer, you damage pixels. Select the mask thumbnail first and paint there.
Making small fixes directly on the mask
For a few stray spots, you do not need to reopen Select and Mask. Select the layer mask thumbnail, choose the Brush tool, and set a small, soft brush at low opacity.
- Paint with black to hide a leftover patch of old background.
- Paint with white to bring back a strand that was lost.
- Press X to swap between black and white as you work.
Keep the brush opacity low, around 20 to 30 percent. Hair edges are partial transparency, and a full-strength brush creates hard marks. For larger problems, double-click the mask thumbnail to reopen Select and Mask using the Properties panel, then adjust the settings there.
Exercise
Your cutout of a dark-haired subject looks perfect on white, but on a black background a thin bright outline appears around the hair. Which tool or setting should you reconsider first, and why does the problem not show on white?
Show answer
Reconsider Decontaminate Colors. The outline comes from edge pixels that still carry the bright original background color. On white, the light fringe blends in with the background, so it is hard to see. On black, the contrast makes it obvious. Turn on Decontaminate Colors, or raise its Amount, and output to a new layer with a layer mask. Changing Radius or Feather would alter the mask shape, but would not fix the color of the edge pixels.
Exercise
You want to check whether the inside of the subject's head is partly see-through before placing it on a new background. How can you do this without adding any background layer?
Show answer
Alt-click (Windows) or Option-click (Mac) the layer mask thumbnail to view the mask in grayscale. Solid areas of the subject should be pure white. Gray areas inside the head mean partial transparency there. You can then paint white on the mask with a brush to make those areas opaque.