Content-aware fill in adobe photoshop

Content-Aware Fill in Photoshop

Daniel Scott

@dan

Hi, everyone!

In this post we will see Photoshop’s Content-Aware Fill in action and understand why it has been a true image editing game changer over the last years. Given the subject and Photoshop’s present features, I’m sure some of you may be thinking: “but, Dan, with Photoshop’s AI Generative technology already in motion, does it make sense to consider Content-Aware Fill a strong productivity resource?” I’ll be approaching this issue after the step-by-step guides, but I can tease you with a little question of mine: “one day, when cars drive themselves, will it still make sense to learn how to drive?”

As usual, this post is based on some of my Advanced Photoshop Classes. If you’re still taking your first steps in Photoshop, you can join me at Bring Your Own Laptop. Start with the Essentials Course and climb your way to becoming a Photoshop Hero. If you already know some of the moves, sign up for some incredible Advanced stuff and go absolute Pro level.

Are you ready to be amazed? Let’s do it!

Before anything else, it’s not about you!

It’s not really magic, of course, even though it feels like it. I guess it all began with early retouching tools like Clone Stamp, Healing Brush, or the Patch tool. If you’re just starting with Photoshop and still haven't tried these out, I can make it simple by saying that these helped you in removing distracting or undesired details from an image, fixing blemishes on a model’s face, or restoring old and damaged photographs. Sign up for my Essentials Course to fully understand and master them!

While using these retouching tools, you were manually pointing out to Photoshop some pixels from a specific part of your image, so it could sample and use them to replace those other pixels that had to go away.

Content-aware Fill does exactly that, but Photoshop now automatically scans your image for you, looks for the best fitting pixels for sampling and replacing, and delivers the transformation from a quick and easy selection.

There’s a quick way and an advanced way to work with Content-Aware Fill, you can always adjust and direct Photoshop’s choice of sampling areas to fine tune your retouching and guide it to more seamless results. Let’s see how it all happens.

It all starts with a selection...

1. Remove an object from the background.

Let’s begin with a basic and fast example. We need a clean background to build a project from but there is an “intruder” in the way. We need to make it go away without losing our cool background textures.

To remove that piece of rubbish from the image, we pick a basic selection tool, like the Lasso tool, and we draw a rough shape around it.

Highlighted lasso tool in toolbar and unwanted object inside image in adobe photoshop

The Lasso Tool is perfect for quick and easy selection around the object we want to remove.

We now have a selection area (you can see those “marching ants” moving around it) and we pick options Edit and Fill... from the top menu bar.

Fill option selection in adobe photoshop

Select Fill… from the Edit menu to access the Content-Aware Fill settings.

An options box will open and, for this example, we’ll just make sure that the “Content-Aware” setting is active and hit that OK button.

Highlighted content-aware setting inside fill dialog box wall in adobe photoshop

Make sure that Content-Aware is selected under the Contents setting.

We then wait a couple of seconds and...

Unwanted object removed from background image in adobe photoshop

The object’s pixels were replaced by pixels sampled from the image’s background.

Look at that! The rubbish is all gone and we have a clean background to work with!

A different way to set up our selection area: we can pick the Spot Healing Brush from the left toolbar and, making sure the Content-Aware setting is active, paint over the unwanted subject and wait for the magic. The Lasso tool gets the job done quicker, this one is best for more accurate selections, like face retouching.

Highlighted spot healing brush tool, content-aware setting, and unwanted object darkened selection in adobe photoshop

We can use the Spot Healing Brush to paint over the object we need to remove.

Content-Aware Fill is very efficient with both smooth and textured or patterned images - textures and patterns can be repeated and keep the finished results as real as possible. Using this tool with complex images with lots of different elements, like a photograph of a busy street or a group portrait, may lead to some “messy” outcomes and ask for more advanced settings.

2. Expand your horizons.

Another cool thing you can do with the Content-Aware Fill tool: expand your image beyond its original limits and get extra room for your projects.

This is also very simple. We’ll start with this landscape and, let’s say, we want to add a message in the sky but there’s not enough space to do it. If only we could go back there and take a new photo… or if only we could add some more sky to it! And we can!

Countryside background image with arrow pointing out of it in adobe photoshop

It is possible to expand an image beyond its original dimensions with the Content-Aware Fill tool.

First, we must make room for all that extra sky we want to bring. So, with the Crop tool selected, we change our images dimensions so it has a more vertical direction.

Highlighted crop tool in toolbar and cropping area grid over countryside image in adobe photoshop

Next, we use the marque tool to draw a selection, showing Photoshop where we want our sky to grow into and where it will sample those light and color pixels!

Highlighted selection below image top boundary for seamless result in adobe photoshop

Make sure your selection includes a section of the original image so Photoshop can create a seamless expansion.

With our selection area defined, and as before, we pick from the top menu bar the options Edit and Fill and we wait for Photoshop to work its magic.

Image sky expanded with content-aware fill in adobe photoshop

The Content-Aware tool sampled the original image and added more sky to our landscape.

Wow, can we say the sky's not the limit, now? Content-Aware can truly upgrade our Photoshop skills and projects to a whole new level of awesomeness!

3. Limit the sampling area (new to Photoshop 2024)

Content-Aware Fill doesn’t always make the best matches to retouch your photos with that natural look. When this happens, you can show Photoshop the right places to sample from.

