Photoshop Trick: Separating the Foreground from the Background

156K views 4,841 likes 167 comments

Jump to a step in the video (6)

Click a time to play the video from there.

  1. 0:00 Introduction
  2. 0:42 Select and Mask the Main Subject
  3. 2:43 Organize the Layers
  4. 2:57 Content-Aware Fill to Remove Runner from Background
  5. 4:51 Distort Runner with the Liquify Filter
  6. 6:36 Distort Runner with the Liquify Filter
Show Shortcuts for
Text size
Appearance

Your choices stick across every tutorial on this device.

Separate foreground from background in Photoshop by masking your subject onto its own layer so you can edit, reshape, or move it without touching the background.

Separating the Foreground from the Background in Photoshop is the perfect fix for every awkward posture, off-center subject, and a distracting background.

In this tutorial, you will learn why separating the Foreground from the Background is the best kept Photoshop secret that you are not using! Even if you are not compositing and just working with a single photo.

In this example, we will use an image of a runner caught mid-movement. Separating the background from the foreground lets you easily alter the posture of the runner and make clothing look perfect-fitting. You can also move the subject to a different position within the image.

Key Takeaways

  • Layer masks let you delete a background from one copy while keeping it untouched on another, so nothing is lost.
  • Select Subject finds your subject in one click, but a quick Alt or Option click-drag still fixes any spot it misses.
  • Converting the isolated subject to a Smart Object keeps every later edit, Liquify, Puppet Warp, or a move, fully reversible.
  • Content-Aware Fill rebuilds the space left behind once the subject is gone, so the background looks untouched.
  • Because the subject sits on its own layer, reshaping it with Liquify or Puppet Warp never disturbs a single background pixel.
  • Once separated, you can reposition the subject anywhere in the frame with the Move tool without leaving a gap.

What You Will Learn

  • How to select a subject quickly with Select Subject and clean up any missed spots
  • How to turn that selection into a layer mask that separates the subject from the background
  • How to rebuild the background left behind with Content-Aware Fill
  • How to convert the isolated subject into a Smart Object for nondestructive edits
  • How to reshape a subject with Liquify and Puppet Warp without touching the background
  • How to reposition the subject anywhere in the frame with the Move tool

Requirements

Before you start

Keyboard Shortcuts

ActionWindowsmacOS
Zoom ToolZZ
Decrease / increase brush size[ / ][ / ]
Pan the canvas (drag with the tool active)Space BarSpace Bar
Subtract from a selection with the Quick Selection Tool (click and drag)AltOption
Load a layer mask as a selection (click the mask thumbnail)CtrlCommand
Group selected layersCtrl GCommand G
Open the Fill dialogShift BackspaceShift Delete
DeselectCtrl DCommand D
Set a Clone Stamp sample source (click to set it)AltOption
Rotate a Puppet Warp pin (click the pin)AltOption
Move ToolVV
Clone Stamp ToolSS

Let’s get started!

Select the Main Subject of The Photo

You can follow along with this Adobe Stock Image of a man running.

First, make a selection around the runner.

There are several different ways to make a selection of the main subject: you can use the Pen tool, Magnetic Lasso tool, Magic Wand tool, or Quick Selection tool. However, these tools will require your time and effort to select the desired areas.

Select Subject has worked the same way since Photoshop 2018 (version 19.1), and it can cut that time down to one click. Go to Select > Select Subject.

Using the Select Subject command will automatically make a selection around the subject.

Select Subject uses Photoshop’s built-in Artificial Intelligence (AI) that uses machine learning technology to figure out what the main subject is.

Click here to learn more about the Select Subject tool!

While ultimately reliable, it can make small mistakes that you can easily correct. Look for areas that may have been overlooked by the AI.

In this example, deselect the space between the arm and the body.

To deselect a small area, like the gap between an arm and the body, select the Quick Selection tool. Hold Alt (Windows) or Option (macOS), then click and drag around the area to deselect it.

Separate Foreground From Background in Photoshop

The next step is to duplicate the background by dragging it down to the New Layer icon. Repeat this step twice to make two duplicate copies.

Note: With a selection active, CtrlJ (Windows) or CommandJ (macOS) only duplicates the contents of the selection, not the entire layer.

Always try to name your layers so that you know what they control. In this case, you can rename the top copy to “Runner.”

Two duplicates of the background layer stacked in the Layers panel with the top one renamed Runner

With the selection still active, click the “Runner” layer. In the Layers panel, click the New Layer Mask icon to make a mask out of the selection. This step will remove the background from the current layer.

Then select both the “Runner” layer and the Background Copy layer. Hold Shift and click on both, then press CtrlG (Windows) or CommandG (macOS) to place them into a group.

You can call the new group “Edit.”

Isolate the Foreground From the Background

Now that we have two layers inside the Edit group, we can focus on separating the Foreground from the Background effect.

