Photoshop Trick: Content-Aware Fill
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:
- I used the polygonal lasso to make a rough selection around the figure at left.
- I went up to the Edit Menu, chose Fill... and then Content Aware from the first pulldown menu.
- I tweaked the lighting using the following menus: Image > Adjustments > Vibrance... and Image > Adjustments > Exposure...
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:
- Duplicate the background layer (always do this to preserve the original, in case you make a mistake).
- Select the bird.
- Copy the bird.
- Paste the bird into a new layer above all the others.
- Return to the Background Copy layer.
- Select the problem area you want to fill, including the bird (or whatever was showing up in the fill that you didn't want).
- 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
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.
- 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.)
- Edit > Fill > Content-Aware Fill (pulldown menu)
- Note problem areas where fill's edges are visible.
- 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.
- 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.
- 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!
- Repeat for other problem areas (there's a light post on the right side of the picture that I also decided to remove.)
- 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
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)
- Photoshop Tips: Selecting with Quick Mask
I mentioned this above, but I want to make sure you caught it: a powerful, quick way to make the edges of your selection areas more accurate. Copy & Paste selections onto a new layer to protect them, then work underneath them, or create Layer Mas
- Photoshop CS5 New Features - Content Aware Fill Tutorial
Adobe's official tutorial for Content-Aware Fill. They started with more professional-looking photos, so the results are even more amazing.
© 2014 Ellen