Removing Unwanted Elements – Content Aware Fill

Free After Effects Tutorial

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

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.

Jerron Smith

Jerron Smith is an Editor, Animator, Educator and an Author. He has a MA in Communication Arts and expert level certifications in Adobe After Effects, Adobe Premiere Pro, Adobe Photoshop and Illustrator. He also has a good working knowledge of other animation programs like Cinema 4D, Adobe Animate, and 3DS Max from his decades of experience in and around the design industry. He has authored multiple books and video training series on computer graphics software such as: After Effects, Premiere Pro, Photoshop, Illustrator and Flash(back when it was a thing). Jerron has taught at the college level at schools such as The New York Institute of Technology, New York City College of Technology, and Fashion Institute of Technology.

More articles by Jerron Smith

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