36 The Art and Science of Digital Compositing
multiple-step compositing script. Chapter 11 provides more information on this
topic.
Single-source image processing operations can be broken down into three basic
categories: color manipulations, spatial filtering, and geometric transformations.
Our example, the brightness operation, would be considered a color manipulation,
and we will discuss this category first.
COLOR MANIPULATIONS
As mentioned, we consider the brightness operation that we’ve just covered to
be a color manipulation. While the layperson might not consider an apparent
brightness change to be a shift in color, we’ll see that it is really just a simplified
case of an operation that will produce a visible color change. Thus, in the image
processing and digital compositing world, operations that affect brightness and
contrast are all classified as color-correction tools. Brightness is a specialized
version of a more general tool, called simply the ‘‘Multiply’’ operator.
RGB Multiply
The brightness example had us multiply every pixel by a constant value to produce
a new result. But if you recall from the last chapter, we often find it useful to
work with digital images as a group of channels instead of whole pixels. If this
is the case, we can actually apply a multiplication to each component of the pixel
separately, and not necessarily equally. Thus, instead of multiplying each channel
by 2.0 to create an overall brightness shift, we could apply a multiplier of 0.1 to
the red channel, a multiplier of 1.25 to the green channel, and leave the blue
channel unmodified (i.e., multiply it by 1.0). The result of such a procedure is
shown in Plate 8. As you can tell, we’ve dropped the amount of red in the image
significantly and boosted the green a bit, producing an image that is much more
greenish blue than the original. The graph of the equivalent function is shown in
Figure 3.3.
Most of the color-correction operators that we discuss can be applied either to
all the channels of an image equally or to individual channels in varying amounts.
When applied equally, the result will tend to be an overall brightness or contrast
modification. When different amounts are applied to different channels, a visual
color shift will usually take place as well. For the most part, our examples show
the operators as they apply to the image as a whole, but you should assume that
they can also be limited to individual channels as well.
Add
Instead of affecting the apparent brightness of an image by multiplying, we can
instead add (or subtract) a constant value from each pixel. Consider the situation