Real-World Workflow: Replacing a Background Using Selections and Masks

Capítulo 9

Estimated reading time: 7 minutes

+ Exercise

What You’re Building in This Workflow

This chapter walks through a practical, repeatable workflow for taking a subject from one photo and placing them into a new scene. The goal is not just a clean cutout, but a believable composite: edges that hold up, lighting and color that match the new environment, and shadows that anchor the subject to the ground.

Think of it as a checklist-driven process with clear stages: (1) select the subject, (2) refine edges, (3) output to a layer mask, (4) place a new background, (5) match lighting and color with clipped adjustments, and (6) add contact shadows.

Stage 1 — Select the Subject (Fast, Then Accurate)

1) Start with a quick selection

  • Activate a selection tool suited to your image (for example, an AI-assisted subject selection or a brush-based selection tool).
  • Aim for “mostly correct” first. Don’t spend time perfecting hair or tiny gaps yet—those are handled during refinement.

2) Check common problem areas early

  • Hands and fingers: look for missing gaps between fingers.
  • Edges near similar colors: clothing against a background of similar tone often needs manual help.
  • Accessories: straps, glasses, and thin edges are easy to accidentally exclude.

Tip: If the subject is complex, zoom in and do a quick “walk around” the outline, adding/subtracting from the selection only where it’s clearly wrong. Save perfection for the next stage.

Stage 2 — Refine Edges for a Natural Cutout

1) Enter edge refinement and focus on transitions

Edge refinement is where you convert a rough selection into something that looks like it belongs in a real photo. Focus on areas with semi-transparency and fine detail: hair, fur, soft fabric, motion blur, and shallow depth-of-field edges.

2) Watch for two common edge failures

  • Choppy edges: caused by a selection that’s too hard or too “polygonal.”
  • Color contamination: the old background’s color tint remains on the subject’s edge (often visible around hair or shoulders).

Practical approach: refine only where needed. Over-refining the entire outline can soften edges that should stay crisp (like a jacket seam).

Continue in our app.
  • Listen to the audio with the screen off.
  • Earn a certificate upon completion.
  • Over 5000 courses for you to explore!
Or continue reading below...
Download App

Download the app

Stage 3 — Output to a Layer Mask (Non-Destructive Composite Setup)

1) Convert the refined selection into a mask

Output the result as a layer mask on the subject layer. This keeps the original pixels intact and makes later cleanup simple.

2) Name and organize now to avoid confusion later

  • Rename the subject layer (e.g., Subject).
  • Group subject-related layers (e.g., Subject + Adjustments).
  • Keep the background scene separate (e.g., New Background).

Tip: Before moving on, toggle the mask view (or temporarily place a solid color layer behind the subject) to reveal edge issues you might not notice on the original background.

Stage 4 — Place the New Background Beneath the Subject

1) Import and position the new scene

  • Place the new background image and move it below the subject layer in the layer stack.
  • Scale and position the background so the horizon line and scene geometry make sense relative to the subject.

2) Match perspective using Free Transform

If the subject was photographed at eye level but the new scene is shot from a higher angle, the composite will feel “off” even if the cutout is perfect.

  • Use Free Transform to scale and reposition the subject so their size matches the environment (doorways, furniture, street elements).
  • If needed, use transform options that allow subtle perspective adjustments so vertical lines and ground plane alignment feel consistent.

Quick perspective check: imagine a line where the subject’s feet meet the ground. That line should sit naturally on the new scene’s ground plane, not float above it or sink below it.

Stage 5 — Match Lighting and Color (Clipped to the Subject)

Once the subject is in the new scene, the biggest giveaway is mismatched light direction, contrast, and color temperature. The cleanest way to correct this is to use adjustment layers clipped to the subject so the background stays untouched.

1) Create clipped adjustment layers for the subject

  • Add adjustment layers above the subject (for example: overall brightness/contrast, color balance, and saturation control).
  • Clip each adjustment to the subject so it affects only them.

2) Match contrast first, then color

  • Contrast: compare shadow depth and highlight intensity between subject and background. If the background is hazy/low-contrast, a high-contrast subject will look pasted on.
  • Color temperature: if the background is warm (golden hour) and the subject is neutral/cool, shift the subject warmer; if the scene is cool/overcast, reduce warmth.

