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.
Table of contents
- The Images Used
- Combine the Photos
- Remove the Background
- Fine-Tune the Selection
- Create a Layer Mask
- Placing the Subject
- Fixing the Scaling
- How the Levels Adjustment Layer Works
- How to Match a Subject into any Background
- Adjust the Saturation
- Creating a Shallow Depth of Field
- Edit the Image as a Whole
- Detail Tab
- The HSL Tab
- Fx (Effects) Tab
- Fine-Tune the Image
- Fix the Mask Between Hair Strands
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 Photos
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 the Shift key and release the mouse button so Photoshop centers the Subject on the Background image.
Press the Enter (Windows) or Return (macOS) key to place the image.
Remove the Background
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 the Alt (Windows) or Option (macOS) key to subtract from the current selection.
Press Ctrl D (Windows) or Command D (macOS) key to deselect.
For Photoshop 2020 Users, you 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, and upon releasing the mouse button, Photoshop automatically analyzes the image using Adobe Sensei, an Artificial Intelligence (AI).
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) key 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
A matching perspective needs to be established so that the image composite looks like a real photo rather than a mere juxtaposition. If you want to know more about perspective, click here!
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, and you can always use this technique for more complex images where the horizontal and vertical lines are not as evident.
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 match the perspective and make it look realistic.
To see the horizon line in the Model layer, hold the Shift key 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 the Shift key 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 move the subject directly in place.
Fixing the Scaling
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 Ctrl T (Windows) or Command T (macOS) to transform the image and drag the Reference Point onto the horizon line.
Hold Alt Shift (Windows) or Option Shift (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 the 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 the Alt (Windows) or Option (macOS) key 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, you will notice that your subject becomes darker and the gradient below indicates how light are your white pixels and how dark are your black pixels.
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 and results to an unmatched warmth of the Subject layer and 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 (#ffffff) and the lightest color of your image into white (#00000).
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 the Saturation
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 the Shift key 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.
In this Filter, you see two solid lines, and anything between the two solid lines and the dashed lines will be 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 key > 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.
Go to the Detail tab and add a bit of sharpening.
PRO TIP: If you hold the Alt (Window) or Option (macOS) key while adjusting the Masking slide to the right, you’ll see white areas where the sharpening effect applies. Meanwhile, areas where the sharpening effect isn’t applied is indicated by the black areas.
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 the Image
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 will take you to a new tab where you can adjust the mask of the model to reveal or hide some pixels.
One trick is to click on the layer mask > Select and Mask.
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 the Mask Between Hair Strands
Three factors that can make it difficult to fine-tune the mask between the hair strands: the thinness of the hair strands, the depth of field, and the color of its former background.
To fix this, you can try to move the subject to adjust its placement on the composition.
Option 1: Using the Blend If
You can also create a new layer above the Model layer, select the Brush tool, and paint the small area with the color blue nearest to the hair.
To set that color as your Foreground color, press the Alt (Windows) or Option (macOS) key 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 on the layer to bring out 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 retrieve the original color of the hair.
If you want to know more about this, I have a video tutorial that will teach you how to create brushes for hair!
Go to the Libraries panel select any of your hairbrushes saved and use it.
Next, select the Eyedropper tool or simply press the I key on your keyboard 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 Ctrl T (Windows) or Command T (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 Options (macOS) and click on 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 and use the handles in the Input Levels to lighten or darken the hair to match with the subject’s original hair.
When you’re satisfied with the fine-tuning, press Ctrl S (Windows) or Command S (macOS) keys and close the existing tab. Then, all of the adjustments will be applied and updated on the Smart Object.
For any details you may have missed, you can quickly go back to the Smart Object to refine it and save the changes by pressing Ctrl S (Windows) or Command S (macOS).
And that’s how you match a subject with any background just by using tools and filters you’re already familiar with.
I hope this has been informational for you and may help you in your new workflow!
Drag The Slider To See Before & After