Removing Unwanted Elements – Content Aware Fill

After Effects Tutorial

Master the art of removing unwanted elements from your videos with an After Effects tutorial. The tutorial covers topics such as mask tracking and Content Aware Fill, with specific steps guiding you through the actual process from start to finish.

Key Insights

  • The tutorial covers various topics including Content Aware Fill for videos, creating masks, and mask tracking.
  • The exercise aims to teach learners how to use mask tracking and Content Aware Fill to successfully remove unwanted elements from videos.
  • Steps for previewing the final video, setting up the workspace, and getting started with the project are provided in detail.
  • The tutorial educates on how to use mask tools, like pen, rectangle, ellipse, etc. to draw around the element you want to fill, and how to switch the mask function to subtract.
  • Learners can also learn about tracking a mask in cases where the element to be removed or the camera are moving.
  • Additional insights are provided on applying Content Aware Fill, including choosing alpha expansion, fill method, enabling lighting correction, and generating a fill layer.

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.

What This Tutorial Covers

  • Object Removal

    Erase moving objects from footage automatically.

  • Reference Frames

    Help AE understand the clean background.

  • Time-Saver

    Replace hours of manual roto and patching.

Topics Covered in This After Effects Tutorial:

Content Aware Fill for Video, Creating Masks, Mask Tracking

Exercise Preview

preview 3a

Exercise Overview

In this exercise you’ll learn how to use mask tracking and Content–aware fill to remove unwanted elements in your video.

After Effects Bootcamp: Live & Hands-on, In NYC or Online, Learn From Experts, Free Retake, Small Class Sizes,  1-on-1 Bonus Training. Named a Top Bootcamp by Forbes, Fortune, & Time Out. Noble Desktop. Learn More.

Previewing the Final Video

  1. 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.
  2. On the Desktop, navigate to Class Files > After Effects Advanced Class> Object Removal > Preview Movie and double–click Logo Removal.mp4.
  3. Notice the following:

    • There is a logo on the main subjects shirt that needs to be removed.
  4. Replay the video if you need to, and close it when done.

Setting up the Workspace

  1. In After Effects, go to Window > Workspace > Standard.

  2. Choose Window > Workspace > Reset “Standard” to Saved Layout.

  3. 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

  1. In After Effects, if you have a project open, choose File > Save.

  2. 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.
  3. 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.
  4. 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.

  1. Navigate to a frame in your video where you can clearly see the element you want to fill.

  2. 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.

  3. If the mask is not visible in the Timeline, press M on your keyboard to reveal it.

  4. 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.

  1. 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.

  2. Confirm that the Method menu is set to Position, Scale & Rotation

  3. 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

  1. 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.

  2. Choose Alpha Expansion to increase the size of the area to fill

  3. Choose Fill Method.

  4. Enable Lighting Correction if the object you are trying to fill goes through different lighting conditions.

  5. Set Range to either the Work Area or the entire length of the composition.

  6. 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.

  7. 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.

Learn more in these courses

How to Learn After Effects

Master After Effects with hands-on training. After Effects is the Industry-standard Application for Motion Graphics, Animation, and Visual Effects.

Yelp Facebook LinkedIn YouTube Twitter Instagram