Let’s turn the difficulty up a notch. We’ll practice on this black and white photo how we can ask Photoshop to limit or adjust its sampling area so it can deliver the best possible transformation.

Black and white photo with highlighted detail of twisted wires

To remove the wire from the center of our image, we may need to guide Content-Aware Fill through a few steps.

Let’s say we want to remove that wire and leave only the wood textures visible. Let’s begin by selecting the middle section and set it up for removal. We can use the Polygonal Lasso tool for that.

Selection area over twisted wires created with the polygonal tool in adobe photoshop

We can make a first selection with the Polygonal Lasso tool.

With our selection ready, we can select from the top menu bar the options Edit and Content-Aware Fill... Photoshop opens a new window with more settings and preview mode.

Content-aware fill sampling area and preview result in adobe photoshop

The first preview is not a perfect one, we need to adjust some of the sampling area.

The green area on the original image shows the sampling area that Photoshop is reading to replace that wire piece we’ve selected. The preview on the right lets us know that it is having trouble with fixing the image as we expect it to. How do we give Photoshop a hand? We can use the Sampling Brush Tool, set it to “Subtract”, and paint off the green parts we don’t want it to sample from.

Content-aware accurate sampling area and preview result in adobe photoshop

By properly defining the sampling area, Photoshop’s Content Aware-Fill can now deliver an improved result.

Can you see how the preview has changed? The weird floating wood texture is gone and we can finish it up in no time.

Is there another way to do this, when we have a very limited space to sample from? Yes, there is! Check this out! Let’s look at these books and let’s say we need to change only one of the spines, so we can add a title of our own.

Timeout #1

I know this post is not about AI technology but it’s almost impossible to talk about Content-Aware tools leaving out their current evolution. We know the impact AI will have in our future’s societies, but do we really understand the ethics that have been directing this expansion? Will they ensure AI’s inclusive, safe, and fair application in the future ? We should discuss and think very seriously about this theme.

Highlighted book in bookcase in adobe photoshop

Let’s change one of the spines from the books on our shelf.

First, we duplicate our layer, so we don’t go destructive on our image editing.

Duplicate layer option highlighted in adobe photoshop

Always choose non-destructive editing work methods. Keep your initial image untouched.

Working on our new layer, we select the spine we need to change and we add a Layer Mask - you can click on the Add Layer Mask on the Layers Panel.

Masked layer with visible book spine in adobe photoshop

Masking our selection will limit the area that Content-Aware Fill will scan for sampling.

Now we are working with the masked layer, we can select the parts we don’t need and Photoshop will limit its sampling to this spine.

Book spine details selected and highlighted in adobe photoshop

Select the elements we need to remove with a quick selection tool, like the Lasso or Marquee Tools.

All we need to do is choose Edit and Content-Aware Fill... from the top menu bar and check out the settings and preview.

Limited sampling area and image preview in adobe photoshop

Content-Aware Fill, with this limited sampling area, immediately delivers a seamlessly clean spine.

Amazing! A clean spine, all clean and ready for a new design, without any further selection or adjustments!

Highlighted book spine with new edited layout in adobe photoshop

Now we have a new book on our shelf. Quick and easy with Content-Aware Fill (and some extra editing skills).

Content-Aware Fill or AI Generative technology?

As promised, a quick paragraph on the “classic” Content-Aware Fill tool and the brand-new AI Generative tools in Photoshop.

AI Generated tools and contents will rule image editing and may throw features like Content-Aware Fill into the shadows. It’s all part of a process in which technology pushes productivity way beyond its present limits.

From where I’m standing, and on the day this blog post is being written, I find use for both “new” and “old” Photoshop tools. I adapt them to the projects I’m working on, available time and deadlines, and on how fast or how perfect I need for a certain action to be. Right now, I find both quite useful.

If I’m quickly retouching a photograph, removing some distracting details, or expanding an image (without the need to generate new and complex stuff) I reach for Content-Aware Fill because it delivers fast and accurately. I use AI Generative tools when I feel the need to add something fresh and new to a design or really make some deep transformation.

Which path should you follow? I’ve always believed that starting from the basics and climbing up to the super-advanced skills – from Zero to Hero, remember? – was the best way to learn and evolve in a skillset. Even when you reach a level in which a machine can do part of your job, your previous learning and working experiences will allow you to set up the best methods, planning and applying the best strategies, and even get the most out of the machine’s own work process

Can you create an AI generated orchestral soundtrack for a movie without any musical knowledge or skills? I guess you can! But would those previous knowledge and skills lead the machine itself to a better outcome? For sure, they would!

Can you create some AI generated award-winning photographs without any knowledge of photography? Maybe you can! But what if you had a deep understanding of what’s behind photography? I’m sure you’d reach a whole new dimension of art!

In conclusion, “doing” will never replace or happen without “knowing”. So, bring your own laptop, your books, your creativity, and don’t fear technology. Explore and benefit from what it can do for you!

Timeout #2 (just before the finish line)

The future is already buzzing in our present with the AI revolution! If you want to know more about its foundations, don’t miss this article on the Principles of Generative AI Design. It will blow your mind!

What’s Next?

Now that you know how incredible Content-Aware Fill can be – even in a time of AI and generated contents – come and join us at Bring Your Own Laptop, meet our proactive and creative community and build new skills up to Hero mode! Expand your learning and working portfolio with our 30+ courses and dedicated support for just $12 a month* . Of course, cancel anytime (I’m sure you’ll always find a reason to stay!).

See you in class! – Dan