Skip to main content

AI Rotoscoping in After Effects: How to Fix a Bad Matte

· Updated
·
7 min read
·
By Marcus Thompson
·
VFX
Three upright sheets of glass on a dark surface. The front sheet holds a sharply cut-out dancer in a red coat mid-leap; the rear sheet holds a sunlit city street with her dark outline left behind.

An actor raises a hand as they walk past a doorway. You want a title on the wall behind them. The title looks right until the fingers cross a letter and the letter shows through a knuckle. Start with that frame.

AI rotoscoping isolates a moving subject by carrying a foreground selection through nearby video frames. In After Effects, you mark the actor with Roto Brush, let the selection travel, and correct it where it slips. For the title shot, you only need an accurate edge where the actor crosses the lettering.

What an AI rotoscoping matte gives you

A matte describes how much of a layer to keep at each pixel. In an alpha view, white keeps the foreground, black reveals the layer underneath, and gray mixes the two. A blurred fingertip covers only part of a pixel during the exposure. Turning that whole edge white gives the hand a cardboard outline.

For a title on a wall, put the original shot on the bottom, the title above it and a duplicate of the shot on top. Apply the foreground matte to the duplicate. The top layer puts the actor back in front of the letters. With the title visible, a solid knuckle should hide the letter. The blurred edge can let some lettering through. To replace the wall entirely, hide the title and original shot, then put the new background directly below the cutout. For other ways to combine photographed and generated elements, see the guide to building an AI VFX shot.

Diagram titled “A title behind a moving hand” with three panels. Source: a raised hand with motion-blurred fingers in front of a green wall beside a door frame. Matte: the hand in white on black, with soft gray finger edges. Composite: the wall title ECHO behind the hand; the solid hand hides the E and part of the C shows through the blurred fingers. Matte key: black reveals the title, gray blends the layers, white keeps the hand.
In this diagram, the solid hand hides the wall title. Part of a letter shows through where the moving finger leaves a gray edge in the matte.

How to rotoscope one moving actor in After Effects

1. Start on the frame that explains the subject best

Trim the layer to one continuous shot. Double-click the foreground copy to open it in the Layer panel and select Roto Brush. Find a frame where you can see daylight between the actor’s hand and their jacket. Starting on a frame where the fingers have already disappeared against the doorjamb gives you a harder selection to teach.

Paint a short stroke down the inside of the actor’s torso. Add a stroke inside the forearm or palm if the selection misses it. Leave room between the stroke and the outline. Painting across both sleeve and wall tells it that both belong to the actor. To remove a patch of wall, hold Alt on Windows or Option on Mac and paint inside that patch. Check the gap under the elbow as well as the outer silhouette.

2. Follow the selection to the first bad frame

Start at the base frame and step toward the end of the shot. When the fingertip first drops out, paint a small foreground stroke inside the missing part. Step one frame farther in the same direction to check the repair. Then return to the base frame and repeat toward the start. If the finger slips on this pass, correct that frame and check the next earlier one.

On the first frame where the selection catches the jamb, subtract a stroke inside the jamb. Watch what happens when the hand clears it. If the hand disappears fully behind a solid post for a moment, the audience should see the post during that interval. Resume the hand selection when skin becomes visible again.

3. Treat hair, fabric and motion blur differently

A jacket usually has a fairly solid edge. Flyaway hair has gaps where the background shows through. Once the head itself is selected, use Refine Edge along the small band where the strands meet the background. Check the result over a different color. If gaps between curls turn into a solid block, undo that pass and narrow the area you refined.

For a fast hand, compare the same frame of the original and the cutout. Follow the width and direction of the blur on the original. If the cutout looks sharp against a solid background, try the matte’s motion blur control and compare the fingertip with the original frame. Adobe documents the motion-blur and edge-color controls as well as the foreground and background strokes in its Roto Brush and Refine Matte guide.

Check the matte in motion before you freeze it

With the title and original hidden, preview the cutout over a black solid, then a white one. Restore the intended layer stack and replay the crossing. Dark hair can vanish on black even when the matte is fine. A pale rim that was invisible on white can light up against a dark wall. Finally, play at the intended viewing size and speed. A contour that looks convincing in a still can visibly crawl along a sleeve over six frames.

What you seeWhere to lookFirst fix to try
A letter flashes through a knuckle.The first frame where white drops out of the hand in alpha view.Add a small foreground stroke inside the visible knuckle. Step away from the base frame to check the repair.
A wedge of wall follows the elbow.The opening between the arm and torso.Subtract inside the opening while it is clearly visible.
The sleeve edge buzzes, even when the arm is still.Several consecutive frames at normal speed.Correct any selection jumps first. For a small remaining shimmer, try Reduce Chatter and recheck the moving hand.
The hair carries a stripe of the old wall color.The composite over a contrasting background.If the strands have the right shape but still carry the wall color, try Decontaminate Edge Colors. Toggle it off and on over the new background to judge the change.

If the tracker repeatedly loses one straight cuff, a short hand-keyframed mask for that cuff may be the quickest fix. Keep the AI selection for the rest of the body. Our practical filmmaking VFX guide covers other places to combine tracked and manual work. Once the selection holds, make sure the composition work area covers the shot. Select Freeze at the bottom of the Layer panel and save the project. You can unfreeze it later to change the strokes.

Bring the finished shot into CinemaDrop

Keep the layered project if the title needs to stay editable. To deliver the actor alone, hide the title and all backgrounds. In the After Effects Render Queue, open the Output Module settings, choose a format that supports an alpha channel, and set Channels to RGB + Alpha. For the CinemaDrop edit, restore the title and wall, then render the full composite. Watch the exported file once to check the lettering before you upload it.

In the CinemaDrop desktop editor, open All Media and choose Add media → Video → Upload video. Select the finished MP4 from your device. Use H.264 video with AAC audio or no audio, up to 1 GB.

CinemaDrop’s Video menu with Upload video above Choose from My Assets and Generate video.
Choose Upload video for the composite on your device. To use a video already in your CinemaDrop library, select Choose from My Assets and pick the file.

Find the upload in Project Media and drag it onto a video track at the cut. The guide to adding media to an edit covers both steps.

Play across both ends of the shot. If the cut lands early or late, trim the clip on the timeline and replay it.

AI rotoscoping questions

Is rotoscoping a form of animation?

Yes. An animator can trace filmed movement to create a drawn performance. A compositor uses the same word for isolating a subject over time. If the brief asks for a matte, the deliverable is the moving selection. If it asks for drawn animation, the audience should see the drawing itself.

What is the best program for rotoscoping?

Try your hardest few frames in the tool you already edit with. Can you correct one finger without disturbing the face? Can you review the result over the delivery background? For the After Effects shot above, Roto Brush gives you those controls and lets you keep the original footage and title in the same composition.

Can AI rotoscoping replace motion capture?

They produce different assets. If you need a body to pass in front of a title, a moving matte does the job. If you need to drive a 3D character’s joints with the actor’s performance, that silhouette alone does not tell the rig how the actor’s elbows or knees rotated. For examples of performances that drove digital characters, see how Gollum and Caesar came to life.

Published on · Updated by Marcus Thompson

Marcus Thompson

VFX Specialist
Make your own movie with AI.No experience needed.
Start creating free