Make a selection out of the “Runner” layer mask by holding Ctrl (Windows) or Command (macOS) and clicking the Runner Layer Mask thumbnail.

Loading the Runner layer mask as a selection to separate foreground from background in Photoshop

Then go to Select > Modify > Expand. This step opens the Expand Selection window, and then set the expansion by 3px and press OK.

Choosing Expand from the Select and Modify submenu
Expand Selection window with the amount set to 3 pixels

Next, press ShiftBackspace (Windows) or ShiftDelete (macOS) to open the Fill window.

Under the Contents drop-down, select Content-Aware and press OK.

Fill window with Content-Aware picked from the Contents drop-down

Content-Aware will fill the selection with “content” similar to the surrounding areas in the selection, making it seem like the runner was never there.

Note: With more complicated backgrounds, you may want to try the Content-Aware Fill workspace to get better results.

Press CtrlD (Windows) or CommandD (macOS) to deselect and turn off the marching ants.

Although the fill works great, it is not perfect. For areas that need more work, use the Clone Stamp tool, S (Windows) or S (macOS), to apply a seamless transition. It maintains consistency between the original background and the area where Content-Aware worked.

After you’re done, you will have a clean background with no runner! Once you enable the Runner layer you will have your original image back, but it is now in two layers!

Edit the Foreground and Background Independently

One of the many perks of separating the foreground from the background is that you can adjust the subject without affecting a single pixel of the background, and vice versa.

To have even more control, you can select the “Runner” layer, right-click, and select Convert to Smart Object.

Note: A Smart Object is a container that can hold one or more layers. It allows you to apply editable adjustments, distortions, filters, and transformations.

Adjustments After You Separate the Foreground From the Background

Liquify Filter

  • From the Menu bar, click on Edit > Liquify.
  • On the View options, check the box beside the Show Backdrop. Initially, it will show “All Layers” but click on it to reveal the drop-down menu and click Background Copy.
Check the box for Show Backdrop
  • By separating the foreground from the background, you can now use the Liquify tool on the runner without distorting the background details.
  • The Liquify Filter can also be used to fix minor issues such as wrinkles in the clothing or refine the subject’s body.

Puppet Warp

  • On the Menu bar, click Edit > Puppet Warp.
Puppet Warp being chosen from the Edit menu
  • To see the guides, click the checkbox on the Options bar to Show Mesh.
  • To create points, place them strategically where the joints are, such as the neck, elbows, shoulders, ankles, and knees.
  • By adding these points, you can distort the subject’s posture by clicking and dragging them to the desired positions.
Puppet Warp mesh shown over the runner with pins placed at the neck, elbows, knees, and ankles
  • To adjust the angle of a foot or hand, hold Alt (Windows) or Option (macOS) and click on the point to rotate it to your desired placement or angle.
Holding Alt and clicking a pin to rotate the angle of a foot or hand

Move tool

  • Press V (Windows) or V (macOS) on your keyboard to use the Move tool. This allows you to move the subject anywhere in the frame just by click-and-drag.

These are three ways you can adjust your image once you have separated the foreground from the Background.

Frequently Asked Questions

What does it mean to separate the foreground from the background in Photoshop?

It means putting your subject on its own layer, with a matching layer mask, while a full copy of the background sits underneath. You can then edit either one without changing the other.

How do I select a subject before separating it from the background?

Choose Select > Select Subject for an automatic selection. Then use the Quick Selection tool. Hold Alt (Windows) or Option (macOS) and click-drag over any small area it missed, such as the gap between an arm and the body.

Why can’t I use Ctrl J or Command J to duplicate the layer during this technique?

With a selection still active, CtrlJ (Windows) or CommandJ (macOS) only duplicates the pixels inside that selection, not the whole layer. Deselect first, or duplicate the full background layer before making your selection.

How do you fill in the background after removing the subject?

Load the subject’s layer mask as a selection, expand it by a few pixels, then open Edit > Fill and choose Content-Aware from the Contents menu. Photoshop rebuilds the missing area to match the surroundings.

Why convert the separated subject to a Smart Object?

A Smart Object keeps filters and transformations editable. You can revisit Liquify or Puppet Warp later and adjust the amount without starting over.

Can I move the subject to a different part of the photo after separating it?

Yes. Once the subject is on its own layer, select the Move tool and drag it anywhere in the frame. The rebuilt background stays exactly where it is.

Do I need Photoshop 2020 to use Select Subject?

No. Select Subject has worked the same way since Photoshop 2018 (version 19.1), so any version from then on, including the current version, supports it.

Conclusion

Once you separate foreground from background in Photoshop, you can fix a posture, resize clothing, or reposition a subject without touching the rest of the photo.

The same layer mask and Smart Object setup works whether you are fixing one photo or building a full composite.

Watch the full video above, 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: Photoshop Trick: Separating the Foreground from the Background
Before: Photoshop Trick: Separating the Foreground from the Background
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