It’s not actually magic, of course, it just feels that way when it works just right. The tool simply examines the pixels around the spot and deals with duplicating them over the clicked area in one of a few ways. But since you can choose which way the spot healing brush addresses those spots, there’s potential to make the wrong choice. Here’s how you decide which mode will make magic given the circumstances of the repair. Should you choose proximity match, create texture or content-aware fill?
With the spot healing brush set to proximity match mode, the tool analyzes the pixels near where you’re clicking to determine which ones would be most appropriate to replicate. This is the ideal approach to use when you’ve got small spots or other elements to be eliminated. If you’re a portrait retoucher, for instance, this is the ideal blemish remover. If used to repair a large area, click outside the area to be eliminated and drag toward the center for a more effective approach. When used to remove an element on a clean background, proximity match generally works very well, as evidenced by the detail of a repair shown in the examples here.
In create texture mode, the spot healing brush examines the pixels around the spot being clicked in order to determine if there’s a texture. Whatever pattern it finds it will use to generate a similar texture and attempt to mimic it as you click and drag the brush. I like to use this setting if there’s a large area to be repaired when there’s a pronounced pattern or texture to be replicated. This could be foliage in a landscape or hair in a portrait; in each case, those patterns would be marred by a blurry repair. Create texture prevents that blur. (If another mode is used when texture is involved, sometimes those modes will create a blur or smoothed effect that stands out against the pattern just as much as the spot being repaired did.) If you use this mode when there’s no texture, Photoshop will attempt to make some—and that’s no good, as shown in the example above.
The content-aware mode is really interesting in that it tries to identify the actual content of what is being repaired, not just the individual pixels that make it up. I like to use it to repair flyaway hairs in portraits and for more complex repairs in a broad variety of images. For instance, when clicking on a street sign against a sky in content-aware mode, Photoshop will attempt to replace the sign with whole sections of clouds and sky taken from its understanding of what’s happening in the image. The content-aware effect can be influenced by which direction the clicking and dragging is made. If one brush stroke isn’t appropriate, simply undo and retry from a different angle of attack. Beware when using this setting with smooth or graduated backgrounds, as the content-aware fill can generate a mismatched pattern that doesn’t necessarily fit, which can be seen in the close-up example here.