3) Match light direction with targeted adjustments

If the background light comes from the left, the subject should generally be brighter on the left side and darker on the right (or vice versa). Use a clipped adjustment layer and a mask on that adjustment to apply subtle directional shading.

Practical mini-workflow:

  • Add a brightness adjustment clipped to the subject.
  • Fill the adjustment’s mask with black (hiding the effect).
  • Paint with a soft white brush at low opacity on the side that should be brighter.
  • Repeat with a darkening adjustment for the shadow side.

Stage 6 — Clean Up Mask Artifacts (Fast Fixes That Matter)

1) Remove leftover edge artifacts with a soft black brush

Even after refinement, you may see small background remnants: tiny bright pixels, fringing, or uneven edges around hair and shoulders. The simplest fix is manual mask cleanup.

  • Click the subject’s layer mask.
  • Choose a soft round brush.
  • Paint with black at low opacity to gently hide leftover artifacts.
  • Use a smaller brush near detailed edges; use a larger brush for broad cleanup.

Tip: Work zoomed in, but regularly zoom out to ensure you’re not over-erasing and creating unnatural “cut-in” edges.

2) Use background blur subtly for depth-of-field consistency

If the subject is sharp but the new background is also razor sharp (or vice versa), the composite can feel unnatural. A subtle blur on the background can help match depth of field.

  • Apply a gentle Gaussian Blur to the background layer (or a duplicate of it).
  • Keep it subtle—just enough to match the subject’s focus plane.

Practical check: compare edge sharpness around the subject’s silhouette to background details at a similar “distance.” If the background detail is too crisp, it competes with the subject and breaks realism.

Stage 7 — Add Contact Shadows to Anchor the Subject

Contact shadows are the small, darker shadows where the subject touches the ground (shoes on pavement, feet on grass, chair legs on floor). Without them, the subject often appears to float.

1) Build a simple contact shadow layer

  • Create a new layer below the subject but above the background.
  • Set a soft brush to a low opacity and paint shadow where the subject meets the ground.
  • Keep the darkest area tight to the contact point; fade it quickly as it moves away.

2) Shape the shadow to match the scene’s light direction

  • If light comes from the left, the shadow generally extends to the right.
  • If light is overhead and soft (cloudy day), shadows are shorter and softer.
  • If light is hard (direct sun), shadows are sharper and more defined.

Tip: If your shadow looks too sharp, soften it slightly (a small blur) and reduce opacity. If it looks like a gray smudge, tighten the darkest part right at the contact edge.

Review Checklist (Fix These Before You Call It Done)

Edge halos and cutout giveaways

  • Look for bright or dark outlines around hair, shoulders, and clothing edges.
  • Check semi-transparent areas (hair wisps, motion blur) for unnatural hard edges.
  • Toggle a temporary solid color behind the subject to reveal fringing.

Mismatched color temperature and contrast

  • Does the subject feel warmer/cooler than the scene?
  • Do the shadows match the scene’s shadow depth?
  • Are highlights on the subject too bright compared to the environment?

Unrealistic shadows and grounding

  • Are contact shadows present at the feet (or other contact points)?
  • Does the shadow direction match the background light direction?
  • Is the shadow softness consistent with the scene (hard sun vs soft overcast)?

Now answer the exercise about the content:

Why should lighting and color adjustments be clipped to the subject when replacing a background?

You are right! Congratulations, now go to the next page

You missed! Try again.

Clipping adjustment layers to the subject ensures only the subject is corrected for contrast and color temperature, while the new background remains unchanged. This helps create a more believable composite.

Next chapter

Everyday Photo Fixes: Straightening, Removing Objects, and Enhancing Details Non-Destructively

Arrow Right Icon
Free Ebook cover Photoshop Basics: A Beginner’s Guide to Layers, Masks, and Selections
82%

Photoshop Basics: A Beginner’s Guide to Layers, Masks, and Selections

New course

11 pages

Download the app to earn free Certification and listen to the courses in the background, even with the screen off.