Wk 4 : Alphas, track mattes, expressions & plugins

Compositing is a normal part of the video post-production workflow, whether it’s crafting a title, placing a lower third or stunning the audience with a visual effect. One of the simplest, but most overlooked, ways to composite video is through the use of track mattes.

A track matte is simply an image, or a video clip that is used to create variable transparency in another video. It can be a still image, a video clip, a graphic, text or a generated shape. There are two basic kinds of track mattes, alpha mattes and luma mattes. Alpha mattes lend their own transparency, their alpha channel, to another clip for the composite, while luma mattes supply a luma channel, their brightness, to define the transparency in the composite.

Alpha Mattes

Most video clips exist in an RGB color space without an alpha channel, meaning there is no transparency in the image. If the video clip was placed on top of another, the underlying video clip would be entirely hidden. However, there are video clips, and other media files such as PNG images and vector graphics, which have an alpha channel. This means there are portions within the image which contain variable transparency, from opaque to fully transparent. It’s the alpha channel in the image that determines the amount of transparency. An alpha matte is a video clip, or image, with an alpha channel that is used to define the transparency in another video clip. For example, you might have a scenic video clip of a location. This base video clip possesses no transparency. You could use a piece of text generated in your compositing program as an alpha matte. The text itself contains an alpha channel, the body of the text is opaque while the negative space around the letters is transparent. When the text layer is selected as an alpha matte and applied to the base video clip, the base video clip uses the alpha channel of the alpha matte (the text) as its own. This results in a video clip of the original scene that is only visible in the portions of the text, the alpha matte.

Luma Mattes

Luma mattes work in the same way as alpha mattes, except instead of using the track matte layer’s alpha channel to determine the transparency in the composite, it uses the luminance values of the luma matte is used to determine variable transparency. In this way, variable transparency can be created without using a source clip that contains any variable transparency. For example, you might have the same scenic clip you used for the alpha matte composite, but instead of a text clip, you have a black and white clip of flowing ink, spreading throughout the video clip. You could take the ink clip and set it as a luma matte, applying it to the scenic clip. As a result, the scenic clip would flow to life, becoming opaque, appearing only where the ink in the luma matte flows.

Track Mattes in Adobe After Effects

 In some ways track mattes may sound complicated, but when put into practice, they’re rather simple. So simple in fact, that Adobe After Effects has track matte functionality built into the timeline window of its interface. Each layer in the After Effects’ timeline has a series of switches and modes. Under the modes of each layer, except for the top layer and audio files, is a Track Matte pull down option. By default, this option is set to “No Track Matte.” There are four other options under this menu; Alpha Matte, Alpha Inverted Matte, Luma Matte and Luma Inverted Matte. When a Track Matte mode is selected for a layer, that layer becomes the base layer and the layer above becomes the track matte, the layer that defines transparency in the base layer.

When a track matte mode is selected, visibility is turned off for the layer above, the track matte. This is because the track matte is there to create transparency but not to be seen as a clip in the end composite.

 Power in Numbers

A solitary track matte is easy to execute and is a great technique for filling text with video or punching a hole in a clip to reveal a second image underneath. The current trend of double exposure portraits can be easily pulled off in video by shooting overexposed footage of a subject on a white background and using the luminance of that image as a luma matte in another piece of video. But track mattes don’t have to be limited by a single composition. Multiple track mattes composited together can make for some dynamic imagery. For instance, you could create a double exposed portrait using the aforementioned technique but then take it a step further. The double exposed portrait can be pre-composed and then drift into the screen by using blowing smoke as a luma matte to transition it onto screen. That composite can then use a layer of text as an alpha matte. The chain of pre-composing clips and track mattes can continue as far as you want to travel.

Expressions

An After Effects expression is like a line of computer code, or action script within Flash (now Adobe Animate.) Much like computer code or action script an expression is some type of formula telling After Effects to do something specific. Unlike action scripting, however, expressions live within an element's attributes, like their scale or rotation.

