If you want to remove pixels altogether—instead of replacing them with similar pixels—the Eraser tool might be your friend. I say it might be your friend because, in general, the Eraser tool is not the most graceful way to achieve most goals. But it's a good tool to have on backup in your toolbox.
The Eraser tool appears to erase content, but it's not actually erasing anything. If you're working on a background layer or a layer with transparency locked, it replaces the pixels with the current background color. Otherwise, it replaces the pixels with transparency.
Probably the neatest way to use this tool is to use it when you want to restore the image to its previous state. Select Erase to History in the options bar—and the Eraser tool will do just that. It's handy if you aren't so keen on a change you made, or if you want to keep the change but have it affect a smaller area of the image.
Figure 4.20 Select Erase to History in the options bar to erase part of the image to an earlier state.
One unusual thing about the Eraser tool is that you can change the shape of the tool to act as a brush, a block, or a pencil by selecting the mode in the options bar.
The Eraser tool has a cool friend, the Magic Eraser tool. It erases pixels of a similar color, replacing them with transparency. (If you're working on a background layer, it's converted to a regular layer and the pixels are replaced with transparency.) Select the tool, click on the color you want to erase, and voilà! You can erase only contiguous pixels, or all pixels of that color; to erase all pixels of that color, deselect Contiguous in the options bar. The Tolerance setting determines how similar in color pixels need to be in order to be erased. The greater the tolerance value, the wider the range of colors that will be replaced with transparency.
Figure 4.21 Click once with the Magic Eraser tool to remove pixels of a particular color. Click again to erase pixels of a different color.
The Background Eraser tool erases the background so you can replace it or otherwise work with foreground objects separately. This and other background-replacement techniques are covered in Chapter 8.