Skip to content

How To Replace The Background Of A Photo Using Photoshop

To replace the background of a photo in Photoshop, separate the subject with a layer mask (Remove Background or Select Subject, refined in Select and Mask), place the new background on a layer underneath, then match its light, color, focus and grain so the subject looks as if it was photographed there. The cutout takes a few minutes. The matching is what makes the result believable, and it is where most composites fail.

This page walks through the whole job in order: choosing a background that can work, cutting out the subject, refining hair and edges, placing the new background, and blending the two. Menu names below are from current versions of Photoshop; on a Mac, use Cmd where Windows uses Ctrl and Option where it uses Alt.

Before you start: pick a background that can work

No amount of masking rescues a background that does not match the subject. Check three things before you begin.

  • Light direction. Look at the shadows on your subject’s face or body and on the new background. If the subject is lit from the left and the scene from the right, the composite will look wrong even if nobody can say why.
  • Camera height and angle. A person photographed from waist height does not fit a background shot looking down from a balcony. The background’s horizon should cross the subject at the height the camera was held, which is the subject’s eye line only if the camera was at eye level.
  • Quality of light. A subject in soft, overcast light looks pasted onto a background in hard sunlight. Match soft to soft and hard to hard.

If you can plan the shoot, photograph the subject against a plain backdrop that contrasts with their hair and clothes, a few feet in front of it so it stays evenly lit and free of shadows. Light the subject the way the destination scene is lit.

Step 1: Separate the subject with a layer mask

Always hide the old background with a layer mask rather than deleting it. A mask can be repainted at any time; deleted pixels are gone. Photoshop offers several ways to make the first selection.

Remove Background (one click)

  1. Open the photo and make sure the Layers and Properties panels are visible (Window menu).
  2. With the photo layer selected, find Quick Actions in the Properties panel and click Remove Background.
  3. Photoshop detects the subject, converts the locked Background layer to a normal layer, and adds a layer mask that hides everything else.

For a clear subject against a reasonably distinct background, this alone is often close to finished.

Select Subject, then mask

Choose Select > Subject, check the marching ants, then click the Add Layer Mask button at the bottom of the Layers panel. This gives the same kind of result as Remove Background but lets you inspect or adjust the selection first, for example adding a missed hand with the Quick Selection tool while holding Shift.

Pen tool for hard edges

For products, cars, buildings and anything with clean, smooth outlines, draw a path around the edge with the Pen tool, then Ctrl+click the path in the Paths panel to load it as a selection and add a mask. It is slower, but nothing beats it for crisp manufactured edges.

Want more on judging how hard a cutout will be before you begin? How to remove the background from a portrait in Photoshop covers automatic selection, edge refinement, fringes and exporting with transparency.

Step 2: Refine the edges in Select and Mask

Automatic selections are usually good on the body and weak on hair, fur, and soft or semi-transparent edges. Select and Mask is where you fix them.

  1. Ctrl+click the layer mask thumbnail to load it as a selection.
  2. Choose Select > Select and Mask (Ctrl+Alt+R).
  3. Set View Mode to On Black or On White, whichever contrasts with the new background you plan to use, so edge problems are obvious.
  4. Click Refine Hair in the options bar for an automatic pass on hair, then paint along the hairline with the Refine Edge Brush to catch stray strands.
  5. Use the Brush tool to add missed areas, or hold Alt to subtract.
  6. Adjust the Global Refinements sparingly: Smooth for jagged outlines, Feather for a slightly softer edge, Contrast to crisp up soft transitions, and Shift Edge with a small negative value to pull the edge inward and leave the old background’s fringe behind.
  7. Under Output Settings, choose Layer Mask and click OK.

If colored fringing from the old background remains in fine hair, tick Decontaminate Colors. It replaces edge colors with colors from nearby subject pixels. Because it changes pixels, Photoshop will only output it to a new layer (with or without a mask), not to the existing mask, so your original layer stays untouched underneath.

Step 3: Place the new background

  1. Choose File > Place Embedded and pick the background image. It arrives as a Smart Object, so you can resize it repeatedly without losing quality.
  2. In the Layers panel, drag the background layer below the subject layer.
  3. Use Free Transform (Ctrl+T) to scale and position it. Match the horizon or floor line to the subject’s camera height, and size the scene so objects behind the subject are a believable scale.
  4. Keep the original photo’s background available on the masked layer, or on a hidden copy, in case you need to sample its colors or light later.

If the background is too small for the canvas, or you need more room around the subject, extending the background of a photo covers filling the missing area.

Step 4: Make the subject belong in the scene

A clean edge only stops the composite from looking wrong. These adjustments make it look right. Do each one with an adjustment layer clipped to the subject (Alt+click the line between the adjustment and subject layers, or press Ctrl+Alt+G), so the change affects only the subject and can be undone at any time.

Match brightness and contrast

Compare the darkest and brightest areas of the subject with those of the background. A clipped Curves layer lets you bring the subject’s shadows and highlights into the same range. A subject that is brighter and more contrasty than its surroundings is the most common tell.

