Visual-effects and motion-graphics specialist Angie Taylor shows how to use After Effects’ Clone Stamp tool to convincingly add to moving footage.


The Clone Stamp tool in After Effects works just like the Clone Stamp tool in Photoshop, but can be used to clone moving footage. I worked on the award-winning short film Hibernation with John Williams in 2005.

In this scene John told me that he wanted the tree to be full of lights but that they only had enough budget to buy one set. So they thought they could ‘add the rest in post’.

Of course, it’s usually much better to do it in camera unless impossible due to either physics or budget. This is a tricky shot to work on.

As you can see, the camera is moving, as is the main character. And just to make it especially difficult, it was shot on 16mm so is very grainy – a visual-effects nightmare! Here’s the technique that I used to track new lights onto the tree using motion tracking and Paint.


01. Open Hibernation.aep and RAM preview 01_Start comp. Doubleclick the top Hibernation_clip_01.mov layer to open the Layer panel. Click the Pixel Aspect Ratio Correction button, so the footage is displayed undistorted. Choose Workspace > Paint Workspace and select Clone Stamp from the Tools panel (Cmd/Ctrl+B). Check that the settings in the Paint panel and the Brush Tips panel match those in this picture. Choose a soft-edged brush 30 pixels in diameter.


02. Hold down Option/Alt and click on one of the tree lights to set the source position of the Clone Stamp tool. Move to an empty part of the tree and click once to paint a new light into place. It looks good, but if you RAM preview the footage you’ll see we have problems. The light isn’t moving, while the footage is; we need to make the source of the paint, as well as the paint stroke, move with the tree.


03. To see the paint more clearly, let’s try viewing it on a transparent background. Select the top Hibernation_clip_ 01.mov layer and double-hit the P key to open the paint. Change the Paint on Transparent setting to On, and you’ll see the layer and its paint disappear. Switch on the Transparency Grid button in the Layer panel to check that the paint is not visible.


04. Open the Clone 1 brush and the Stroke Options. In the Clone Source menu, choose the bottom Hibernation_ clip_01.mov layer. You should now see your brushstroke on a transparent background. Preview the Paint in the Layer panel – the brushstroke stays still, but its contents move. We need to get the clone source following the changing position of the light, so we’ll use Motion Tracking.


05. Right-click the bottom Hibernation_ clip_01.mov layer and choose Track Motion from the menu. The Layer panel will open and a tracker point is added to the footage. Move to the beginning of the clip and use the Selection Tool to position the Feature Region (the innermost rectangle of the track point) around the light you chose as the source; resize it to fit snugly around the light. Make sure you don’t drag the Feature Center crosshair in the middle of the Feature Region.


06. Make the Search Area box (the Track Point’s outer rectangle) small enough that it does not include any other lights, as this will confuse tracking.



07. In the Tracker Controls panel, click on Analyze Forward, but don’t apply the tracker. You can’t apply tracking data directly to paint strokes, so we’ll use an expression to apply keyframe data to the paint.


08. Open the comp named 02_Mid Comp from the Project panel. This comp contains a layer named Tracker Keyframes, which has the tracked keyframes stored in the Position property. In the Timeline, select the bottom layer and then hit U to open keyframes. Select the top layer in the timeline, open Clone 1 brush and open Stroke Options.


09. Select Clone Source > Clone Position in Stroke Options, and go to Animation > Add Expression. Drag the Expression Pickwhip to the Position property on the bottom layer and release when it highlights. Hit the Enter key on the number pad to activate the expression. Preview; notice that the paint displays the light throughout the duration of the comp, but the paint stroke is not following the tree. We also need to animate the position of the layer so that the paint follows the tree’s position.


10. Select the top layer and hit P to open its Position property. Option/Alt-click the Position property stopwatch to add an expression. Drag the Expression Pickwhip from the top layer Position property onto the bottom layer.


11. Activate the expression but before previewing, select the top layer again and this time, double-hit the P key to open the Paint. Switch off Paint on Transparent so that you can see the whole layer.


12. Preview – note that the anchor point of the top layer follows the lights on the tree. We need to align the layers, using Difference Mode. When it’s lined up exactly, the image should be completely black except for any differences between the layers.

Change the top layer to Difference mode in the Timeline’s Modes column, and line up layers by nudging the Transform > Anchor Point value in the Timeline. This will not affect the Position expression and will keep everything relative.


13. Once the images are matched up, change Difference mode to Normal, then switch Paint on Transparent on again. Preview the comp panel to see one new light composited onto the tree. Doubleclick the top layer to open the Layer panel.

You’ll see the light against a transparent background. Switch off Paint on Transparent to see the light composited against the original layer. Select the new light (named Clone 1) and change its blending mode to Lighten. This works well as it emphasizes lighter areas and ignores darker edges of the cloned light.




14. Hit Cmd/Ctrl+D to duplicate the selected light. Select the new light (Clone 2) in the Timeline. In the Layer panel you will see the light represented by a small crosshair icon when it is selected. Click and drag the new light to a new location on the tree. Repeat this process to fill your tree with new, duplicated lights; change the size of the clone brush to make the effect more random.

Tips

01. If you make a layer transparent, it also makes the source transparent, so any paint on the layer disappears. The solution is to take the paint source from another identical layer.

02. Switch on Paint on Transparent and open the Comp panel to preview the lights on the tree.


Who: Angie Taylor’s work involves producing animations, visual effects and graphics for television, film, video and the Web. Her work regularly appears on British and European TV. Recent projects include visual effects on Hibernation, and animations for a DVD album by Beck. She is the author of Creative AfterEffects 7, and she regularly tours with Adobe and Apple giving demonstrations and seminars.
Contact: www.creativeaftereffects.com
Software: After Effects
Time to complete: 30 minutes
On the CD: All files for this tutorial can be found on the cover CD.