AE - Mask-Out Unwanted Objects
We’ve all been there…
Due to overlooking or unfortunate circumstances our footage has an unwanted object in it (ie. bottle or light in the background, a pedestrian walking across or some other minor details). Reshooting isn’t always an option and that’s when the usual ‘Fix it in Post’ phrase appears.
Fixing it used to be a hassle, however in the past years Adobe software developed enough to allow you to achieve the same result in just a few clicks.
In this article we will cover two different techniques that will allow you to choose the right one for your case:
Content-Aware Fill (best for static AND moving objects where precision isn’t key)
Photoshop Frame Clean-Up (best for static objects needing precise clean-up)
1. CONTENT-AWARE FILL
This feature is temporally aware, so it automatically erases a selected area and analyses frames over time to incorporate new pixels from other frames. The results may vary and aren’t always precise.
Select the layer you wish to erase the element from. | |
Select the Pen tool. | |
Draw a mask around the element by left-clicking the area around it. Make sure to include any casting shadows of the object.
If a solid shape appears, it means that you haven’t selected the layer on the timeline. Delete the shape, select the layer and draw the mask again. | |
Within your layer, click on the Masks tab. You should be able to find there the mask you just created (it should have assigned colour of the shape you just drew). Right-click it and select Track Mask. | |
A Tracker panel will show on the right side. Click the Track Forward button to track the movement of the object. | |
Navigate to the mask tab and change your mask’s Mode to Subtract. | |
Navigate to the Content-Aware Fill panel on the right side.
If you can’t see that panel, go to Window > Content-Aware Fill. | |
In that panel, select the Lighting Correction and set it to Subtle, Moderate or Strong depending on your need.
Leave the Fill Method at Object and Range at Work Area. | |
Click Generate Fill Layer button to start the analysing and rendering process. This might take a long while depending on the length and dimension of the clip. Once it’s finished, a new fill layer will appear on top of your footage. | |
To view the result make sure you’re at the Composition view, NOT LAYER VIEW. |
2. PHOTOSHOP FRAME CLEAN-UP
When precision is key, this technique should be your best option.
We will take a frame from your footage from After Effects, clean it up within Photoshop, to then bring it up to After Effects and track using Motion Tracking.
Select the layer you wish to erase the element from. Scrub the timeline to a moment where the element is fully seen. | |
Export a frame by going to Composition > Save Frame as… > Photoshop Layers. Save the file to your project folder on the MCASI Drive. | |
Navigate to the saved Adobe Photshop file and open it. | |
Draw the selection around the object you wish to erase by holding down right-click. | |
Click the Generative Fill button and write ‘erase’ in prompt window. Wait for the program to generate new layer with a new mask. | |
If your result has some imperfections, you can use Clone Stamp and Heal tool to clean it up even further. | |
Once you’re happy with the result save the file by clicking Cmmd+S or going to File > Save. Now you can close the Photoshop window. | |
Import the Photoshop file into your After Effects project. When the Import window pops up select ‘Merge Layer Styles into Footage’. | |
Put your Photoshop file on top of your Video. | |
Select your Photoshop File and change its blending mode to Screen (or any other option where the result shows the object from the Video File). | |
Use the Pen tool and draw a mask around your object.
| |
Go back to your timeline and change the blending mode of the Photoshop layer back to Normal. The object should now be erased from that frame. | |
To feather the mask go to your mask tab in the timeline, and increase the Mask Feather attribute. Be careful with the value as too much of the feather can make the edges of the object visible. | |
If your shot isn’t static and has some movement to it, you need to make sure you use motion tracking. In this tutorial we will quickly go over the process, however if you’re having issues or need more instructions - check out this tutorial on Motion Tracking. | |
Select your Video layer and navigate to Tracker panel. Click the Track Motion button. | |
Choose a place with good contrast and visibility and position your Track Point there. | |
Click the Analyse forward button to start creating tracking data. | |
Go back to your timeline and create a new Null Object by right-clicking and going to New > Null Object. | |
In the tracker panel, click Edit Target and select the Null Object. | |
Click the Apply button to assign the data to the Null Object. In the Motion Tracker Apply Options pop-up window, select X and Y. | |
Using the Parent Pick Whip connect the Video Frame (The Photoshop file) with the Null Object. | |
The Layer should now follow the camera movement as you play the video. |