So, what's the point of using an expression?


 

When and How to Use Expressions

Say you have a ball moving across the screen from left to right, but you also want that ball to wiggle. Rather than going in by hand and doing that or applying an effect and giving it lots and lots of keyframes, we can simply apply a wiggle expression to it.

So, we'll only have our two keyframes saying to go from left to right, plus the expression telling it to wiggle. It keeps things nice and organized as well as easily changeable. Rather than having to redo hundreds of keyframes if we want our wiggle to be more extreme, we can simply change the expression. So, we're animating our object in two ways, using keyframes and using an expression.

Another common example of how expressions can work in After Effects is by affecting a piece of animation without actually animating it. You can write an expression that says as time progresses our animation will become more extreme or less extreme.

If we have an effect of a pulsing light, we can apply an expression to it that says as our animation plays the pulsing light gets more and more dramatic, without actually having to go in and animate that effect magnifying. Here, we're not animating using an expression, but affecting a piece of animation with the expression.

 

A Wiggle Expression as An Example

Let's do a simple wiggle expression as an example to get an understanding of how they work.

You'll make a new composition within After Effects that is 30 frames long and you'll do your action scripting in there. Let's make a simple square using solids. Hit Command Y and make yourself a little square. Now let's do a simple expression to learn how they work.

With your solid selected, hit P to bring up its Position drop-down menu in your timeline. If you were going to animate it, you'd simply click the stopwatch to activate keyframes, but to add an expression you'll want to Option or Alt-click the stopwatch.

This will turn the Position attribute into a new little drop-down menu, adding Expression: Position below it. You'll see over to the right in your timeline an area you can type in that currently says "transform. Position"

This text field here is where we type out all our expressions. A nice simple expression is the wiggle expression as mentioned earlier -- this will cause your object to move around slightly throughout your animation.

 

The wiggle expression is set up like this: wiggle (x,y)

To start your expression, you're going to type "wiggle" -- that's telling After Effects you're applying the wiggle expression followed by the values in the parenthesis which is telling After Effects when and how much to wiggle.

X stands for how many times per second you'd like After Effects to move your object, so if your frames per second is 30, then putting a 30 in for the value of x will make it so that your object moves every frame. Putting in a 15 at 30fps will result in every other frame moving your object, etc.


The Y value stands for how much you want your object to move. So, a Y value of 100 will move your object 100 units in any direction and a Y value of 200 will move your object 200 units in any direction.

So, a completed wiggle expression will look something like this: wiggle (15,250)

Now you'll see your square wiggling around your stage when you hit play, but you haven't applied any keyframes at all. You can even go in and do the example originally cited and add in keyframes of your square moving from left to right along with your expression.

 So, in summary, an After Effects expression is a piece of text, much like a piece of code, applied to a property of an element that is affecting that property. They work in a myriad of ways and have a wide range of uses, but much like code they are finicky to spelling and punctuation mistakes, so be sure to double check them as you type.

 

Plugins:

Plugins are in their simplest form’s "effects" or "filters". Adobe After Effects comes with a large bundle of plugins / effects included which cover everything from color correction to keying, particle generation to distortions...and much more.

You can add third-party plugins as well. Third-party simply means that someone other than Adobe created the plugin, and you can install and use it with Adobe After Effects. This might be a keying effect with more options, an advanced particle generator, or a plugin that lets you bring in 3D elements to your project.

Most third-party plugins are not free and can end up costing several hundred or even thousands of dollars.

An interesting side note is where the term "plugin" came from. This is a term we have borrowed from the digital audio world. Early DAWs (Digital Audio Workstations) listed effects as plugins as an homage to analog audio mixing consoles. In an analog mixing console, you typically had little to no effects built in to the board. You used what is called an insert, a place to plug in a send/return cable, to bring an outboard effects unit. This is where we get the term plugin.