Explore this comprehensive After Effects tutorial, covering topics such as Content Aware Fill for Video, Creating Masks, and Mask Tracking, along with step-by-step exercises to guide you in removing unwanted elements from your video.
This exercise is excerpted from Noble Desktop’s Adobe After Effects training materials and is compatible with After Effects updates through 2023. To learn current skills in After Effects with hands-on training, check out our After Effects Bootcamp, Motion Graphics Certificate, and video editing classes in-person and live online.
Topics covered in this After Effects tutorial:
Content Aware Fill for Video, Creating Masks, Mask Tracking
Exercise Preview
Exercise Overview
In this exercise you’ll learn how to use mask tracking and Content–aware fill to remove unwanted elements in your video.
Previewing the Final Video
- Let’s see a preview of what you’ll be making. If you’re in After Effects, keep it open but switch to your Desktop.
- On the Desktop, navigate to Class Files > After Effects Advanced Class> Object Removal > Preview Movie and double–click Logo Removal.mp4.
-
Notice the following:
- There is a logo on the main subjects shirt that needs to be removed.
Replay the video if you need to, and close it when done.
Setting Up the Workspace
In After Effects, go to Window > Workspace > Standard.
Choose Window > Workspace > Reset “Standard” to Saved Layout.
-
If the After Effects window does not fill the screen, maximize it:
Mac: At the top left of the window, click the green button (the third button). Windows: At to the top right of the window, click the Maximize button (the middle button).
Getting Started
In After Effects, if you have a project open, choose File > Save.
-
Choose File > Open Project and:
- Navigate to Desktop > Class Files > After Effects Advanced Class > Object Removal.
- Double–click on Logo Removal - started.aep to open it.
-
Choose File > Save As > Save As and:
- Name the file Your Name - Logo Removal.aep and
- Save it into Desktop > Class Files > After Effects Advanced Class> Object Removal.
In this exercise you will work with the Remove Logo composition.
Masking for Content Aware Fill
Content Aware Fill is designed to work by filling in transparent areas of a composition, so you will normally need to create and track masks to cover whatever you want to get rid of.
Navigate to a frame in your video where you can clearly see the element you want to fill.
-
Use one of the mask tools (pen, rectangle, ellipse, etc.) to draw mask around the element.
NOTE: If using the Pen tool, you have to create a closed path to use as a mask.
If the mask is not visible in the Timeline, press M on your keyboard to reveal it.
Switch the mask function to Subtract using the menu to the right of the mask name.
Tracking a Mask
If neither the element you want to remove, nor the camera are moving you can skip this step and proceed to just applying the fill. But in most cases some tracking will probably be necessary.
-
In the Timeline, Ctrl–click (Mac) or Right–click (Windows) on the mask name and choose Track Mask
This will open the Tracker panel. If you are in the Standard workspace it should open to the right of the Timeline panel.
Confirm that the Method menu is set to Position, Scale & Rotation
-
Depending on which frame you created the mask in: use the Track Forward or Track Backwards buttons to track the mask.
NOTE: The mask functon is disabled while After Effects is tracking the mask.
Applying Content Aware Fill
-
Choose Window > Content–Aware Fill
NOTE: If you are in the Standard workspace when the panel opens you will need to increase its height untul you can see both buttons at the bottom of the panel and some of the space below them.
Choose Alpha Expansion to increase the size of the area to fill
Choose Fill Method.
Enable Lighting Correction if the object you are trying to fill goes through different lighting conditions.
Set Range to either the Work Area or the entire length of the composition.
-
Press Generate Fill Layer.
NOTE: Depending on your system configuration, dimensions and the length of your video Content–Aware fill may take some time to complete.
Once complete you can delete the fill layer and try again with different settings.
Save your file.
Content Aware Fill Options
Object: Removes an object from the footage. It fills the transparent area by taking pixels from the current and surrounding frames. When it removes an object from the footage it estimates the motion of the scene behind the object and uses this to find appropriate color values. A good use of this method would be to remove a moving object like a car on the road, or a bird in the sky.
Surface: Replaces the surface of an object. It works similar to Object as it takes pixels from surrounding frames but uses the motion estimated in the comp under the transparent area. A good use of this method would be for static surfaces like a logo on a shirt.
Edge Blend: Blends surrounding edge pixels. It fills the transparent area by sampling pixels at the edges of the transparent area and blending them together.It renders quickly but cannot have Lighting Correction Applied. A common use of this method is to replace static objects on surfaces that lack texture, like graphics or text on flat paper.
Lighting Correction: Can be enabled to compensate for dynamic lighting in your video. This is helpful if your fill area is moving in and out of a light source or any other time the lighting in your scene changes. You can use a reference image (prepared in Photoshop) to influence what the Content–Aware fill end result should look like.