Materials for This LessonComplete Tutorial

One of the things that sets After Effects apart from most editing programs is its use of layers. Like Adobe PhotoShop, AE enables you to place every element on its own layer, giving you complete control of even the smallest detail within each frame. Once you understand how to

In this exercise, you'll use two simple graphics files as cut-outs to crop the display of moving video. The letters of one title will be displayed as billowing flames,
the other, as moving water.

use techniques involving layers to achieve the effects you have in mind, it becomes very fluid and natural to compose great video. The use of track mattes is one of the most fundamental of these layer-based techniques.

Many images and footage items come with their own alpha channels, which determine where that image or piece of footage will be transparent. However, you can also use the alpha channel or luminance values of a second footage item to define the first one's transparency. In AE, this second image is known as a "track matte." An "alpha matte" uses the alpha channel of the second image to determine the transparency of the first, while a "luma matte" uses the second image's luminance, or gray scale values.

The following step-by-step instructions will walk you through the process of using one image as a track matte for another. This should be easy for those who have used mattes before, and it will be a good introduction for those who haven't. To follow along, you'll need to download the sample files from the Guild website: www.editorsguild.com/aftereffects.

Before getting started, take a moment to watch the already completed sample.mov, and notice how the video footage of the fire and the water only shows through in the shape of the text. The .jpg source files are simple black-and-white images without any alpha channel information. We are going to use these files as luma mattes, so that the white areas of the image define the transparency of the layer below.

1. Launch After Effects and create a New Project (File > New > New Project). Import the two pieces of stock footage (fire.mov and water.mov) and the two black-and-white JPEG files (hot.jpg and cool.jpg).

2. Create a new composition (Composition > New Composition) with the settings shown in Figure 1. Name it "assembly comp."

    Figure 1. Begin by creating a composition
    with these settings.

4. To make it easier to see the footage in the Comp Window, change the composition's background color to white by selecting Composition > Background Color. In the dialog box that opens, click on the color swatch and change it to white.

5. Drag the fire.mov and hot.jpg files into the Timeline. Make sure the hot.jpg layer appears above the fire.mov layer, dragging the layers to rearrange them, if necessary.

6. At the bottom of the Timeline, click the box that says Switches/Modes. This will reveal a new panel showing the modes and track mattes for each layer (Figure 2). Notice that the top layer, hot.jpg, does not have a pop-up available for TrkMat.

Figure 2. At the bottom of the Timeline, click on the words "Switches/Modes" to reveal the track matte menu. Choose "Luma Inverted Matte" to make that layer visible only where the layer above it is white.

7. Select the fire.mov layer, and from the TrkMat pop-up menu, select "Luma Inverted Matte" (Figure 2). In the track matte pop-up menu, after the type of track matte you choose, you will see the name of the layer above (in this case, "hot.jpg"). After you select a track matte, the eyeball next to the layer name for fire.mov will become blacked out in the center.

8. After you choose Luma Inverted Matte, the target layer (fire.mov) shows through only in the black areas of the black-and-white hot.jpg layer. (If you were to change the track matte setting to Luma Matte, the target layer would show through in the white areas of the matte layer instead.)

9. Set your work area to six seconds and preview the composition using the RAM preview button in the Time Controls window. (If you don't see the Time Controls window, press Command-3 to show it, or just hit 0 on the numeric keypad to start RAM preview.) If your computer has trouble previewing the entire work area, try reducing your preview quality: in the Comp Window, open the resolution pop-up menu at the bottom of the viewer and switch the setting from Full to Half.

10. The hot.jpg layer now acts as a matte for the fire.mov layer, but each layer still has its own properties and can be animated separately. To animate them together or to manipulate their properties simultaneously so that they can be scaled or otherwise transformed at the same time, you need to group the two layers. One easy way to do this is to pre-compose the layers into a separate nested composition.

11. Shift-click to select both layers. From the Layer menu, select Pre-compose. In the Pre-compose dialog box, rename the new composition "fire comp" and click OK. The two layers are now nested in a separate composition, which shows up as "fire comp" in your Project Window and automatically appears as a single layer in the original assembly comp. (The bar that represents the fire comp layer in the timeline is gray, where the original footage items were pink or yellow.) The two layers will maintain their original transform properties inside the pre-composed fire comp that you have created.

12. We will now repeat the same technique on the other two project files, water.mov and cool.jpg. To prevent any changes to the fire comp layer, click its lock switch to preserve its settings, then click its video switch (the eyeball) to hide the layer. (Both switches are located to the left of the layer name in the Timeline.)

13. Drag water.mov and cool.jpg into the timeline and repeat steps four through ten, this time using cool.jpg as the Luma Inverted Matte for water.mov. When you reach the point where you need to pre-compose the two layers, name the new pre-comp "water comp."

14. At this point, you should have two pre-comp layers in the assembly comp: fire comp and water comp. Each pre-comp should contain a footage layer with a matte layer on top of it.

15. Turn the video switch back on for the fire comp layer and unlock it. Reposition the layers so that the composition matches the one shown in Fig. 3.

Figure 3. The final result, which may require the repositioning of layers, should look like this.

16. Save your project and preview your work.

While it may seem as though this process involved many steps, track mattes are actually very easy to use! If you take advantage of this technique to pre-compose an image layer and a matte layer together, you can animate and add effects to each layer independently, or to the entire group. Experiment by adding motion to the matte layer alone, as well as adding motion or effects to the entire group. Remember, any kind of image can serve as a track matte layer, although for luma mattes, those with sharp contrast will work best.

In the next installment of this series, we will start to explore what can be done using AE's time remapping to speed up, slow down and even stop the motion of video layers.