Woman in workout clothes doing a plank exercise on an outdoor balcony overlooking a city skyline, hero image for a tutorial on changing the background using AI in Photoshop
  • How to Change Background Using AI in Photoshop

  • Aaron Nace
    by Aaron Nace
    September 12, 2024
  • Add to
    favorites

Download Assets

This tutorial includes 1 sample image, 1 sample PSD and 1 PDF guide. Downloads are free with a PHLEARN account.

  • Download the sample images and PSDs from every free tutorial on PHLEARN
  • New free tutorials published every week
  • One free account — sign up once, then download anything
Download

Free PDF Guide · 4 Pages

This Tutorial as a Step-by-Step PDF

The 4-page guide walks through Remove Background, Generate Background with busy city street, the layer stack Photoshop builds, then keeping the real floor: duplicate, delete the mask, Remove Background again, Rectangular Marquee the floor and fill the mask with white before generating a rooftop skyline and clicking Upscale. Keep it next to your keyboard.

Download the PDF Guide · 0.5 MB

description

How to change background using AI in Photoshop, and where the one-click version falls apart.

Photoshop’s Remove Background and Generate Background buttons will cut your subject out and invent a whole new scene behind them in about two clicks. In this free tutorial we run that one-click version first, then read the layer stack it builds so you know exactly what Photoshop did.

Then we build the better version: mask the real floor back in so your subject keeps the ground and the contact shadow they were actually photographed on, and let Photoshop generate only what sits behind them. We finish with the new Upscale button to bring detail back into the generated area.

Image Source

Photography by Mikhail Nilov, sourced from Pexels.

A woman doing a plank exercise on a wooden box against a plain concrete wall
The same woman with the background replaced by a city skyline view from a rooftop, using Photoshop’s Generate Background
AfterBefore

How to Change Background Using AI in Photoshop

Cutting a subject out and dropping in a new background used to be the slowest part of a composite. Photoshop now has two buttons that do most of it — Remove Background and Generate Background — and they are good enough that the interesting question is no longer whether they work, but how much of the original photograph you should keep.

This tutorial walks through the fast one-click route, then a hybrid version that keeps the real floor your subject is standing on and generates only what sits behind them.

What Remove Background Actually Does

With your image open, the contextual task bar sits below your canvas with the most likely next action already on it. For a photo of a person, that action is Remove Background.

It is worth knowing what it runs under the hood, because it is not a brand new selection engine. It is a Select Subject pass combined with a layer mask. Everything you already know about how Select Subject handles hair, edges and held objects still applies here.

  1. Open your sample image

    Any portrait with a clearly separated subject will do.

  2. Click Remove Background in the contextual task bar

    Photoshop selects the subject and applies the result as a mask.

  3. Look at the Layers panel before doing anything else

    You will see your original layer with a mask attached, not a cut-out on a transparent layer. Nothing has been deleted.

The original studio photograph before the background is replaced in Photoshop

Why It Is a Mask and Not a Deletion

The distinction matters for the rest of this tutorial. Because the cut-out is a mask, every pixel of the original background is still sitting there, hidden. You can paint any part of it back at any time — which is exactly the trick the hybrid method later depends on. If Remove Background erased pixels instead, none of what follows would be possible. This is the same reason masks beat the Eraser Tool for any kind of cut-out work.

Generating a New Background from a Prompt

Once the subject is masked, a second option appears: Generate Background. This is Generative Fill wearing a different hat, pointed at the masked-off area instead of a selection you drew yourself.

You can also simply import a background image instead. That is worth knowing, but it is a plain placement — the imported photo goes behind your subject and Photoshop makes no attempt to blend the two together.

  1. Click Generate Background

    The prompt field opens with the masked area already targeted.

  2. Type a short scene description

    Something as plain as busy city street is enough to start.

  3. Click Generate

    Photoshop returns a set of variations you can cycle through in the Properties panel.

What the First Result Gets Right

Three things stand out on a good first generation. The shadows read correctly against the new scene rather than fighting it. Objects that were part of the subject — a bag or a box being held — stay with the subject instead of being swallowed by the background. And the generated street comes back out of focus, so it sits behind the subject rather than competing with them.

If you want more control over what comes back, you can feed Generative Fill a reference image alongside the prompt.

Reading What Photoshop Built

Open the Layers panel and the whole operation is laid out plainly: your subject selected and held on a layer mask, with a newly generated background sitting underneath. It is the same layer stack you would have built by hand in a manual composite, assembled for you.

Take a moment here, because understanding that stack is what makes the next method obvious rather than magical.

Keeping the Real Floor: the Hybrid Method

The one-click version replaces everything behind the subject, floor included. The hybrid version replaces only what sits behind them and leaves the ground they are actually standing on untouched.

  1. Duplicate your layer

    Click and drag the layer down onto the new layer icon at the bottom of the Layers panel.

  2. Delete the mask on the duplicate

    Drag that layer’s mask to the trash and confirm. You want a clean, unmasked layer to start from.

  3. Hide the earlier versions

    Switch off their visibility so you are only looking at the layer you are working on.

  4. Run Remove Background again

    Same button, fresh layer. You are back to a subject on a mask.

  5. Select the floor with the Rectangular Marquee Tool

    Drag a selection across the bottom of the frame, covering the floor beneath your subject.

  6. Click the layer mask, then fill the selection with white

    Make sure you are targeting the mask and not the image, then fill.

Filling the floor area with white on the layer mask to restore the real ground in Photoshop

