100 The Art and Science of Digital Compositing
they change, or animate, over time. This raises the question of what the best way
to animate these parameters would be. Obviously it could be quite painful to
manually specify a different value for a particular effect on every frame of our
sequence. Fortunately, there is a better way—a way that makes the job of animating
values over time a relatively painless task. This technique is known as keyframing.
Keyframing is a process in which, instead of explicitly defining a value for every
frame of the sequence, the artist chooses certain ‘‘key’’ frames, assigns values to
those frames, and then allows the computer to interpolate the values for the
remaining frames. Interpolation is the process of using certain rules or formulas
to derive new data based on a set of existing data. With keyframe animation, we
are deriving values that fall between the existing keys that we have chosen and
that will appear to make smooth transitions as we move through time.
Most books on computer animation techniques will give a great amount of
detail about the process of using keyframe animation, but for the purposes of our
discussion we will work with a simple example that explains the basic concepts.
We’ll look at how we might use keyframe animation to vary the brightness of an
element in order to properly integrate it into a scene. Consider the case of an
actor shot on bluescreen who is walking toward the camera. Let’s assume that
we’ve already done a wonderful job of pulling a matte for the actor, using some
of the techniques discussed in Chapter 5. Now all we need to do is color balance
him to the background plate in which he’s supposed to appear. The only slight
difficulty is that the plate dictates that he is walking from the far end of a shadowy
corridor into a well-lit room. The bluescreen element was shot with constant
lighting, so obviously we’ll need to deal with animating the brightness of the
character as he walks toward the camera. (Note: Animating the brightness of an
element to simulate a change in lighting is common, but not ideal. A better
composite would result had the element actually been shot correctly, with lighting
that mimicked the background plate.)
Using basic keyframing techniques, we’ll start with determining a proper
brightness for the character at the first and last frames. At frame 1, we determine
that applying a brightness of 0.4 to the foreground produces a pleasing, visually
integrated result. At frame 300 (after he has completely entered the well-lit room),
we decide that a brightness of 1.1 is most appropriate. By default, our software
will probably linearly interpolate these two values to determine values for the
intermediate frames. (There are a number of different ways to interpolate data
between control points. We’ll look at another in just a moment.) Figure 6.2 shows
a graph of the linear interpolation between our keyframes. As you can see from
the graph, at frame 150 (halfway through the sequence), the software has chosen
a value of 0.75 (halfway between 0.4 and 1.1). Unfortunately, when we go look at
frame 150, we notice that the actor has still not entered the room and consequently
appears to be too bright for the scene. On closer examination, we realize that the