This first of a four-part series covers how to remove backgrounds using a seldom-used variant of the Eraser tool
Figure 1: The Background Eraser icon.
It’s buried in the toolbar and I don’t see many users working with it, but the Background Eraser tool is an interesting little piece of Photoshop engineering that can help you out when you’re caught with certain kinds of backgrounds that other tools can’t touch (or can’t touch without mangling the foreground object you’re trying to preserve!). This article is the first in a four-part series that will cover four tools that you may not be aware of and will help you solve some tough situations.
When to use the Background Eraser
The Background Eraser tool (see Figure 1 for its icon) works by Option/Alt-clicking to sample the color that is at its center (or, hotspot) and then deletes all pixels of that color or close to that color that lie within the eraser’s boundaries. This makes it a great tool to use for erasing backgrounds that are a different color than the foreground object, even when the background may have dark and light elements like clouds or other things that the Magic Wand tool or other value-sensitive tools would leave out. This is a great thing to remember when a background has some stray pixels that you can’t grab in one pass with the Magic Wand tool: use the Background Eraser and remove them all at once!
Use the Background Eraser to remove backgrounds that are a different color than your foreground object!
The downside to using color as your basis for pixel removal, as all you colorists already know, is that in the real world color is getting thrown all over the place. Shadows and highlights on an object often carry some of the color from the light or the reflected light coming off a colored object, and Photoshop is not smart enough to know what color to keep and what to delete. That is the Background Eraser’s downfall, and on some images you may find using this tool requires some precision in order to preserve some highlights or cast colors that need to remain on the foreground object.
Figure 2: Subject and background, separated by color.
Figure 2 is a good candidate for the Background Eraser tool. The blue sky and red lighthouse are very different in hue so it should work well. Problem spots will be the door, glass and metalwork at the top of the lighthouse as well as the white window frames on the sides, which have a color cast created by the blue of the sky. As we erase close to the horizon we’ll also encounter the ocean in the distance and the tree, fence and grass to the left, all of which has blue elements and will make the job tougher.
Figure 3: The Background Eraser tool’s Options settings.
Figure 3 shows the tool settings in the Options bar (I assembled them vertically for this visual aid):
- The Brush pop-up allows you to change size, hardness and other features of the eraser’s shape
- The Sampling buttons are new to Photoshop CS2, which in CS and earlier versions were kept in a simple drop-down menu. These buttons control how the Background Eraser tool samples the color to be erased:
- Continuous (the icon with a moving eyedropper) will sample a new color every time the cursor is moved
- Once (the icon with a target and eyedropper) will sample color with the first Option/Alt-click and will continue to delete pixels of that color until a new color is sampled
- Background Swatch (the icon with the foreground/background swatches) will enable the Background Eraser tool to delete pixels containing the same color as the background swatch
- The Limits drop-down menu controls what pixels the Background Eraser tool can edit at any given moment (see Figure 4):
- Discontiguous edits any and every pixel of that color that fall within the eraser’s boundaries
- Contiguous edits only pixels of that color that are in the region sampled by the hotspot
- Find Edges edits exactly like Contiguous except it also preserves the sharpness of shape edges and can create some strange shapes if it comes across hard-edged elements or pixels that are a bit darker or lighter than
- Tolerance, the tool’s most important setting, controls how sensitive the eraser will be when deleting pixels
- The Protect Foreground Color checkbox allows you to preserve pixels that are the same color as the foreground color swatch
Figure 4: The effects of the various Limits settings.
The two options you will use most often will probably be the Tolerance and Limits options, as they control how sensitive the eraser is and which pixels you want to edit within the image. I usually keep my Sampling set for Continuous, my Limits set for Discontiguous and my Tolerance set anywhere from 25% to 40% or 50%, depending on the image at hand.
To the lighthouse
My task with the lighthouse image in Figure 2 is to delete the sky background and insert another one later. This image is flattened (meaning there’s only one layer, the Background) but the Background Eraser tool erases to transparency (there’s one other tool that does this, can you name it?) so once I start working with the tool my Background will convert to a regular transparent layer. I’m going to save Photoshop the work and do it myself, and set up a little visual aid to help me work:
Step 1: Double-click the Background in the Layers palette and then click OK in the New Layer dialog box in order to convert the Background into a transparent layer named “Layer 0″.
Step 2: Hold the Command key (PC users use Ctrl) and click the New Layer button on the bottom of the Layers palette to create a new layer below the image layer.
Step 3: Fill the new layer with a vibrant or bright color so when you erase the image you will have visual feedback of what you are deleting. I am using a bright yellow in this example.
These first three steps are optional, but I like to use them because the usual checkerboard pattern to show transparency sometimes doesn’t show up well and you can’t tell exactly what pixels are being deleted. Now for the actual erasing:
Step 4: Set the Background Eraser tool with a 800-pixel hard-edged brush, Discontiguous limits and Tolerance of 35%.
Step 5: Click on the blue sky and drag as the Background Eraser tool removes the blue sky and preserves the red lighthouse.
- Areas with color variations, like the clouds, will be tougher than the flat sky. Click on these stubborn areas to erase them and others like them in the same brush area.
- Lower your brush size to attack small or hard-to-reach areas. To erase the area by the fence and tree at lower right, I had to shrink my brush down to 200 pixels or I would have erased the blue in the window frame.
- Leftover pixels will show up as faint discolorations or “dust” on your background color. In my case, I could see faint blue and green discoloration on my yellow color. A few more passes with the Background Eraser tool will clean it up. A higher Tolerance at the outset will help too.
- The ocean at the lower right ended up being too similar to the sky to make the job easy, so I used the Marquee tool to select the ocean, then selected Select -> Inverse to select everything except the ocean, then erased as usual.
- You’ll notice some of the yellow is showing up on the glass panes beside the lighthouse lantern. This is the reflected blue light coming off the glass; my eraser brush was large enough to catch it as well as the blue sky between the metalwork.
- After I have erased all the pixels that I can see, I like to zoom in, set my Background Eraser tool at a high Tolerance such as 80%, then shake the mouse around any areas that look like they may have stray pixels. Fast, jerky movements on the problem areas ensure that I catch as many pixels as I can while my Sampling is set for Continuous.
A new day is dawning
Figure 5: The Background Eraser tool does its job!
Figure 5 is the result, a red lighthouse with a bright yellow background! And of course from here what you do with your image is up to you. In my case I have a nice photograph of clouds over the sea (Figure 6), and in Figure 7 I made it my new background by simply dragging the image onto my edited lighthouse image, then moving the clouds layer behind the lighthouse layer. And because the Background Eraser tool knocked out some of the reflected light on the glass, the color of the new sky shows up in its place and automatically creates a convincing reflected color that matches the sky. Easy!
Figure 6: My new background.
Figure 7: Incorporating this new background is a breeze!
About next time
On Sunday, November 13 I will publish Part 2 of my series on removing backgrounds. We will feature another tool, I won’t tell you what it is here but it is the only other tool in Photoshop that by default erases an image to transparency rather than white (I mentioned this earlier in this article). It’s another tool that is relatively obscure but once you start using you’ll wonder how you got along without it!
Part 1: The Background Eraser Tool
The Background Eraser tool removes backgrounds according to color, which makes it useful for images where the foreground object and background object have different color hues.
Part 2: The Magic Eraser Tool
The Magic Eraser tool is a combination of the Eraser and Magic Wand tools, which makes it valuable in situations where backgrounds have a uniform color and value.
Part 3: The Magnetic Lasso Tool
The Magnetic Lasso tool seeks edges with high contrast, making it a tool that can snap to a foreground object’s edges quickly in order to remove the background.
Part 4: The Extract Filter
The Extract filter is a complex tool for eliminating the toughest backgrounds, including those dealing with hair, fur, leaves and blurred edges.