How To Match a Subject Into ANY Background In Photoshop!

2.2M views 49.3K likes 1,214 comments

Jump to a step in the video (9)

Click a time to play the video from there.

  1. 0:00 Introduction
  2. 1:48 Place both images in the same Photoshop document.
  3. 2:35 Make a mask to extract the model from her background.
  4. 11:00 Match brightness of the composite.
  5. 16:41 Match color of the scene.
  6. 19:15 Match Saturation in the image.
  7. 19:52 Blur Background
  8. 21:21 Adjust the composite with Camera Raw
  9. 24:20 Adjust and refine the details of the composite
Show Shortcuts for
Text size
Appearance

Your choices stick across every tutorial on this device.

Match a subject into any background in Photoshop by lining up perspective, matching brightness and color, and blending the edges until two separate photos read as one.

POWERFUL techniques to match a subject into any background in Photoshop!

Are you having trouble making your photo composite looking more realistic?

In this tutorial, I’ll be teaching you how to match a subject into any background in Photoshop for that seamlessly-perfect photo manipulation!

We will cover everything from masking, matching perspective, matching color, and everything you need to match a person into any background.

Key Takeaways

  • Match perspective first. Line up the horizon or vanishing point in both photos before you touch color, or nothing else will look right.
  • A Levels or Curves adjustment layer set to the Luminosity blending mode fixes a subject that is too dark or too bright without shifting its color.
  • The Auto Color Correction Options in a Curves adjustment layer can sample real shadow and highlight colors from your background. It applies them to your subject with the Color blending mode.
  • Hair is almost always the hardest part of a mask. Blend If and hand-painted hair brushes fix strands that Select and Mask cannot.
  • Matching depth of field and film grain between your subject and background is what finally sells the illusion of one real photo.

What You Will Learn

  • How to combine two photos in one Photoshop document and mask out a subject.
  • How to match perspective using vanishing points and the horizon line.
  • How to match brightness and color between a subject and a background with Levels and Curves.
  • How to blur a background to match a subject’s depth of field.
  • How to fix hair strands a mask cannot catch with Blend If and hair brushes.

Requirements

Before you start

Keyboard Shortcuts

ActionWindowsmacOS
Place the transformed or pasted imageEnterReturn
Subtract from a selection, sample a color, or reveal a layer mask temporarilyAltOption
DeselectCtrl DCommand D
Center the image on paste, or reveal the original layer through a maskShiftShift
Switch to the Zoom toolZZ
Pan the canvasSpace BarSpace Bar
Free TransformCtrl TCommand T
Scale into perspective from a corner handleAlt ShiftOption Shift
Switch to the Eyedropper toolII
Swap the foreground and background colorsXX
Save changes back into the Smart ObjectCtrl SCommand S

The Images Used

For this technique, I will be using an image of a female model standing in the middle of the street and an image of a dock. To follow along, you can download the links to the photos here:

Combine the Subject and Background into One Document

Opening both images in Photoshop means you’ll have them in two separate tabs. Select the Move tool then click-and-drag the Model document over to the other Background tab to paste it there.

How to match a subject into any background in Photoshop by dragging the model onto the dock background

Hold Shift (Windows) or Shift (macOS) and release the mouse button so Photoshop centers the Subject on the Background image.

Press Enter (Windows) or Return (macOS) to place the image.

Remove Any Background Behind the Subject

For those with older versions of Photoshop, you can use the Quick Selection tool to help remove the background. Click and drag the tool over the Model layer to make a selection.

If you make a mistake, hold Alt (Windows) or Option (macOS) to subtract from the current selection.

Quick Selection tool dragged over the model to build a selection around her

Press CtrlD (Windows) or CommandD (macOS) to deselect.

In current versions of Photoshop, you also have access to a powerful tool, the Object Selection tool. Select this tool and go to the Options bar.

Click on the Mode drop-down menu and select Lasso.

Object Selection tool Mode menu open in the Options bar with Lasso chosen

