Design for Marketers
As marketers, we’re asked to wear several hats. Occasionally, one of those hats is designer. But without the right Photoshop skills, your graphics can come out looking…well let’s just say you were better off paying a designer. With our series of “Design for Marketers” demos, you will be provided with a complete toolbox of design skills needed to wow your manager with your next HTML email, image ad, or website banner.
Next up in our series is a step-by-step demo on how to remove the background from and existing image.
Hello and Welcome to design for marketers. My name is JGH and I am a graphic designer for ASPE.
In this series we offer up tips and tricks to enable you to complete common design tasks more easily and with better results. This series is specifically targeted to marketers or others who may be working on graphics projects who may not have any formal training in the field.
In this video, I will be covering the topic of removing an image’s background so that it may be placed on another background.
For this tutorial we will be using an image just has a simple white background. These same techniques can be used on a variety of images, ones with much more complicated backgrounds. For the sake of simplicity of being able to easily demonstrate these techniques and not have the video take too long, I am going to use an all-white background. The techniques are pretty much the same but sometimes take longer to fine tuning things.
The first step in this process is to create a simple selection around the image you want to remove the background from, in this case the woman here. There are several ways you can accomplish this and two of them are located under the magnetic lasso tool; the magic wand tool and the quick selection tool. A third way, is the magnetic lasso tool then finally we have select color range. Each of them is used for different types of backgrounds or types of objects, but some of them can work in the same situation. I will jus briefly go over each of these and go over these differences of the tools.
Magic wand is very good if you have a background which is pretty much is one solid color. Select the magic wand tool and click on the background. It will just select all of the background for you. Obviously, the images that I picked is very easy to do this on, but you might have images that you are working on that have slightly more complicated backgrounds so this would not work quite as well. With the magic wand tools I keep the tolerance to set around 10, if you have much higher than that it will start selecting parts of your object and you don’t want that. Even with this one sleeve it’s pretty light and blends in with the background so it selected a little bit of that sleeve. However, we can go back and fix that up later. You also want to have “contiguous” checked otherwise if there was a bit of white in your object, it would select that. If contiguous is checked it means it only selected colors that are touching. If there is another color within the object that matches the background, it still will not select that. It is leaving a little bit of background white here. We will have to go back and select that later, but it is much better than having to pick out a bunch of different white from within the object that we don’t want selected.
To show you a different method, I’m going to go ahead and deselect that. If we use the click selection tool then we basically take this and paint over our object that we want selected. This is good if your background is not one solid color but your image is fairly similar. So if you have an object that has a lot of detail to it, then this generally does not work very well. This tool can also sometimes be a little finicky and can sometimes select large areas of your image that you don’t want selected. How I undid that, I held down the ALT (or Option key on Mac) and painted back over which deselected what I had previously selected. Now we are back to basically the same place that we were with the magic wand tool. Again, it can’t really do very well on that sleeve. If I try and get it selected then it tries to select this whole half of the image so we are just going to leave that partially selected. Now after undoing that we will go to the magnetic lasso tool. With this tool it does not matter how complicated the inside of the image is or the background itself as long as there is a clear definition between the two. So for this, you basically just run along the edge of your object and it will snap to what it thinks is the edge of the object. In this case it is a white background so the tool can tell what is object and what is background. It generally works pretty well. The hair is going to cause a little problem for it, but the hair is going to be a problem for all of these methods. We are going to go over how to handle that a little bit later in this video. So, you get the idea and I am just going to finish up here.
I am just going to deselect that and go onto Select-> Color Range. Now with select color range, it is somewhat similar to the magic wand tool. With one big difference, in that you can select/control how similar the color can be to the color that you have selected and it kind of fades into that color. So with all of the other methods we have been using something is either 100 percent selected or 100 percent deselected, so there is no middle range between the two. So with select color range, this is a preview here, there are some grays in there, so it’s not just completely selected or completely unselected. That would lead to an overall better quality mask but as you can see it is not perfect because of how white her shirt is, its missing some of the shirt and the papers. That’s one downside to color range, it’s harder to control and it doesn’t really have much of any edge detection. It’s harder to control what areas of the image you want selected, it selects things based on the color. Each of these 4 methods has different pros and cons and can be used for different purposes but the end result of all of them is pretty much just the same. If you use the magic wand you will have to invert your selection which you can do by going to Select-> Inverse or command+shift+i.
Now as I said, it misses this little bit of background white right here. So you can either click on the “deselect” or the “subtract from selection” button or hold down the ALT button and that will deselect that little bit that was missing. This part of her sleeve is still similar to the background and there are not really any automatic tools in Photoshop that are going to be able to detect that part, so what we will probably have to do is go in with the lasso tool. It currently has the “Add to Selection” button clicked here, so we will just click around the edges of the sleeve and it will add this to the rest of our selection. Notice there is a little bit of the collar here that is fading into the background, so we can go ahead and select that with the lasso tool. Cleaning it up this way can be done with any of methods I showed you earlier since they are all the same kind of masks that will work the same way with any of them.
At this point you might say “hey, this looks pretty good.” The outside hugs the object pretty well and it looks like you would be able to take it and put it on a different background and it would be fine. Now, let actually do that really quick… and you can see there is quite a lot of white left around the edges. As I said earlier most of these masking techniques are either 100 percent selected or 100 percent deselected, there is no middle ground. You can see here, there is not really any fade between the two. There is just a hard edge where our selection landed which causes this white line and it doesn’t really look very convincing. It is obvious that we copy and pasted from another image and that’s not really what we want. I’m going to undo the background where we have our image and the selection around it.
What we are going to do to solve that problem is use the “refine edge” button. To get that to show up in the menu bar you have to have any of these selection tools selected; the magic wand, the lasso tools, or the marquee tools. If any of these are selected then the refine edge button will show up. When you click on that, it will bring up this dialogue box here. At first glance, not very much has changed but if you select a different view, you can view the original image on black. You can see already without messing around with any of the options yet, it looks a lot better than it did when we just copy and pasted it onto a black background.
There are still some areas that need some work but simply pressing the button already made a good deal of improvement. The way the “refine edge” tool works is it has a radius around the edge of the selection you had to find and looks for background differentiation so it can figure out what is the background and what is the foreground in order to fade between the two of them. You can also define how large a radius around that edge you want to search for. So if you have a much larger radius and since that shoulder is so similar to the background, it is getting the rest of that. So we want the radius to be pretty small for the most of this. The reason why it still has the white in the hair is because the radius isn’t large enough up in the hair. The “smart radius” which I have checked here, attempts to figure out how much it needs to look at but it can’t really solve everything. So, click “show radius” here, it will show you where it thinks it needs to look to figure out where the edges of the object are. As you can see, it is not really looking inside that hair area at all. What we can do to solve that is using the default tool that is selected when you go into the refine edge dialogue is the refine radius tool. If we take that and make it a little bit smaller just by clicking the left square bracket button, we go ahead and paint over this area that had the white in the hair. It is going to be able to tell that it needs to check for edges in that area. It might have over did it a little bit but we can fix that by playing with the settings below.
Basically anywhere that is white or anywhere there is that edge of the hair you can go ahead and paint over that so that PhotoShop knows to look in that area for the edges. The rest of the image should be good just because we used the “Automatic Edge Detection”. So what we have here is the default in automatic edge detector. Even though the edge detection radius is giving us a little bit of a smooth edge there, there is some jaggedness in a lot of places so we are going to bump up “Smooth” just a little bit here. You can see that it is already helping a lot. That gives us a much more even edge but it is looking a little fuzzy so we can go ahead and increase the contrast a little bit which isn’t going to return it to the jaggedness but make it a little bit more of a hard edge. There is not much blending between her and the background. So now I will just keep the settings as they are and just fix that later.
With this particular example it does not make much for a difference but this “Decontaminate colors” button is very useful if you are removing an object from a colored background. If the background had been anything but white, if it had been red or blue, there would have been a little bit of the color seeping into the object and we don’t want that previous color highlighting the edge of our object. So the “Decontaminate Colors” button, detects what color the background is and tries to remove that from the edges of the object. I normally always leave it checked but it is still useful to know what it does because there are some occasions when you do not want that button checked.
Now, using the “Output To” field we are going to select “New Layer with Layer Mask”. This is the default when you check “Decontaiminate Colors” but it is also my preferred output because it gives you a lot of options that you can continue to use to refine this after you get out of this dialogue. We are going to go ahead and click Okay on the box now.
As you can see, we still have our original layer here and now we have a new layer and a layer mask. If you watched our previous video on Layer Masks you will have some previous knowledge but I will recap quickly. A Layer mask is something that is linked with a layer. Where a layer mask is white the object is visible. If the layer mask is black then the object is not visible. Layer masks are also in grey scale so if you have levels of gray, 50 percent gray for example, then the object is going to be 50 percent transparent. That is very useful for not having those hard edges we had when we used a basic selection. One other great thing about a layer mask is that it doesn’t affect the layer at all. So the layer underneath this layer mask is still there. So, if we now get a brush tool and click on the layer mask here so we are drawing on the correct one and select a black and then we can draw in black. Then if you go back in white, you can draw back the image that you erased with the black paint. But the great thing about layer masks is that you don’t necessarily have to undo if you make a mistake. If it had all been contained within the object that I used then I do not have to undo anything and can just switch over to white to draw it back in and it will reappear. So for a layer mask, if you have been working with an image for a long period of time and realize that you did something you didn’t mean to way back at the beginning, you won’t have to undo everything. You can go back and redraw the part that you messed up on because the layer still exists. This is much better than using the eraser tool or because the only way to get the object back after you have erased it would be the undo tool and there is obviously a limit to how much you can do.
Now let’s get this image on a contrasting background to see how we’re doing. In a lot of cases the background that you are putting an object on is going to be pretty similar to the background that you are taking from and so you could just go ahead and put it on the background that it is going to be used on and just make sure it looks good there. However, I usually like to put it on as contrasting background as I can just because there may be things that you can’t see on the screen, especially if you are planning on printing the image out. The printed page is a lot less forgiving than your screen is, so there may be some details you are missing if you just put it on a background that is pretty similar to what it is coming from. So just to be safe I like to have a layer behind it, which I am going to create now with the New Layer button. I usually like to have it on a very bright color that is pretty different from the image itself so it’s easy to tell what is the image and what is the background. So now I am going to select the paint bucket tool and fill that in with the color. Now you can see there is a little bit of white here so we are going to go get our paint brush tool and click back on the layer mask. We don’t want this white to show up so we are going to be drawing black it will make this object no longer visible. You can either hit the arrows keys or you can hit the X key on your keyboard and that will flip the foreground and the background. This is very useful for working with the layer masks so you can quickly switch back and forth between drawing and erasing. Still have a little bit of white there so I am going to zoom in so I can get a little bit more detailed with this.
This was overall a pretty simple image to mask out so PhotoShop was able to do it pretty well on its own. When you look at the edge of this folder you can see it looks a little weird but I can’t tell exactly what the issue is so I am going to go ahead and take our previous layer with the refine edge left intact, it did not modify that at all. It just created a new layer. We are going to take that and make it visible again and turn down the Opacity a little bit. We can just kind of see that layer and we can still see how our new layer is different. You can continue editing this layer mask, editing little bits of the background that you don’t want. You can spend as long or as short doing this as you want but it is completely dependent on your application and if it is just going to be a thumbnail then you don’t really need to spend much time at all but if you are going to be printing your image out then you would want to spend a good amount of time touching things up and making sure that there is none of that little masking residue left.
This is basically all that there is when changing backgrounds. At this point the image is completely separate and you can take the image and move it around or put it on whatever background you want. That is it for this video, thank you for watching.