The Magic Eraser Tool is one of many brush based tools in Photoshop. It "erases" the background, but how this works depends on which Sampling option you choose and then additional options..
If you use appropriate Sampling and other options, it can do a very good job of erasing a background.
However, there are other tools and techniques that provide a better solution, which I'll describe more fully in the summary, below.
You can create and save a Tool Preset for any tool, which will remember settings that you choose for that tool, so you can quickly and easily select different presets and settings for a particular tool. The degree of usefulness of presets varies, depending on the tool.
You can reset any tool back to its default settings by right clicking on the Tool Presets button and select Reset Tool. Take care not to Reset All Tools, unless that is intended.
This is one of the key settings when using the Magic Eraser tool.
The higher the Tolerance, the more pixels are selected, depending on where you click and also on the Contiguous setting.
The default setting is 32px and this works well for many scenarios. When you click on an area, the tool will select pixels that are within 32 levels brighter and 32 levels darker than the pixel(s) that you clicked on. Bear in mind that a jpeg image has 156 levels of tone from black to white.
Anti-alias smooths out pixelated lines and edges.
Two circles were created with the Elliptical Marquee (press and hold Shift, while dragging for a circle), then both were filled with black. The top circle was created without anti-alias, while the bottom circle was created with anti-alias.
The bottom circles smoother than the top circle.
Anti-alias options exist in other tools as well. I recommend that where available, you turn on Anti-alias and leave it turned on.
Note that Anti-alias is only available for the Elliptical Marquee. It is not available for the other Marquee tools.
This is another key setting for the Magic Eraser.
Contiguous will select pixels if they are touching other pixels that will be selected.
Non-Contiguous means that any pixels, regardless of where they are in the image, will be selected, provided they are within the Tolerance setting (a number of tones lighter and darker than where you click in the image. This is the setting to use for selecting the sky within the leaves and branches of a tree.
Choose whether you make a selection based on the content of all visible layers, or just the selected layer.
The default setting is 100% Opacity. This will erase all of what is selected. A lower Opacity figure would erase less, leaving more of your selected area, visible.
This guide will show you how to use the Magic Eraser Tool. It works well in many situations and better than its sibling, the Background Eraser tool. But like the Background Eraser, it works less well in other situations. And also like the Background Eraser, there are better alternatives, which are both quicker and produce a better quality result, which I explain in the Summary, at the bottom of this guide.
To allow an easy comparison between these tools, I will use the same image of a tomato against a white background. This image should be easy for most tools to achieve a good result.
Select the Magic Eraser Tool from the toolbar. Like most tools, it shares the button with other tools and the one that is visible will be the last tool used.
The green circle highlights the cursor, which shows where I click to select. The next step shows the result.
This step and all steps up to and including Step 11 are made with the default Tolerance of 32. Wherever you click, all pixels are erased if they are within 32 tones darker and lighter than where you clicked.
In this image, because of the simple white background, most pixels are within that range.
Contiguous is also selected, which means that to be selected, not only do the pixels need to be within the Tolerance range, they also need to be touching other selected pixels. If there are any light areas in the tomato that are within the Tolerance, they would not be selected, as they don't touch other selected pixels.
The green circle highlights the cursor, which shows where I clicked in the previous step.
The green circle highlights the cursor, which shows where I click to select. The next step shows the result.
The green circle highlights the cursor, which shows where I clicked in the previous step.
The green circle highlights the cursor, which shows where I click to select. The next step shows the result.
The green circle highlights the cursor, which shows where I clicked in the previous step.
The green circle highlights the cursor, which shows where I click to select. The next step shows the result.
The green circle highlights the cursor, which shows where I clicked in the previous step.
The pink circle highlights some unselected pixels, that are hard to see.
The green circle highlights the cursor, which shows where I click to select. The next step shows the result.
The green circle highlights the cursor, which shows where I clicked in the previous step.
As mentioned above, all the clicking so far has been done with the default Tolerance setting of 32. In this case, clicking on the dark shadow area is too similar to tones in the tomato, so they've been erased tool.
I will now undo this step and proceed with a lower Tolerance of 15.
I adjusted the Tolerance to 15, then clicked as shown in the green circle, with a better result than the previous step.
While working on an image, be prepared to use different Tolerance settings in different parts of the image. If too much is erased, then undo and try again with a lower setting.
At lower Tolerance settings, you will need to click in more places. But be aware that because you are selecting less pixels, some may get missed, as highlighted here in pink (they are hard to see).
I have continued clicking in the shadow areas.
The darkest of the shadow area is so close to the color of the tomato, that the tool struggles, as shown in the next step.
Because the shadow is so similar to the dark part of the tomato, some of the tomato is erased when clicking on the shadow.
The green circle highlights the cursor, which shows where I clicked.
The pink highlight shows some of the pixels that were not selected earlier (also highlighted in pink in Step 13).
With the Object Select Tool, just holding the cursor over the tomato highlights an almost perfect selection of the tomato, except for the green bit at the top.
This is the result of the previous step. True, it didn't select the green bit, but it's done a great job of selecting the tomato, including the shadow area at the bottom that caused problems for the Background Eraser.
Let's try the Object Select tool again, but this time drag a selection around the tomato, instead of clicking on it.
See the next step for the result.
This is the result of the previous step. I unlocked the background layer (click on the lock icon) and inverted the selection, (Ctrl+Shift+I, or from the menu; Select > Inverse, then pressed the Delete key.
I would normally use a Layer Mask, but to make a direct comparison to the Background Eraser, I deleted the pixels instead.
This took just a few seconds to achieve a far superior result, compared to minutes and a steady hand with the Background Eraser...and all for an inferior result.
The Magic Eraser Tool attempts to erase wherever you click and similar colored pixels, depending on Tolerance and Contiguous settings.
This tool works just like the Magic Wand, with the same settings of Tolerance and Contiguous, except the Magic Wand makes a selection, rather than immediately deleting pixels. This makes an important difference. With the Magic Wand you can see if any part of your subject will be selected and you can adjust this before deleting pixels. The Magic Eraser does not allow you to see this. In fact in the above example, it did delete pixels from the left edge of the tomato, but this was not easily detectable.
Even without this disadvantage, as you can see from the above example, it's not a perfect tool. There are other tools in Photoshop that will do a better job and do it more quickly. Tools such as the Object Select tool and Quick Selection Tool, or the Magic Wand in some situations.
The comparison with the Object Selection Tool shows how pointless it is to try erasing a background with this tool, when there are superior tools.
The tomato is a simple image that should make it easy for the tool, as it did for the Object Selection tool. With more complex images, the results are worse.
When you want to remove a background use another tool, but which one is best will depend on the image. Start with the Object Selection tool. For more information and a detailed look, see my guide to the Object Selection Tool, Quick Selection Tool, Magic Wand Tool.