AE fundamentals

Mattes

In this After Effects Fundamentals lesson, you'll learn all the basics of mattes. Like masks, mattes are a way to control the visibility of a layer. The big difference, is that mattes are a separate layer, whereas masks are part of the same layer. This opens up tons of creative possibilities.

Download the After Effects project file of examples for this lesson.

Find Matte Options

First, you'll need to find the Track Matte options in the timeline. There are a few ways to make these options visible (depending on what you're currently seeing):

  • Click the Toggle Switches/Modes button at the bottom of the timeline
  • Click the second icon in the bottom left corner of the timeline
How to find matte options in the timeline

If you still don't see Track Matte at the top of the timeline, right click on that bar where it should be. From the pop-up menu go to Columns and then make sure Modes is checked:

Another way to find matte options in the timeline

Create a Matte

There are two ways to create a matte:

  • On the layer that you want to affect, select the layer that you want to act as the matte from the drop-down under Track Matte on the timeline.
  • Drag the pick whip (spiral icon) next to Track Matte from the layer that you want to affect to the layer you want to act as the matte.

How to create a matte in After Effects

After Effects will automatically turn off the visibility (eyeball icon) of the matte layer. For some types of mattes, you can turn this back on for a different look (example below).

Note: The pick whip for Track Mattes is new in After Effects 2023 (released October 2022). Also, in previous versions of After Effects, you could only use the layer directly above the affected layer as a matte. Starting in the 2023 version, any layer can be used as a matte, regardless of the layer order.

Animating with Mattes

The difference between masks and mattes, is that masks are on the affected layer, whereas mattes are a separate layer. If you animate a layer with a mask, the mask will move with the layer. Mattes can be animated without moving the affected layer(s) and the layer(s) that are being matted can be moved without affecting the matte.

In this example, the position of the text (the matte) is animated, but the "design" composition is not affected. The "design" composition could also be animated without affecting the matte/text layer.

Mattes can be animate independently from the matted layer

In the example above, if you wanted the "design" composition to move with the text (matte), you could parent it. This will make the it act more like a mask. In many cases, mattes can be more flexible than masks.

Alpha Mattes

When you create a matte, by default it will be an alpha matte. Alpha mattes use the transparency values of the matte to determine what parts of the matted layer will be visible.

How alpha mattes work

In other words, wherever the matte (the text in the example below) is 100% opacity, the matted layer (the "design" composition) will be visible, and wherever the matte is 0% opacity, the matted layer will not be visible. It's simpler than it may sound–where you see the matte, you see the matted layer.

An example of an alpha matte

Missed how to create a matte? Jump to back to that section here.

Transparency Grid

To see what's transparent in your composition, turn on the Transparency Grid by toggling the checkerboard icon, at the bottom of the composition panel, to blue. This simply shows a grid to indicate where there's transparency. So instead of the background color of your composition, you'll see this checkerboard pattern.

Alpha mattes in After Effects

Invert a Matte

To switch, or invert, how the matte works, check the Invert box on the layer in the timeline. This makes any areas of the matte that are 100% opacity totally invisible on the matted layer and any areas that are 0% opacity totally visible. Here's an example:

Inverted alpha matte

Keep in mind that the color of the matte doesn't matter. After Effects is only looking at the alpha channel of the matte layer to figure out what should be masked. The "alpha channel" just means the transparency values (or in other words, opacity).

Luma Mattes

Luma Mattes work similarly to alpha mattes, but instead of using transparency, to determine what will be masked, they use luminance. You can think of luminace as brightness. The brightest areas on the matte will be visible (100% opacity) on the matted layer. The darkest areas on the matte will be invisible (0% opacity) on the matted layer.

How luma mattes work

How to create a Luma Matte:

For this example, I'm using an image of my bamboo desk as the luma matte for a text layer spelling out "Matte". Within the shape of the text, the dark areas in the image will be partially transparent when used as a luma matte. This will create a textured look using the light and dark areas of the image and the color of the text layer.

An example of a luma matte

In After Effects, set the Track Matte of the text layer as the bamboo image layer. Then, click the icon to the right of the Track Matte dropdown menu to switch from the default alpha matte to a luma matte.

How to create a luma matte

The result:

A luma matte in After Effects

You could check the Invert box on the layer in the timeline to switch how the luma matte works. An inverted luma matte will have the brightest areas of the matte invisible on the matted layer and the darkest areas visible.

Adjusting Mattes with Effects

You can apply effects to mattes to manipulate how they look (or even add animation). When working with Luma Mattes, you may want to adjust the bright and dark areas of your matte. To do this, you can use a Curves or Levels effect.

In the example above (and below), I added a Curves effect and adjusted the graph in Effect Controls to make the bright and dark areas of the bamboo image (the matte) more dramatic.

Adjust a luma matte with the curves effect

Sharing Mattes

You can have multiple layers that all have the same matte. This was a new feature in After Effects version 2023.

To set the matte for multiple layers at once, first select the layers (click the first, hold shift, click the last OR hold command/Cntl while clicking multiple layers). Then, use either the drop-down menu under Track Matte to select the matte layer from the list, or use the pick whip to drag from any of the selected layers to the matte layer.

Layers can have the same matte

Preserve Underlying Transparency

Just to the left of the Track Matte options on a layer in the timeline, is the Preserve underlying Transparency button.

Preserve underlying transparency button in timeline

Turning this button 'on' for a layer means that this layer will use the combined transparency of all the layers below it as a matte. It works like an alpha matte so wherever the layer/s below have 100% opacity, this layer will be totally visible and wherever the layer/s below have 0% opacity, this layer will not be visible.

In this example, turning on Preserve Underlying Transparency for multiple layers can has a similar effect to using the same alpha matte for multiple layers (see example above):

An example of preserve underlying transparency

Let's look at how Preserve Underlying Transparency is different than assigning the same alpha matte to multiple layers. If we add a layer to the bottom of the timeline, it's like adding to the matte.

Another example of preserve underlying transparency

Matte Each Other

Layers can be mattes for each other (this is only possible in After Effects 2023 release and later). In this example two circles are alpha mattes for each other:

Layers can be the matte for each other
Remember to turn the visibility eyeball back on when creating this effect.

Now check out what it looks like if we invert the alpha matte:

An example where layers are the inverted alpha matte for each other

Now that you know the basics of mattes, you can get creative with using different types of mattes on different types of layers, and combining mattes, masks, and effects together.

All the keyboard shortcuts you need, in one place:

Up Next

In the next lesson, you'll learn how to export (render) your animation as a video file that can be played outside of After Effects.