66 The Art and Science of Digital Compositing
While this effect is certainly useful in a variety of situations, it does not give
us the impression that any sort of layering has occurred. There is no sense that
certain portions of one image are actually occluding the second image. To accom-
plish this, we need to introduce the concept of a matte.
THE MATTE IMAGE
Combining different image sequences needs to be a process with as much control
as possible. We need to be able to limit which portions of the various images will
be used, and which will not. We need to be able to control the transparency of
the various layers so that they don’t completely obscure everything that they are
covering. And we need to have a method for defining and controlling these
attributes that is intuitive and consistent with the rest of the image processing
we will be performing. This is what the matte image gives us.
First of all, understand that a matte image is no different from any other image,
in terms of the data used to represent it. It can generally be treated and manipulated
in exactly the same fashion as other images, but it is considered to have a different
purpose than those images. Instead of providing a visual representation of a scene,
it is more like a utility image, used to control individual compositing operations.
Mattes are used during compositing when we only wish a portion of a certain
image to be included in the result. You may also hear the term ‘‘mask’’ used
when referring to mattes, and it is not uncommon to find the two terms used
interchangeably. For sanity’s sake, we will try to limit the use of the word ‘‘mask’’
to refer to a general image that is used to control or limit certain parameters in
an operation, such as a color correction.
To complicate things even further, both ‘‘mask’’ and ‘‘matte’’ may also be used
as either nouns or verbs. The terms can refer to the image used in the process of
protecting or excluding a section of an image, or they may refer to the process
itself. Consequently, we may ‘‘matte out’’ a section of the foreground so that the
background is revealed, or we may ‘‘mask off’’ the bottom third of an image
when we color correct it so that the correction doesn’t affect that area.
Mattes are generally considered to be single-channel, grayscale images. There
is no need for three separate channels, as there is when specifying color, since
the transparency for any given pixel can be described by a single numerical value
in the range of 0 to 1. Many systems and file formats support single-channel
images, whereas others will simply place a copy of the same information into all
three channels of an RGB image. While this method is redundant (and wastes
disk space), it does sometimes provide a simpler model for both the user and the
programmer.
1
Ideally, the compositing system will store a single-channel matte
1
Matte images tend to contain large areas of identical pixels, usually black or white, and as such
will compress dramatically using one of the better lossless compression schemes. Consequently, there