On the left part of the Options bar, click on the New Selection button.

New Selection button highlighted on the left side of the Options bar

Use the tool to make a loose selection out of the subject. When you release the mouse button, Photoshop automatically analyzes the image with its built-in artificial intelligence (AI) to complete the selection.

Fine-Tune the Selection

Zooming into the image, you’ll see that the space between the model’s legs has also been selected.

Use the Quick Selection tool and hold Alt (Windows) or Option (macOS) to click-and-drag around the area to deselect.

Holding Alt or Option to subtract the gap between the model legs from the selection

Create a Layer Mask

With the Model layer active, click on the Layer Mask icon at the bottom of the Layers panel to create a layer mask based on the selection. This will only show the selected subject and parts of the image outside that selection will be hidden.

Layer Mask icon clicked at the bottom of the Layers panel to mask the model layer

On the Layer Mask thumbnail, you’ll see how the selected subject is white while the hidden part of the image is black. To understand it easily, always remember, “White reveals, Black conceals.”

Placing the Subject into the Background

A matching perspective needs to be established so that the image composite looks like a real photo rather than a mere juxtaposition. See our guide to perspective and vanishing points in composites for more on this.

To explain more on this, disable the Model layer.

Select the Line tool.

On the Options bar, make sure to select Shape on the drop-down menu and set the weight to 10px.

In the dock image, you’ll see a triangle formation. We can make it more evident by using the Line tool to trace the lines to see where they meet. 

The sharp point where the lines meet is known as the vanishing point. You can use this same technique on more complex images where the horizontal and vertical lines are less obvious.

Line tool tracing the converging lines of the dock to find the vanishing point

Note: The vanishing point is where the horizon always lies. Matching the horizons of the foreground and the background image is one of the keys to matching perspective and making a composite look realistic.

To see the horizon line in the Model layer, hold Shift (Windows) or Shift (macOS) and click on the Layer Mask thumbnail to reveal the original background.

Shift clicking the layer mask thumbnail to bring back the original street background

Using the Line tool, trace the parallel converging lines to see where the vanishing point is, and here I can see that it lies right below her ear. 

Traced parallel lines in the model photo meeting at a vanishing point just below her ear

Reveal the layer mask again by holding Shift (Windows) or Shift (macOS) and clicking on the Layer Mask thumbnail.

With that in mind, place the point right below her ear to the vanishing point of the Dock image.

Use the Move tool to drag the subject directly into place.

Scale the Background to Match the Subject

On your Background layer, click the lock icon to disable it. Then, right-click > Convert to Smart Object so that I can distort it non-destructively.

Next, press CtrlT (Windows) or CommandT (macOS) to transform the image and drag the Reference Point onto the horizon line.

Hold AltShift (Windows) or OptionShift (macOS) and click-and-drag on the corner handle to scale the background image into perspective.

Scale the image down with the bottom of the image floating a few pixels above where the part of her legs are cropped.

Use the Crop tool to frame around the image and delete the rest of the excess canvas.

Crop tool framing the composite so the excess canvas can be trimmed away

Press Enter (Windows) or Return (macOS) to crop the image.

The composite after pressing Enter to commit the crop

Since the image is a bit off-scale, select the Background layer and select the Move tool. 

Click on the middle-left transformation handle while holding Alt (Windows) or Option (macOS) when dragging it to the left to expand the image equally on both sides.

This creates a more balanced image with the weight equally distributed.

Background stretched from the middle left handle so the weight sits evenly on both sides

How the Levels Adjustment Layer Works

Creating a Black & White adjustment layer when working with a composite image allows you to see the luminosity difference between the background and the subject

Select the Model layer and create a Levels adjustment layer and we can work on adjusting the luminosity of the model and match it with the background’s luminosity. 

Click on the Clip Layer Mask icon to clip the layer below it. That means any adjustment you make on the Levels will only be applied to the layer directly below it.

Levels adjustment layer clipped to the model layer with the Clip Layer Mask icon