Why Filling With White Brings the Floor Back

On a layer mask, white reveals and black conceals. Remove Background filled everything outside your subject with black. Painting or filling white back into the bottom strip re-reveals that part of the original photograph — floor, shadow and all. If the Marquee Tool is new to you, this is about as clear a demonstration of what a mask is doing as you will find.

Keep the Earlier Versions Around

There is no reason to throw the first attempt away. Leaving each version on its own hidden layer costs nothing and lets you flip between approaches at the end, when you can finally judge them side by side rather than one at a time.

Generating Behind a Real Foreground

With the floor restored, click Generate Background again and give it a different scene — rooftop big city skyscraper, for instance. What comes back is a railing and a city skyline behind the subject, and the whole frame now reads as a rooftop.

The reason this holds up is simple and worth stating plainly: the foreground will look completely real, because it is real. That strip of floor is still a photograph. Only what sits behind the subject has been generated.

What Carries Over from the First Step

Generate Background still has everything it needs even though you edited the mask, because you went through the Remove Background step first. Adding the floor back does not undo that. It simply narrows the area Photoshop has to fill.

That real contact point is the part manual compositors spend the longest on — it is why How to Make Realistic Shadows in Photoshop and preserving the shadows you already have are skills worth keeping sharp.

Upscaling the Generated Area

There is a second new button worth clicking while you are here: Upscale. Run it on your generated result and Photoshop enhances the detail, which makes the background look more realistic against a full-resolution subject.

It is the same technology covered in more depth in the Upscale Tool basics and in Generative Upscale.

Comparing Your Versions Side by Side

Group your variations together in the Layers panel and you can toggle cleanly between three states: the original photograph, the fully generated background, and the hybrid with the real floor intact.

Judged against each other rather than in isolation, the differences are obvious in a way they never are while you are working on one version at a time.

How to change background using AI in Photoshop: the finished composite with a generated rooftop background and the original floor preserved

Why Keeping Part of the Photograph Wins

Generated backgrounds have got good quickly, and the one-click result genuinely holds up. But a composite where the ground, the contact shadow and the subject all came from the same camera on the same day has something a fully generated frame does not, and it costs you one extra selection to keep it.

The generative tools are also at their best when you ask them for less. Give Photoshop only the area behind your subject to invent, and it has a real surface and a real horizon to work against instead of building an entire scene from nothing.

Replace All of It, or Just Part of It

That is really the whole choice these two buttons hand you. You can replace an entire background in two clicks, or you can spend thirty more seconds masking the floor back in and keep the part of the photograph that sells the shot.

Both are now fast enough to try on the same image, which is the best argument for building them side by side and deciding at the end.

Quick Reference: Menus and Settings

  • Cut out the subjectRemove Background in the Contextual Task Bar (Select Subject plus a layer mask)
  • New backgroundGenerate Background, “busy city street”, Generate; pick a variation in the Properties panel
  • Fresh copyDrag the layer onto the new layer icon, drag its mask to the trash, Delete, then Remove Background again
  • Keep the real floorRectangular Marquee across the floor, click the layer mask, fill with white
  • Generate behind itGenerate Background, “rooftop big city skyscraper”, Generate
  • Finish and compareUpscale on the generated result, then group each version and toggle visibility
Page 1 of the free How to Change Background Using AI in Photoshop PDF guide

Free Downloads

Follow Along on the Same Photo

Get the portrait of the woman leaning on a box, the finished PSD with both generated backgrounds and the 4-page PDF guide. Free with a PHLEARN account.

Changing Backgrounds With AI: Common Questions

How do I change a background with AI in Photoshop?

Click Remove Background in the Contextual Task Bar, then Generate Background. Type a short scene such as “busy city street”, click Generate and pick a variation.

What does Remove Background actually do?

It is Select Subject combined with a layer mask. The subject is selected and the background is hidden on a mask, not deleted.

Can I use my own background photo instead?

Yes, you can import one after Remove Background. It is a standard placement behind the subject; Photoshop does not blend the two together.

Will it keep an object my subject is touching?

In the video the box she leans on is kept as part of the subject. The shadows hold up and the generated street comes back out of focus behind her.

How do I keep the real floor and only replace what’s behind the subject?

Duplicate the layer, drag its mask to the trash and run Remove Background again. Drag the Rectangular Marquee across the floor, click the layer mask, fill with white, then click Generate Background.

Why does filling the mask with white bring the floor back?

On a layer mask white reveals and black conceals. Remove Background hid everything outside the subject, and white shows that strip of the original photo again. Click the mask first, or the white lands on the photo.

Does Generate Background still work after I edit the mask?

Yes. You went through the Remove Background step first, so it has what it needs; adding the floor back just narrows the area it fills.

What does the Upscale button do here?

Click it on the generated result and Photoshop enhances the detail, which makes the new background look a little more realistic.

How do I compare the different versions?

Keep each attempt on its own hidden layers, group each option, and toggle between the original, the fully generated version and the real-floor version.

Are the sample files free?

Yes, with a free PHLEARN account. You get 1 sample image, 1 sample PSD and 1 PDF guide: the portrait, the finished layered file and a 4-page step-by-step guide.

Master Photoshop, Lightroom and Photography

Join PHLEARN PRO for $12.99 a month, or $99.99 a year (save 36%). Cancel anytime, with a 30-day money-back guarantee.

As featured in
  • 500px
  • Adobe
  • Fstoppers
  • HuffPost
  • Inc.
  • PetaPixel