Photoshop Trick: Content-Aware Fill

Select the canoe...
Select the canoe...
Content-aware fill. Blub blub blub.
Content-aware fill. Blub blub blub.

It's Maaagic!

My Mom, photoshop wizard, told me about this trick over the phone, and I've been having a lot of fun playing with it.

Basically, content-aware fill is an intelligent fill that analyzes what's around the selected area — leaves, sky, gravel, dirt, or any sort of texture or random pattern — and imitates it to fill in the selection.

It's not perfect, but it's amazing what it can do.

Even by itself (right) it's pretty powerful, but with the Clone Stamp and Healing Brush to tidy up, it's astounding.

Let me show you a few examples.

(All photos are my own.)

A Day at the Beach

Erase Your Ex?

This isn't me or my ex, but just to demonstrate:

  1. I used the polygonal lasso to make a rough selection around the figure at left.
  2. I went up to the Edit Menu, chose Fill... and then Content Aware from the first pulldown menu.
  3. I tweaked the lighting using the following menus: Image > Adjustments > Vibrance... and Image > Adjustments > Exposure...

That's it!

In this case, since it was a small area to be filled with a lot of random textures around it, you really can't see the fill area at all.

In the canoe photo above, if you looked closely, you probably noticed something odd happening in the water. Larger areas are more noticeable, because the fill tends to start repeating itself. (But if you'd put Text over that area — a title for a book, for example — no one would ever notice).

Fine Tuning the Fill

Sometimes Content-Aware Fill gets confused about what to use for a background texture.

On my very first attempt, I used a grainy photo of a bluebird sitting in front of a curb with a drain pipe in it. I wanted to remove the drain pipe. But when I tried, since the selected area was right next to the bird, the "fill" decided the bird's feathers were part of the background and continued them into the fill area.

Content-Aware Fill FAIL:

Yes, it's a bad photo to start with. Bear with me.
Yes, it's a bad photo to start with. Bear with me.
3. Copying the bird.
3. Copying the bird.
4. Bird in new layer.
4. Bird in new layer.
6. Selecting problem areas.
6. Selecting problem areas.
7. Content-Aware Fill!
7. Content-Aware Fill!
After retouching with healing brush (continuing the crack by borrowing from the crack to the right of the bird), vibrance/exposure, and sharpen.
After retouching with healing brush (continuing the crack by borrowing from the crack to the right of the bird), vibrance/exposure, and sharpen.

Solution...

  1. Duplicate the background layer (always do this to preserve the original, in case you make a mistake).
  2. Select the bird.
  3. Copy the bird.
  4. Paste the bird into a new layer above all the others.
  5. Return to the Background Copy layer.
  6. Select the problem area you want to fill, including the bird (or whatever was showing up in the fill that you didn't want).
  7. Edit > Fill... > Content-Aware
    ...notice that the bird appears unchanged. That's because you're seeing the bird on the top layer. If you make the top layer invisible for a moment, you'll see that the Background Copy bird has been covered in concrete along with the drainpipe. Does that make sense?

At this point, one can leave it as is or do some touch-up (SAVE first):

Clone Stamp: this lets you copy something from elsewhere on the image and paint an exact copy of it: texturing, cracks, whatever, it'll be a clone.

Healing Brush Tool: this is an intelligent tool that attempts to borrow details from elsewhere in the picture and blend them with the area you're painting. It's hard to explain, but it tends to be more careful about matching lighting/coloring of the target area.

Both the Clone Stamp and Healing Brush Tool require you to alt-click (opt-click on Mac) a "source" area to copy from, before you begin to paint.

Both are useful for smoothing the edges of a filled area or varying a Content-Aware fill that's replicated some detail that's so obvious that it's easy to tell what it was copied from.

Image > Adjustments > Vibrance... and/or Exposure...

These two tweak the lighting; they can really bring out details and make colors pop.

Filter > Sharpen > Unsharp Mask...

Be careful not to overdo it, but this can help bring out details. (You may want to merge the top layer onto the underlayer first — Cntrl/Cmd-E — so that all layers are sharpened together.)

Here's the final result. It's not fantastic, because I started with a fuzzy photo, but you can see how much the composition was improved by getting rid of that drainpipe! Try the same technique with your own photos.

Advanced Example: Removing Utility Poles

Space Shuttle Endeavour being rolled to the Los Angeles Science Center.
Space Shuttle Endeavour being rolled to the Los Angeles Science Center.
1. Select area to be filled.
1. Select area to be filled.
2. Content-Aware Fill.
2. Content-Aware Fill.
3. Problem spots.
3. Problem spots.
4-5. Healing Brush and Clone Stamp.
4-5. Healing Brush and Clone Stamp.
6. Copy pole from elsewhere to make signpost.
6. Copy pole from elsewhere to make signpost.

Another example of Content-Aware Fill

So here's a space shuttle with some utility poles. I can't get rid of all of them, but I feel like removing some of them.

  1. Select problem area. (Tip: Hit the "Q" key for a better view of your selection; use paintbrush and eraser to fine-tune; hit "Q" again to toggle "Quick mask mode" off.)

  2. Edit > Fill > Content-Aware Fill (pulldown menu)

  3. Note problem areas where fill's edges are visible.

  4. Now it's time to get to work with the Clone Stamp and Healing Brush.

    The clone stamp copies other areas exactly and paints them where you indicate; the healing brush borrows from other areas and attempts to blend them with the target area.

    Either way, select the "source" area by Alt-clicking (opt-click on Mac) the area you want to copy, then move the brush over the spot you want to paint and click.

    Notice that the brush tip gives you a preview of what you're about to paint, so you can line up details like the edge of the shuttle's wing or canopy very precisely.

  5. Tools to help you with Clone/Healing: Zoom in! Then remember that the ] and [ keys shrink and expand your brush tip. BE CREATIVE! I grabbed leaves from another tree entirely to tidy up leaves on the tree that needed fixing.

  6. As you see, I covered up one street sign with leaves that was mostly hidden by the telephone pole. But the other one's signpost was also hidden by the telephone pole. What to do? Find another pole in the picture and copy it for the missing signpost!

  7. Repeat for other problem areas (there's a light post on the right side of the picture that I also decided to remove.)

  8. Image > Adjust > Exposure and/or Vibrance to tweak lighting.

Practice makes perfect!

Try experimenting with Content-Aware Fill on several different photos and see what you can do!

Here's what this picture looked like after I finished playing with it.

Before & After Space Shuttle Photo

Here's the original for comparison.
Here's the original for comparison.
Retouched Space Shuttle photo.
Retouched Space Shuttle photo.

Recommended Book

Adobe Photoshop CS6 Classroom in a Book
Adobe Photoshop CS6 Classroom in a Book

My birthday present from my Mom this year. I'm working through it a little bit at a time and learning about all those parts of Photoshop I've never poked my nose into. It's suitable for beginners, but my mother picked it up at an advanced workshop and is still discovering things she didn't know. Included CD has textures and clip art related to lessons.

 

One More Example: Before (Left) & After (Right)

Can you tell what Content-Aware Fill copied to fill in the window frame at lower left?
Can you tell what Content-Aware Fill copied to fill in the window frame at lower left?

© 2014 Ellen

More by this Author


Comments 4 comments

darkprinceofjazz 2 years ago

Fantastic tips, lots of pesky people out there that get in the way, especially at amusement parks.

One again, thanks for your great help articles.


WiccanSage profile image

WiccanSage 2 years ago

Great tips, I'm going to try it. I usually use the clone tool to do a patch job, particularly when at Disney World as it's almost impossible to get shots without people walking into them, even during the slow months. Thanks for the tips!


Cari Kay 11 profile image

Cari Kay 11 2 years ago

It's pretty amazing to me what you can do with Photoshop. I tried this fairly recently and failed miserably. Going to follow your directions and try again. Thanks!


Easy Exercise profile image

Easy Exercise 17 months ago from United States

I absolutely love this! Oh, life has too many interruptions that an interruption in a photo can make that a great photo or one for the trash. I have no ex, but the clutter in a photo drives me crazy.

Excellent! Voted up! Will be sure to share also!

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.


    Click to Rate This Article
    working