What Are Track Mattes in After Effects?

Get it? Track Matte like track and field. I'm so funny.

 So if you've been using After Effects to animate you may have run across the term "Track Matte" before or maybe the little TrkMat menu in your timeline. So what the heck is a track matte anyway? Well if you're like me then you are lazy and hate animating, that's where track mattes can come in and help out! Let's dive in about what a track matte is and walk through an example of how I recently used them for a project I did.

What is a track matte?

So if I'm being honest I have no idea why a track matte is called a track matte (Adobe if you see this please let me know) but I do know what they do! In a nutshell a track matte tells one layer to look at the layer above it and decides what to show or what not to show based on that layer. It's kind of like if you imagine those old thick plastic stencils you had when you were a kid, the layer we apply the track matte to that is below the stencil layer will show through different parts of the stencil depending on what we tell it to do. They are kind of like masking in After Effects, except using an image as a reference for that mask.

There are two kinds of track mattes, and within that two variants of them. We have Alpha Mattes and Luma Mattes. Within those two kinds of track mattes there are normal track mattes and inverted track mattes as well.

Alpha Mattes

An alpha matte tells the layer we apply it to to look at the layer above, and only show based on the alpha channels of the image.

An alpha channel is an image with no background, most common they're PNG files. Here's a PNG of a duck as an example. Our track matte-ed layer will look at that PNG and only show itself based on the alpha channel of the duck. So if we chose the regular Alpha Matte it will show anything that is within the content of that image, nothing in the alpha channel's see through background.

If we choose the Inverted Alpha Matte it will only show the layer where the clear background alpha channel is around the duck.

Luma Mattes

The other kind of track matte is the Luma Matte. A luma matte shows the layer based on the luminance of the layer above it. Take this photo of an ink drop in water for example. If we apply a luma matte to the layer below it, it will look at the light and dark values of the ink drop and show the layer based on those values.

A normal luma matte will show things in areas that are bright, so in the case of that ink drop they'd show the content of the layer at 100% opacity in all the white areas since that is so bright and stark. It won't show the areas in the black, and the areas in the grey will be faded depending on how light or dark they are.

An inverted luma matte will do the same thing, only opposite, it will show ares in black and not in white. So again, we'll get a variety of values with the lighter and darker areas rather than just an on off type effect we got with the alpha matte.

How To Use A Track Matte

Let's walk through how to apply and track matte so we can see it's effects first hand. For our example I'm going to be using this piece of footage of an ink drop falling and spreading on some paper.

 Let's have it so that the ink drop reveals some text.

Since the video doesn't have an alpha channel to it we're going to need to use luma mattes rather than alpha mattes, the good thing however is that apply an alpha matte or a luma mat is the same steps either way, so once you know how to apply one you'll know how to apply the other.

So once we've brought our movie file of the ink drop, or whatever it is you decided to use, into After Effects lets drag it down and make a new composition. We can keep it the length of the ink drop clip since this is just a test.

Once we have that done, we'll need to make our text layer that we want to be revealed. I'm going to use a big bold, sans serif font so we can really see the effect of the luma matte. I'll write something clever and original like "Johnny Rules."

Once we've done that we need to line up our layers, remember with track mattes we add it to whichever layer we want revealed and it looks at the layer above it. So we want our ink drop on top of our text.

Again, since we don't have an alpha channel we'll need to use a luma matte and since we want it to be revealed where the black is rather than where the white is we'll need to use an inverted luma matte.

In your timeline you should see a TrkMat dropdown menu on your text layer, if it's not there go ahead and click the button in the bottom left hand corner of After Effects that looks like a circle and a square overlapping, that will bring up the option.

You'll notice also that there isn't the TrkMat menu for the top layer, in this case the ink drop, that's because there are no layers above it for it to reference so a track matte wouldn't work.

From that drop down menu choose Luma Inverted Matte, it also will show you the name of the layer above it so you can double check it's the right one.

Once we've chosen that you'll notice that the layer above our text, the ink blot, has turned itself off and disappeared. Track mattes will automatically disable their visuals because After Effects assumes you don't want to see what you're track matting, which 9 times out of 10 is correct.

Now you may have to align the track matte a little bit to get it to reveal the text in the right way, but if you hit your space bar and do a preview of the animation you'll see it reveals the text as if the ink drop was splashing onto it.

Taking it One Step Further

Say though we don't want the text appearing on a blank background, what if we want it to look like the text is appearing within the ink drop itself? Simple, we just have to duplicate the ink drop layer and slide that below the text layer and turn it back on by clicking the empty box farthest to the left on that layer, the eye box. That'll turn it back on so that we can see our text.

Say we want to take it even one step further though! Let's say we want to add some of that ink texture into the text layer.

All we have to do is make another copy of our ink drop layer and put that above our track matted layer, so now it's the top most layer. We can select a blend mode we like for it and it'll add texture to the text.

But let's say we want to go even one step further! We don't want this new texture effecting the whole scene, just the text. We can duplicate our text and turn off the track matte on it, then make that duplicated text the new topmost layer.

Once we've done that we can alpha matte the blend mode-ed ink drop layer to the text, and wa-bam! Our new texture only appears in the text and not over the entire image. Now we've used both luma and alpha mattes in this tutorial and you'll see it's the same process for both, you just click a different button.

In Conclusion

So using a few simple clicks we've managed to create a neat effect with very little work all with the help of track mattes. I used this technique in a lyric video I produce for Marianas Trench's Wildfire.

I used different clips of dropping ink as the track mattes for the text, using luma mattes and fades on the text to create the kind of wishy washy feel to it. It's a nice system too because once I had the track matting established I could go in and change the text to match the lyrics without having to worry about messing up the animation, and I could move them around the screen wherever I wanted again without worrying about messing something up.

Track mattes are great technique when you have to do a lot of animation in a quick turn around, like I did for that lyric video. Another example of why a track matte might work is if you're trying to emulate something like an array of monitors or screens, the track matte could be all the dividing lines to save you work.

So in summary a track matte is a feature on a layer in your timeline that reveals or hides it based on the image on the layer above it. There are two kinds of track mattes, alpha and luma, alpha mattes look at where there is or isn't an alpha channel on the layer above it and shows the image based on that, and a luma matte shows the image based on the brightness of the layer above it. The normal and inverted alpha and luma mattes do the same thing, just show the opposite. That's track mattes for ya!