Replace a photo background in Photoshop using advanced selection and masking techniques to produce clean, realistic edits. This article walks through using tools like Select Subject and Select and Mask, comparing cloud and device options to achieve optimal results.
Key Insights
- Photoshop's Select Subject feature now offers both device and cloud-based options, with the cloud version typically yielding more accurate results—though in some cases, the device option may perform better, especially around fine details like hair and hands.
- The Select and Mask workspace provides multiple preview modes and global refinement tools such as Shift Edge, Feather, and Smooth to improve selection edges and better integrate the subject with a new background.
- Using a layer mask instead of destructive deletion allows for non-destructive editing, enabling users to fine-tune the mask with brushes and return to Select and Mask for further adjustments if necessary—a technique emphasized in training from Noble Desktop.
Let's see how we can change the background of a photo. I'm going to open up this photo right here, and I think his background is a bit boring. I'd like to replace it with a different image.
So I'm going to open up this tree background here. Much more interesting background. So I want to put him onto this.
Now they are exactly the same size, same pixel dimensions. If we look down here at the bottom, we see 42,72. So same pixel dimensions.
I don't think that I need to worry about using a smart object in this case, because I'm not going to be sizing him. I'm going to be keeping him in exactly the same position, the same size. I just literally just want to change out the background.
So instead of placing him as a smart object here, I am going to just simply copy and paste him. That will keep the file a little bit smaller. If I did think there was a chance of me wanting to size him, I could convert him to a smart object either in the very beginning, or I could always do it later.
So I'm going to try to keep the file size down a little bit by just selecting all of him, copying him, and then pasting him. Notice that he is the exact same size, so I don't need to increase my file size with placing him as a smart object. So that's why we're doing it a different way for this.
All right, and I'm going to save this as man on trees and saving this as a Photoshop file to support all the layers. So this is my man on his background, and what I need to do is erase his background so I can see through to the background that's behind him. And that means that I need to make a selection for this.
So there are different ways you can go about making selections. Photoshop has some really good built-in ways where it can kind of sense what the subject matter is, and it's gotten quite good, and actually over time it's gotten even better. If you're watching this in the future, just know that sometimes when I make a selection that if the cloud version of this has been trained to be even better, it might give you a slightly different selection than what I'm showing you, just because over time these approaches to making selections, they just improve, they get better and better and better typically.
So I want to go into select here, and I want Photoshop to figure out how to select the subject of this image. When I choose select subject, it goes in and generates a selection, and that is actually really, really quite good. Now I can use select subject that way.
Let me deselect. To really get a good preview of this, this little marquee, or the marching ants as we call them, it's not a really good way to preview how good this selection truly is. Especially when there's maybe areas that are a little bit transparent like in his hair.
I really can't get a good accurate preview of this in this view. So instead I'm going to go into select and mask where we can build a selection. If I go into mask here, select the mask, I want to preview this on the layers that is currently on, and I wanted to select the subject.
So I haven't made a selection yet. So up here is select subject. Now, how is it going to make that selection? This little menu right here, I can say to select the subject using on device, which is faster, or cloud.
If I click select subject, this is the faster way using the device. But if I choose the cloud version of this and then click select subject, it's going to get rid of the current selection and it's going to remake it using the internet. So it uses the cloud version of this.
Most of the time the cloud version is better. Now you do have to go in and choose cloud. So it's set to cloud and then click select subject.
So it's kind of a two-step process. I don't know why they didn't bother just making two buttons, one that says select on device or one that says select cloud. So this does take a little bit longer, but generally speaking, most of the time cloud will give better results.
Now zooming in and looking a little bit closer here, if I choose the cloud version and make this subject selection, looking at his hand, it's not quite perfect. Doing the device version of this, actually, I do think let's take a little closer look here. I think that in this case, actually the device version might be a little bit better.
Yeah, actually looking at that, there's a bit more halos in the cloud version than the device version of this. So actually this time the device version is better. You don't really know which one's going to be better.
I would say most of the time cloud is typically better, 90% of the time. But if one of them doesn't do a great job of making the selection, it's good to know that you can try using the other one. The other thing is, let's say I choose the cloud version and hit select subject.
And then there are some finer areas. There is some hair. If I choose refine hair, let's see if that makes a difference.
Hmm, that does actually make a big difference there with his hair. Now, let's choose the device version, select subject that way. And again, his hair is kind of crispy here.
Let's hit refine hair and see if that does a better job. Hmm, that does look pretty nice. Although, I don't like how it kind of comes into his forehead.
So maybe actually the cloud version of this and then clicking refine hair, that still kind of does the same thing. So maybe actually using the device version and then refining hair. Maybe that's kind of the best of both worlds.
This might not be perfect. This will get you most of the way and it's looking pretty good. We'll still need to do some refinements.
Let's go back to this preview idea here. So how are we previewing how this looks? Previewing on layers so I can see the layers that behind it is really nice. I can also preview as a black and white.
So the black is not selected. The white is selected and we can see that it's kind of coming into his hair there. We can also preview as an overlay and this overlay we can choose can we see through to his kind of boring original background? Or do we see this color overlay? The color overlay is showing us where the selected areas are and the non-selected areas.
I personally like the red to indicate selected areas. So where I see the red it is selected as opposed to the masked or non-selected areas. So there are different ways to preview it based on what is easiest to get a true sense of how this looks.
I think in this particular image, I think it's good to see this on layers because it's a realistic way that we're going to use it. But another way could also be to view it on let's say a white background. If you were going to put this on a white background or you could view it on black.
It's best to preview it on the most realistic background that's similar to what you're going to do with it because if you were going to put it on a white background you wouldn't really notice that there are light halos around him. If you're previewing on a dark background, you actually do see those halos. And we are in fact putting it on a kind of darkish medium to darkish background.
We do see some of those halos. So that's the idea of these different preview approaches. So I'm going to say preview it on layers.
And then I can go down here and there's some global refinements that apply to the entire thing here. And so if there is an even halo all the way around like there are some kind of light areas and most of this image kind of has some of those lighter areas. So that means I'd like to kind of contract the edge in a little bit.
So there's a shift edge which I can use to make this selected area. I can make it bigger or smaller. Now keep in mind that this is happening everywhere.
If it looks good in one area but looks bad in another then you kind of need to go with this with kind of a minimal effort. And so you know this does apply everywhere. Also keep in mind as well that you have other options here.
We can shift the edge in and out. So notice here we've got a little bit of a halo there. I can shift that in.
We also have a feather which is kind of a softness. So the softness here, feather is the soft. Contrast is the opposite.
That's a hardening. So be careful of that. That would be maybe if you already have a soft selection and you want to harden it up.
That would be like the anti-feather, right? So this is like hardness and this is like a softness. I find a lot of times that you need a little bit of feather, a little bit of softness because most things are not perfectly crisp and clean and sharp. So you need a little bit but you don't need a lot.
That's going to make like a fuzzy edge that does not look very good and actually increases those halos. We probably need a little bit of feathering so that it doesn't look so crispy. Crispy edges like that just kind of look unnatural.
Having a little bit of softness there, it just blends it in a little bit more and you don't notice that crispiness of that edge. So often having a little bit of feather can help that. And there might be some things that you can't do overall.
You have to do individually. Also another option that might sometimes work as well is when you have, let me go back and undo the feather so I can show you this option here, this smooth option. So smooth is going to go in and kind of round over those like extra kind of jaggedy details.
And sometimes that can be nice. You don't want to be doing it too much because then corners can sometimes get lost. So you probably don't want to be very heavy handed with these because it'll round all of your corners.
But maybe just a little bit, sometimes just a little teeny bit can be nice just to kind of smooth things out. So it's not quite so jagged. Again, sometimes that jaggedness just doesn't look very natural.
So maybe just a little bit of smoothing, a little bit of feather and a little bit of contraction is kind of getting us. Into a better situation, but it's not going to be perfect all the time. So there might be areas that you need to go in and individually adjust like here.
I need to get rid of this because keep in mind that he was on this kind of original kind of green background. So I need to get rid of that green background so I can go in with my brush tool over here. The brush tool allows you to add or subtract from the selection.
I want to subtract from the selection, so I choose the minus there and I go in with a brush size that's nice and small that I can get into this tight little area and I can subtract that because I don't want that to be selected. If you don't remember or if you don't know which one is which, you can always try the plus. And if you realize, oh, wait, that's adding.
Well, I don't want to add. Then you got a 50 50 shot. It's either going to be to add or to remove.
And we can go in there and choose that to get rid of that. You can also go in with a hard or soft brush. If I go in maybe a little bit bigger brush and I chose to soften it, that could be good for any areas, maybe like the hair where I want to paint some of that back in.
I want to add some of that back in because I lost some of that. It was going to getting confused. Is that the background? Is it his hair? So I can add that back in.
But I want to do so with a soft edge. I don't want crispy hair here. Right, so I can go in with a soft brush to add that back in and make sure that all of that is kind of solidly there, but not with a crisp edge, but with a nice soft feathered edge.
So it looks like it's being blurred, kind of blended into the background like hair wisps often are. So you can go through and make those kind of adjustments. Sometimes you need to go in and make little adjustments here with a hard edge brush.
And so you can go in, you can use your left and right square brackets. And oh, see there I'm adding, but I meant to subtract, so I just switch over to subtract and then I go and I can subtract these areas. And get rid of any unwanted stuff that I don't want.
So you kind of take the approach of trying to do as much as you can with the global refinements to take care of everything, get that as far as you can. And then you can still do the individual refinements using things like your brush tool to add and subtract from those different areas. Once I'm all done, I can then slide down here to the output settings.
And what is this going to do? What is the final output of this selection? Is it going to be a selection as in a marquee or is it going to be a what's called a layer mask? We actually want to create a layer mask. And what a layer mask is going to be, let me show you, I'm going to hit OK. Notice this layer mask is added to this layer.
It is an editable thing. If I created a selection and then let's say I deleted the backgrounds, that would be a destructive thing. But a layer mask is you basically make a selection which gets turned into a mask and that mask is black and white.
The mask is black and white because it's hiding or showing that object. When we think about just this layer, which is just the guy, if the mask is there and it's black, the black says to hide the background or to hide whatever is on that layer. The white says to reveal.
We're revealing the guy and we're putting into black or hiding the background so that we can see through to the layer that's underneath. And because we have a mask, we still have all of the original pixels. We didn't delete any of those.
We didn't use the eraser tool to delete. We didn't make a selection and actually hit delete, which would be a destructive thing. We used a mask.
The mask is editable. I can paint with black and white on that mask. I can use my paintbrush on the mask itself.
So notice there's a target. I can see visible pixels here where I'd actually literally be seeing black and white. But here with this mask, this controls the visibility of that layer if it's black.
If I go in and I paint with black with a brush, let's say I'll do this. Let's say I paint this. Notice he disappears.
He's still there, though. It's non-destructive erasing. If I go and paint with white, I can reveal him and I can bring him back.
And let's say I bring too much back and I'm showing that original lighter background that I don't like. I can then flip over to black. See, this is one of the reasons why the default colors are black and white.
Hide versus show. And think about when you walk into a pitch black room, what do you see? Nothing. So black hides.
When you shine a white flashlight on something, you can see it. So white reveals. So white would reveal more of the background.
Black would hide the background. And so by keeping this editable as a layer mask, as opposed to erasing, like let's say I made a selection and I just hit delete, that would be destructive. This way it's non-destructive.
I can edit this anytime that I want. And if I ever want to make changes, I can also select that mask, go back into select and mask because it does both. It makes the selection and it lets you edit things.
And I can then go back and reapply settings. It won't remember what the settings were before. But you can, let's say if you want to make something more soft, you could add more feathering.
Or if you had made it too soft, you could add some contrast to remove the feathering. So from the point that you're at right now, you could always go back into select and mask to refine the mask that you already have or create a whole new selection. So this starts to give us an idea of how we can remove backgrounds by selecting the thing that we want.
And masking out the background so it looks like it's gone. I'll do a save. So I have this multi-layered file as a Photoshop file.
And we're going to do a little bit more with this in the next exercise so that we can kind of make him look more at home, falling down in the sky, like kind of make him more integrated with this. But for now, let's try this in exercise 2A so you can remove the background from this image.