How To Match a Subject Into ANY Background In Photoshop!
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.
Table of contents
- What You Will Learn
- Requirements
- Keyboard Shortcuts
- The Images Used
- Combine the Subject and Background into One Document
- Remove Any Background Behind the Subject
- Fine-Tune the Selection
- Create a Layer Mask
- Placing the Subject into the Background
- Scale the Background to Match the Subject
- How the Levels Adjustment Layer Works
- How to Match a Subject into any Background
- Adjust Saturation to Match the Subject and Background
- Creating a Shallow Depth of Field
- Edit the Image as a Whole
- Detail Tab
- The HSL Tab
- Fx (Effects) Tab
- Fine-Tune How the Subject Fits into the Background
- Fix Hair Strands So the Subject Matches the Background
- Frequently Asked Questions
- Conclusion
- Related Links
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
- Photoshop 2020 (version 21.0 or later) or the current version
Keyboard Shortcuts
| Action | Windows | macOS |
|---|---|---|
| Place the transformed or pasted image | Enter | Return |
| Subtract from a selection, sample a color, or reveal a layer mask temporarily | Alt | Option |
| Deselect | Ctrl D | Command D |
| Center the image on paste, or reveal the original layer through a mask | Shift | Shift |
| Switch to the Zoom tool | Z | Z |
| Pan the canvas | Space Bar | Space Bar |
| Free Transform | Ctrl T | Command T |
| Scale into perspective from a corner handle | Alt Shift | Option Shift |
| Switch to the Eyedropper tool | I | I |
| Swap the foreground and background colors | X | X |
| Save changes back into the Smart Object | Ctrl S | Command 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.

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.

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.

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

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.

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.

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.

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.

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.

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.

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

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.

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.

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.

The image below shows the original luminosity difference between the Background layer 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.

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.

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).

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.

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.


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.

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

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.

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).


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!

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.

Go to Filter > Camera Raw Filter.

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.

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!

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.

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.

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.

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.

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!

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.

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.

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.

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
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.
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.
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.
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.
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.
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.
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.
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.
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.
Keep going
Next, go deeper on Photoshop’s hidden color correction algorithms.
Related Links
Final Image
Drag the slider to see before and after









