58 The Art and Science of Digital Compositing
perspective effects, whereby foreshortening causes the bottom of the image to be
compressed and the top of the image to be enlarged.
Even if your compositing system doesn’t support the concept of perspective
transformations, it may support something known as ‘‘corner-pinning,’’ in which
the user can manually reposition the four corners of an image to create any
arbitrary tetrahedron. The end visual result should be similar.
5
In general, most
3D transformations can be emulated using 2D transforms.
Warping
An even more sophisticated method of distorting an image is known as warping.
Conceptually, it is easiest to think of warping as if your image were printed on
a thin sheet of flexible rubber. This rubber sheet can be pushed and pulled by
various amounts in various areas until the desired result is obtained. Image
warping is usually controlled by either a grid mesh or a series of splines. (Spline-
based systems ultimately create a grid as well—they just do a better job of hiding
it from the user.)
Although warping is a powerful tool for manipulating images to obtain effects
that would otherwise be impossible, for illustrative purposes we will use it for a
slightly less serious result. Consider Figure 3.24a, which shows our sample image
with a grid laid over the top. In order to control the warping of this image, we
will manipulate this grid; the corresponding warp will be applied to the image.
Thus, if we stretch our grid as shown in the right half of Figure 3.24b, the resulting
warped image would be similar to that shown in Figure 3.24c. Later, in Chapter
15, we will also touch on the technique of morphing, a sophisticated combination
of warping and dissolving between two images over a period of time.
Expression Language
Just as we saw with the color-correction tools, the ideal compositing system will
allow you to resort to mathematical expressions to define warping parameters.
The syntax will follow the same format as we defined for our color-correction
example, only now we will be dealing with X and Y transformations. The degener-
ate case, in which we are merely mimicking something simple like an X translation,
could be represented as
X ⳱ X Ⳮ 30
5
The primary difference is that the perspective may not be exactly the same. A good 3D transform
will let you choose a true 3D position, which will in turn affect the resulting perspective of the image.