From the course: Motion Control 3D: Bringing Photos to Life in Three Dimensions with After Effects and Photoshop CC (2019)

Filling in the holes: Content Aware Fill

One of my favorite tools in Photoshop is the content-aware fill command, and depending upon your version of Photoshop, there may even be two versions of this. It's available in the traditional fill dialog, but there's also a dedicated content-aware fill command that's a bit more advanced. Let's go ahead and turn off this cloning layer for a moment and we'll come down to the bottom layer and duplicate it. This way, we have a second copy for comparison purposes. Now I'm going to go over to channels for a moment. I've already saved a selection of all of the poles so I can Command or Control + Click to load it. Now later on, you learned about selection techniques so you could manually practice selecting all of these, but for speeding up this lesson, I've made the selection for you. Just Command or Control + Click on the thumbnail and make sure the RGB layer is selected. Now what you'll want to do is select that copied layer. Before we invoke this command, I strongly recommend expanding it a bit, so I'll choose select, modify, expand. This allows me to move the selection out a bit. Then I'll choose select, modify, feather. This will give me a nice, gradual edge. We'll try a value of 20. Now we can invoke the content-aware fill command. If you're using an older version of Photoshop, you'll access it from the fill menu by choosing edit, fill. But I suggest the dedicated content-aware fill command. This allows you to visualize what's happening a bit better. Now let's go ahead and navigate here and the green pixels are what's being sampled. For example, I don't want the sky to be included, so I can just paint to remove that from the considered pixels, and it will adjust. And you see that it starts to evaluate and reprocess the content-aware fill command so that it looks only in the pixels that are shaded. Next, from the fill settings, I strongly suggest bumping this up. A higher color adaptation and rotation adaptation will do a better job of generating new textures. I also suggest the scale command. In doing so, it's going to do a great job of creating the content. You can then decide to output to a new layer or a duplicate layer. I'm going to choose the new layer option here, and you see that it generates the material, but this produces a bit of feathering. Now let's try the duplicate layer option, looks a little better. I'll adjust the opacity setting back up to full strength. There we go. Now let's zoom in here a little bit and take a better look. And we'll play with those color adaptation settings again. What I want to be careful of is that as it blends and creates the new texture, we don't start to pick up the color here of the subject. So sometimes, color adaptation is your friend and other times, it can actually get in the way. Let's see what it's doing here. I'll zoom out just a little bit. It's okay, but I can definitely see the areas where it was blending. So I'm going to cancel for a moment and make a slight change. Let's reload that selection and expand it. And now when I apply the feather, I'm going to put a much lower value. We'll go with a value of five. Now we can invoke the content-aware fill command, remove any pixels we don't want, space bar to pan around, there we go. I'm just going to remove the sky. Get better results. It looks pretty good. I'll bump up the color adaptation a little bit and scaling and evaluate what's happening. While this is spinning, it's generating the preview so you may want to let that finish so that it shows you the high quality. Once it goes away, you can now really judge the resulting pixels. And that looks really quite good. It's not perfect, but it's pretty good. When I click okay, the new area is created. And you see that the differences are filled in. Now feel free to take some of the techniques you learned before, like the spot healing brush, and you can easily paint and build upon your success. Or if there's a particular area you want to sample, use the regular healing brush, Option or Alt + Click and build up your brush stroke. By you being in control, it's easy to use these two techniques. The content-aware fill command did an excellent job of quickly filling in the missing areas. Before and after, that's as if they weren't there at all. And remember, sitting in front of this are going to be the objects that we've masked to their own layers, so it's not like it has to be perfect, but a good background is going to make the overall effect that much better.

Contents