What's it all about?

This blog is about photography and photoediting. Its purpose is to provide hints and tips and links to interesting and useful resources for digital photographers, regardless of their level of expertise or experience. It is aimed at people who use digital SLR cameras and who process their images using the latest versions of Adobe Photoshop and Adobe Photoshop Lightroom.

The author of this blog is Glenn Springer and you can read more about him at his web portal at faczen.com. Information on workshops, and links to everything is at photography.to. Glenn's original blog, which is an ongoing journal of his photographic meanderings goes back to 2006 and contains many additional hints and tips, as well as representative images that he has made. Gallery quality prints are available through his Smugmug gallery site. It is an interesting place to visit to see a variety of quality images, as well as an ongoing general journal of photos going back several years.

Photography workshops are scheduled every few weeks starting in the Spring. For an overview of what's happening, please visit the photography.to website.

The most recent blog post is below. Scroll down to the bottom to see the list of previous postings or search for any particular topic.


Thursday, March 3, 2011

Photoshop CS5 Content-aware Fill Trick

Today we’re going to talk about the Content-Aware Fill tool in Photoshop CS5. It’s an amazing tool but sometimes it seems to have a mind of its own! I want to introduce you to a trick I found to make it more predictable.

Content Aware Fill (CAF from now on so I don’t have to keep typing it) and the content-aware healing brush have dramatically streamlined the workflow, especially when trying to remove things like power lines or other objects. You can use the venerable clone stamp tool, but it’s more work, leaves behind lots of artifacts you have to clean up, and if you’re not careful, creates repeating patterns that are annoying and distracting in the image.

But sometimes, CAF produces unpredictable results. That can be good or bad: here’s a little ad image I created without intending to, when all I was trying to do was to isolate a couple of First Aid kits on a background. CAF picked up some unexpected content when I tried to use it. A very neat unanticipated effect!



Original photo




After CAF




How I used it on the website. Some extra effects from Topaz Adjust 4

 Generally, though, you’re trying to remove something from an image and replace it with what looks like the original background. If you’ve never used the Content Aware fill and healing brush functions, here’s a simple example. If you have, you can skip a few paragraphs.

Suppose I want to remove the sign from this picture.



The original photo

Draw a loose selection around the sign. You can use any selection tool – I usually just use the lasso but in this case I used the quick selection tool then expanded the selection by 50px or so. If the selection is tight then you’re going to see seams and edges around the area after you fill it. Be generous – give it space to breathe! Then hit Shift-F5 to invoke the Fill dialog and select content-aware from the drop down menu. It’s sticky: it’ll still be selected next time you try to use it.

In this screen capture, I painted the edges of the selection so you could see it.



Make a selection then initiate the "Fill" operation

The sign is magically gone. But the post is still there (I could have removed that in the same step but then I wouldn’t get to illustrate the CAHB -- Content-Aware Healing Brush). The background fill isn’t perfect but this is just a quick example. Paint over the post with the CAHB using a brush that’s about 50% bigger than the post (again, it needs room to breathe) and like magic, the post is gone, replaced with what Photoshop figures is what you wanted to be there.




Now use the content-aware healing brush

Here’s the finished product.



The finished image

What the CAF tool does is to look around the layer and using some very sophisticated algorithms, calculate what should replace the area you’re filling. I’ve just dropped a major hint about what the trick is. So if you’ve already figured out what I’m going to say, great! If not, follow me here.

OK, here’s another image I want to remove something from. The table at lower right shouldn’t be there.



So I make a loose selection around the table, hit shift-F5 <enter> and it’s gone! It even added in the wall duct, almost right down to the corner. But not totally seamlessly – it left some traces behind so I need to go in and fix it a bit.




Easy enough, right? Just make another selection around the area you want to clean up and do it again. Uh oh. Look what I got!



It picked up the leg from elsewhere in the image. Not what I wanted! I want it to pick up plain blank wall.

So let’s limit what CAF has available to it to choose from when doing the fill. Select only acceptable areas and copy them to a new layer (make the selections, then hit ctrl-J or cmd-J on a mac). In this case, you’ll have a layer that has only blank wall. Be sure to include the area you want to replace.




Working on that new layer, make a loose selection around the area you want to fix up and do your shift-F5 thing again. Sometimes it takes a few passes to completely clean up the image, but it’s relatively painless and quick. The last step is to merge the new layer with the original one. All done!






This is a lot less work and leaves a much cleaner blend than any of the other methods I’ve tried. OK well maybe not in this example, because I was trying to use one that was really obvious so you could see what’s going on. And I did it in a more complex than necessary sequence so I could show you how to do it and get the screen captures as I went along.

You could make your workflow even faster by creating a new layer first, either by selecting only the areas you want CAF to work from and hitting ctrl-J (Cmd-J) or by duplicating the whole layer then erasing all the stuff you didn’t want. Remember to leave enough behind for CAF to work from, outside the area you’re filling.

Any thoughts? The comment field is awaiting your input!

-- 30 –