The adjustment handles are located on either side of the slider, and these represent the darkness to the lightness of the image. 

If you drag the left handle to the right, your subject becomes darker. The gradient below shows how light your white pixels are and how dark your black pixels are.

Dragging the left Levels handle to the right so the subject turns darker

The image below shows the original luminosity difference between the Background layer and the Model. 

Black and white view showing the luminosity gap between the background and the model

Now, the goal is to adjust the sliders and the gradient until the darkest pixels in your Background layer matches with the darkest pixels of the Model layer. 

Levels sliders adjusted until the darkest pixels of both layers match

Now, disable the Black & White adjustment layer to see the result in the original color. 

However, adjusting the levels also affects the color, hue, and saturation of the subject. This creates an unmatched warmth on the subject layer against the cool tone of the background.

To fix this, select the Levels adjustment layer and set the Blending Mode to Luminosity. This means the layer only adjusts the luminosity and not the color, hue, or saturation.

Then, rename this layer to “Luminosity.”

How to Match a Subject into any Background

As you can see, the background has a cool, blue tint and you have to match it with the subject to create a realistic composite.

Go to the Curves adjustment layer and click on the Clip Layer Mask icon to clip it to the layer below.

Select the layer thumbnail and hold Alt (Windows) or Option (macOS) and click the Auto button to open the Auto Color Correction Options window.

Auto Color Correction Options opened by Alt clicking Auto in the Curves properties

On the Algorithms options, click the Find Dark & Light Colors to match the foreground and the background. 

