Top

The Matte (Part One)

June 24, 2008 by clive 

The Matte (Part 1)

by Douglas Toltzman

What is a matte? We talk about mattes all the time in compositing and when adding effects to our video clips. Although mattes have different names, depending on how they are created and used, they always perform the same purpose. Matte is also synonymous with “mask” and is often used in place of an alpha channel. The matte gives us a way to isolate parts of an image, or video frame. If you are familiar with Photoshop, you may have used layer masks. Those are also mattes. A matte is usually a black and white image, but it can be generated by a filter or plug-in, in which case you may only see the affect of the matte.

A Matte should be Gray Scale, not Color

A matte works by specifying the amount of opacity at each pixel position in the image. In the case of a black and white image matte, black generally represents zero percent opacity (transparent) and white represents full opacity (opaque). Gray pixels represent areas of partial transparency; the closer to white, the more opaque that region will be. If a colored image is used as a matte, a single channel is selected to provide the virtual gray-scale. By using a channel isolation filter to select the Red, Green, Blue, Luminance or Alpha channel and desaturating, you’ll have a clearer picture of the matte’s function.

A Matte should be sized to Match the Video Frame

Since each pixel in the matte represents some level of opacity or transparency, and that opacity level is mapped into the image that we are trying to manipulate, it is important that the pixels in the matte map one to one with the image to which it is applied. If you’re not sure how to apply the matte, hang tight, I’m getting to the application. Right now, I want you to understand that these 2 rules are the basis for creating a matte. You can create mattes by hand, or using any tool that can manipulate a gray scale image/bitmap.

Types of Mattes

All mattes perform the same function, and matte is synonymous with mask. However, mattes get different classifications depending on how they are created and applied. An image matte is just a hand drawn or otherwise constructed still image that is applied to every frame of the target video clip. We’ll create a simple image matte in the next section. A traveling matte is a video, or a series of images that will be matched, frame for frame with the target video clip. A traveling matte is much more difficult to create by hand, but it can be done, and sometimes it is necessary. For now, all you need to remember is that a traveling matte may change from frame to frame, whereas an image matte applies the same matte to each frame of the video. A garbage matte is just a fancy term for any matte that is used to remove unwanted elements (garbage) from the frame. Most compositing tools provide a range of filters that let you create garbage mattes. These filters might be as simple as a 4-point matte, which lets you define a box (not necessarily rectangular) around the area of the image you wish to keep, by defining 4 points. The term garbage matte does not specify a type of matte, but rather how the matte is used, or the purpose of the matte. Any image matte or traveling matte could be used as a garbage matte. There are probably other types of mattes, and various terms for mattes, depending on your compositing application, but they all work the same way, so lets get on with the business of creating and applying mattes.

A Simple Image Matte


Beside using a simple filter that lets you define the corners of a matte, the image matte is probably the simplest type of matte and one of the easiest to create. In the example above I created a matte to remove the sky and used it to insert a more colorful sky, although I’m not sure it was an improvement, sky replacement is a common use of mattes.

A quick way to make an image matte is to open a frame of your video in an image editing application. Select the region you want to remove and fill it with black. Next, invert your selection and fill the inverted selection with white. You now have a black and white image matte. You may also want to apply a little blur or blending between the black and white, as needed. When compositing this example, the new sky would be in the lower layer, the model would be in a layer on top of the new sky, and the matte would be applied to the layer with the model, because the black regions of the matte represent transparency (in this case, the old sky would become transparent, allowing the new sky to show through). The white areas of the matte (the opaque regions) are over the model and the parts of the background we wish to preserve.

A Traveling Matte

Often times, we need our matte to change from frame to frame to match movement or changes in the video we are compositing. A traveling matte is an image sequence or video that performs the same function as an image matte, but each frame of video is matted with the corresponding frame from the traveling matte.

In the illustration above we see a struggling actor (literally), with her face mired in shadow, the struggling cameraman exposed for the actor’s face to be sure to get the actor’s expression, which resulting in an overexposed background. There are several ways to correct this, but for the sake of this discussion, we’ll use a traveling matte, generated using a levels filter, combined with a garbage matte to protect the foreground.

In the timeline, the original video is in video layer 1. The traveling matte is in video layer 2, and the darkened video is in video layer 3.

The traveling matte version is desaturated and level adjusted so that only the super-bright areas are white (opaque). There is also a gaussian blur on the traveling matte layer to soften the matte.

The top layer (video layer 3) has a simple color corrector applied to darken the video and add a little extra blue. The garbage matte is also applied to layer 3 to mask off the foreground highlights. Finally, layer 3’s composite mode is set to “Travel Matte Luma” so that layer 2 will be treated as a matte, controlling the opacity of layer 3.

When creating a composite, except in the simplest of cases, it is often necessary to combine two or more types of matting techniques. In the case above, I could use luminance to select the bright water behind the actor, but to avoid selecting the highlights in the foreground, I had to add a garbage matte in addition to the traveling matte. Some effects, including Final Cut’s Color Corrector, have their own, built in mattes. The same affect could have been done in the Color Corrector by using the “limit on luma” settings. However, the traveling matte technique will work in Motion, or in other non-linear editors. It also has the advantage of letting me stack filters and apply the matte to all of them, rather than just the Color Corrector. Finally, I can add other filters to the traveling matte to further enhance it, like a guassian blur or a gradient mask.

Conclusion of Part 1

Mattes are very powerful tools. Understanding the many ways of creating and applying mattes is key to compositing and enhancing video. If you plan to use mattes to replace image elements, please come back and read part 2, where I’ll discuss what you should do, and what you should avoid when shooting for compositing.

The Matte (Part 2)

Shooting for Compositing

Compositing in Final Cut Pro

Compositing in Motion

Your email:  
Subscribe Unsubscribe  

Comments

One Response to “The Matte (Part One)”

  1. Cole McDonald on July 5th, 2008 3:13 am

    Here’s an image I did with this technique so I could try it out. I wanted to punch up the color in the background and shorten the DoF a bit. I blurred the highlights layer a bit (layer 3) after pushing the saturation on it and bumping it toward blue a bit. Wonderful technique. I then nested the layers and pulled used a matte on the reds to desaturate the reds a bit. This is all in FCP…

    http://www.yafiunderground.com/Images/AlphaMatte/FO-Cool-Frame-Orig.jpg
    http://www.yafiunderground.com/Images/AlphaMatte/FO-Layer-1-CC.jpg
    http://www.yafiunderground.com/Images/AlphaMatte/FO-Layer-2-Matte.jpg
    http://www.yafiunderground.com/Images/AlphaMatte/FO-Layer-3-CC-Blur.jpg
    http://www.yafiunderground.com/Images/AlphaMatte/FO-Nest.jpg
    http://www.yafiunderground.com/Images/AlphaMatte/FO-Final.jpg

Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!





Bottom