Match color

Every scene has a color cast from its light: warm at sunset, blue in shade, green under some indoor lighting. Add a clipped Color Balance, Photo Filter or Curves layer and shift the subject toward the background’s color temperature. A quick check is to add a temporary Hue/Saturation layer above everything with Saturation at zero; in black and white, mismatched brightness becomes obvious.

Match light direction

If light direction is close but not exact, strengthen it. On a new layer set to Soft Light, paint with a soft white brush at low opacity on the side of the subject facing the light, and with black on the shadow side. This is dodging and burning, and a little goes a long way. A strong mismatch cannot be painted away; choose a different background.

Match focus

A real photo has a consistent depth of field. If the subject is sharp, a background that should be some distance behind them should be softer. Apply Filter > Blur > Gaussian Blur to the background layer (applied to a Smart Object it becomes a Smart Filter, so it stays adjustable) until it looks like it belongs to the same lens and aperture.

Match grain and noise

Images from different cameras and ISO settings carry different noise. If the subject looks smoother or grittier than the background, add a little noise to the cleaner one (Filter > Noise > Add Noise, Monochromatic, small amount) until the textures agree when viewed at 100%.

Add shadows

A subject standing on a surface needs a shadow, or it floats. Make a new layer between the subject and the background and set it to Multiply.

  • Contact shadow: paint a thin, dark, soft line exactly where feet or an object meet the ground. This anchors the subject more than anything else.
  • Cast shadow: for a visible shadow, paint it in the direction the scene’s other shadows fall, blur it with Gaussian Blur, and lower the layer opacity until it matches the darkness of real shadows in the background.

Add atmosphere and light wrap

Distant scenes look hazier and less saturated than near ones. If the background should be far away, slightly reduce its contrast and saturation. When the background is bright, real light spills around the edges of a subject. Imitate it by sampling the background color and painting gently along the subject’s edge on a clipped layer set to Screen or Soft Light at low opacity.

Fixing halos and fringes

  • Light or dark outline: paint the mask edge with a soft black brush at low opacity, or repeat Select and Mask with a small negative Shift Edge.
  • Colored fringe in hair: use Decontaminate Colors, or add a clipped Hue/Saturation layer, target the fringe color, and reduce its saturation and lightness.
  • Blocky or missing strands: paint a few fine strands back on a new layer with a 1 to 2 pixel brush sampled from the hair, following the direction of the real strands.

Work non-destructively

  • Use layer masks instead of the Eraser.
  • Make every color and tone change with an adjustment layer clipped to the layer it affects.
  • Convert the subject and background to Smart Objects before transforming or filtering.
  • Save a layered PSD or TIFF master, and export a flattened JPEG copy for sharing.

New to layers and masks, or want them explained properly? Layers and masks in Photoshop for photographers covers layer types, blend modes, layer masks and clipping masks.

Common mistakes

  • Choosing a background with the wrong light. Fix: match light direction and softness before you mask anything.
  • A subject sharper than everything behind it. Fix: blur the background to match a real lens.
  • No shadow. Fix: add at least a contact shadow where the subject touches the ground.
  • Mismatched camera height. Fix: line up the background horizon with the height the subject was photographed from.
  • Deleting instead of masking. Fix: hide with a mask so you can repair the edge later.
  • Judging the edge at one zoom level. Fix: check at 100% and at full screen against both a light and dark view.

Try this

Take a photo of a friend standing in front of a plain wall in open shade. Then photograph a background scene in similar soft light, from the same camera height. In Photoshop, run Remove Background, refine the hair in Select and Mask, and place the scene underneath. Spend the rest of ten minutes only on matching: one clipped Curves layer, one color adjustment, a background blur and a contact shadow. Toggle each adjustment off and on to see which one did the most.

Frequently asked questions

What is the fastest way to replace a background in Photoshop?

Click Remove Background in the Properties panel’s Quick Actions, place the new image with File > Place Embedded, and drag it below the subject. Then spend a minute on a clipped Curves layer to match brightness; that one adjustment does more than any other.

How do I replace a background with a plain color instead of a photo?

After masking the subject, add a Solid Color fill layer (Layer > New Fill Layer > Solid Color) and drag it below the subject. Adding color to the background of a portrait covers this in more detail.

Why does my subject look pasted on?

Usually because the light, color or sharpness does not match the background, or because there is no shadow. Check each of the matching steps above in turn; the black and white test shows brightness mismatches immediately.

How do I keep hair looking natural?

Shoot against a plain background that contrasts with the hair, use Refine Hair and the Refine Edge Brush in Select and Mask, and use Decontaminate Colors for fringing. Choosing a new background similar in brightness to the old one also hides imperfect strands.

Can I change the background without losing quality?

Yes, if you work with masks, Smart Objects and adjustment layers and keep a layered master file. Quality drops only when you delete pixels, scale a non-Smart Object repeatedly, or save over a JPEG many times.


More Photoshop Tutorials: Browse all Photoshop lessons