By default, it color corrects the darkest color of your image into black (#000000) and the lightest color of your image into white (#ffffff).

Find Dark and Light Colors chosen under the Algorithms section

I’ll use this exact technology to cater to the needs of the image.

Click on the black swatch to open the Color Picker window. 

With the Eyedropper tool, click on the shadows of the background. If you look closely, the darkest color of my image composite is not pure black and in fact, it has a color tint.

Select OK to select this color as your Shadow Color for the foreground.

Eyedropper sampling the tinted shadows of the background as the new shadow color

For the brightest pixels of the background, make sure not to click on any specular highlights. For this image, select on the ice as my Highlights Color. 

Select OK to exit the window.

Immediately, you’ll notice how the auto color correction works by applying it to the subject to match the background.

Select OK to exit the window and in the next dialog box, click NO to avoid using the new target Highlights and Shadows as your new defaults.

Choosing No so the new highlight and shadow targets are not saved as defaults
Subject colors corrected so they sit closer to the cool tone of the background

Notice how the luminosity has changed? To keep this consistent, change the Blending Mode into Color to keep the hue and saturation while disregarding luminosity.

If you find the effect too intense, feel free to adjust the opacity accordingly.

Then, rename the layer into “Color.”

Adjust Saturation to Match the Subject and Background

If the colors are too intense, click on the New Adjustment Layer icon > Hue/Saturation > click on the Clip Layer Mask icon to only affect the layer below it. 

Hue and Saturation adjustment layer clipped so it only affects the layer below

Adjust your saturation and hue accordingly. For this image, decreasing the saturation little is enough.

Saturation pulled down a little to calm the colors on the subject

Creating a Shallow Depth of Field

Hold Shift (Windows) or Shift (macOS) and click on the layer mask thumbnail of the model layer to bring back its original background. The original image has a shallow depth of field, and you have to match it with the current composite. 

To do that, retrieve the layer mask and click on the background layer. Then go to Filter > Blur Gallery > Tilt-Shift.

Filter menu path leading to Blur Gallery and the Tilt Shift filter

For the full walkthrough, see our tutorial on creating a shallow depth of field in Photoshop.

In this Filter, you see two solid lines. Anything between the solid line and the dashed line is a gradual transition between in focus (sharp pixels) and out of focus (blurry pixels).

Tilt Shift solid and dashed lines marking the sharp area and the fade into blur
Another look at the Tilt Shift guide lines placed over the composite

Drag the upper solid line at the bottom of the image and the dashed line around the forearm area. Now, you have a realistic blurry background!

Composite with the dock background blurred for a realistic shallow depth of field

Edit the Image as a Whole

Select the Background layer and place all the layers into a Smart Object so you can manipulate them as a single layer. 

Select the Background > hold Shift (Windows) or Shift (macOS) > click the Hue/Saturation layer to select all the layers in between > right-click > select Convert to Smart Object.

Selected layers being turned into a Smart Object from the right click menu

Go to Filter > Camera Raw Filter. 

Opening the Camera Raw Filter from the Filter menu

With Camera Raw Filter, you can adjust the exposure, highlight, shadows, and vibrance of the photo as a whole image.

Detail Tab

Go to the Detail tab and add a bit of sharpening.

Tip: If you hold Alt (Windows) or Option (macOS) while adjusting the Masking slider to the right, you’ll see white areas where the sharpening effect applies. Areas that stay black keep their original sharpness.

Holding Alt while dragging Masking in the Detail tab to preview where sharpening lands

The HSL Tab

From here, you can adjust the hue, saturation, and luminance with the following sliders–giving you full control of every pixel in the image!

HSL tab with the hue, saturation, and luminance sliders in Camera Raw

Fx (Effects) Tab

A smooth, computer generated-looking image usually happens after applying multiple layers of adjustments and filters. A quick fix can be achieved by increasing the amount of Grain in the image to bring back the realistic look.

Grain raised in the Effects tab so the smooth composite looks less computer generated

Fine-Tune How the Subject Fits into the Background

Take this time to fine-tune your cropping and make sure it is symmetrical and proportionate. 

If you click on the thumbnail of your Smart Object, it opens in a new tab. There you can adjust the mask of the model to reveal or hide pixels.

One trick is to click on the layer mask, then choose Select and Mask. Our Select and Mask workspace guide covers this two-step refinement process in full.

Set your View to On White (T) and set the Opacity to 100%. 

Through this, you can adjust the edges of the mask by adding contrast, smoothening it, etc. Simply press OK to exit the window.

Select and Mask set to the On White view at full opacity while refining the mask edges

Fix Hair Strands So the Subject Matches the Background

Three factors make it difficult to fine-tune the mask between hair strands: the thinness of the strands, the depth of field, and the color of the hair’s original background.

To fix this, you can try to move the subject to adjust its placement on the composition.

Option 1: Using Blend If

You can also create a new layer above the Model layer, select the Brush tool, and paint the small area nearest the hair with the color blue.

To set that color as your Foreground color, press Alt (Windows) or Option (macOS) to bring out the Eyedropper tool to select the color.

Blue sampled from beside the hair and painted onto a new layer above the model

Next, change the layer Blending Mode to Color.

The natural brunette hair becomes blue. To retrieve the natural hair color, double-click the layer to open the Layer Style window.

On the Blend If option, you’ll find the Underlying Layer slider, and drag the left handle to the right to bring back the color of the hair.

Blend If Underlying Layer slider dragged right to bring the natural hair color back

Then, hold Alt (Windows) or Option (macOS) and click on the handle to split it in half. Use the new handle to adjust and create a smooth transition. When you’re satisfied, press OK to exit the window.

Option 2: Painting In the Hair

Another option you can do is to paint in the hair using the Brush tool. You can start by creating a new layer and using brushes specifically for the hair to restore the original hair color.

If you want to learn more about this, I have a video tutorial that teaches you how to create hair brushes!

Hair brushes stored in the Libraries panel ready to paint in new strands

Go to the Libraries panel, select any of your hairbrushes saved from our advanced hair masking tutorial, and use it.

Next, select the Eyedropper tool, or press I (Windows) or I (macOS), to pick up the color of the subject’s hair.

Eyedropper picking up the color of the subject hair before painting

Set the brush size to an easily manageable width. Then, with one click, paint on the layer.

Press CtrlT (Windows) or CommandT (macOS) to transform the object and flip it horizontal or vertical to adjust, move, and match with the original hair.

Painted hair strands flipped and moved with Free Transform to match the original hair

Create a layer mask by pressing Alt (Windows) or Option (macOS) and clicking the Layer Mask icon at the bottom of the Layers panel to hide the content. Select the color white as your Foreground color and use an ordinary round brush to reveal parts of the hair brush paint you want to show.

To adjust the luminosity of the new hair strands, go to Image > Adjustment Levels. Use the handles in the Input Levels to lighten or darken the hair to match the subject’s original hair.

Input Levels handles used to lighten or darken the new hair strands

When you’re satisfied with the fine-tuning, press CtrlS (Windows) or CommandS (macOS) and close the existing tab. Then, all adjustments will be applied and updated in the Smart Object.

For any details you may have missed, go back to the Smart Object to refine it. Save the changes by pressing CtrlS (Windows) or CommandS (macOS).


Frequently Asked Questions

How do I match a subject into any background in Photoshop?

Cut out the subject with a layer mask, then line up the perspective using the horizon line before you touch color. After that, use a Levels or Curves adjustment layer to match brightness and color between the two photos.

How do I match the perspective of two photos for a composite?

Find the horizon line, the point where the ground meets the sky, in both images. Use the Line tool to trace converging lines to their vanishing point, then place your subject so the same point on their body sits on that horizon line.

Why does my composite still look fake after masking the subject?

A clean mask only solves the edges. The subject also needs to match the background’s brightness, color, and depth of field, or the viewer’s eye will catch the mismatch.

How do I match the color and brightness of a subject to a background in Photoshop?

Clip a Levels adjustment layer to the subject and set its blending mode to Luminosity to match brightness without changing color. Then use a Curves adjustment layer’s Auto Color Correction Options, set to the Color blending mode, to match the color cast.

What does the Find Dark and Light Colors option do in Curves?

It’s part of the Auto Color Correction Options in a Curves adjustment layer. You sample a shadow color and a highlight color from your background, and Photoshop applies them to the darkest and brightest pixels of your subject.

How do I fix hair that a layer mask cuts off badly?

Use Blend If on a color-painted layer to bring back thin strands against a busy background. Or paint new strands with a hair brush on a layer above the subject. Both work best on small, difficult areas rather than the whole head.

How do I match the depth of field between a subject and a background?

Apply the Tilt-Shift filter from the Blur Gallery to the background layer. Set the blur amount to match how out of focus the subject’s original background was.

Do I need Photoshop 2020 to match a subject into a background?

No. The core technique, masking, perspective matching, and color correction, works in any current version of Photoshop. Only the Object Selection Tool mentioned in this tutorial requires Photoshop 2020 (version 21.0) or later, and it now ships in every current release.

Conclusion

You now know how to match a subject into any background in Photoshop using tools and filters you likely already have.

Perspective, color, brightness, and depth of field are the four pieces that make a composite read as one real photo.

Watch the full video above for every adjustment in real time, and comment on the video if you have a question.

Pro Training

Selections and Masking Mastery

Complete course includes 2.5 hours of step-by-step lessons, 6 structured modules, downloadable practice files, and custom Photoshop brushes. Everything you need to master selections and masks in one place.

View the Course

Final Image

Drag the slider to see before and after

After: How To Match a Subject Into ANY Background In Photoshop!
Before: How To Match a Subject Into ANY Background In Photoshop!
Jesús Ramirez

About the author

Jesús Ramirez

Jesús Ramirez is a graphic designer and the founder of the Photoshop Training Channel, which he started in 2012 and has grown past two million YouTube subscribers. He has taught at Adobe MAX, Adobe Summit, and Photoshop World, teaches courses for CreativeLive and Pluralsight, and was one of five artists chosen for Adobe Stock's Make a Masterpiece campaign. His Photoshop templates shipped inside Photoshop CC 2018.

More about Jesús Ramirez

Similar Posts