Basic Image Compositing 75
If we premultiply our foreground image (Plate 26a) by its matte (26b), the result
is shown in Plate 26c. Now, if this result is placed over the background in a system
that assumes that the images you are providing are all premultiplied, the proper
result is obtained, as shown in Plate 28. The soft edges blend well with the
background and there are no noticeable artifacts.
However, if we combine Plate 26a with Plate 27 without premultiplying the
color channels, we have an image that will not be handled properly if our Over
operator is expecting a premultiplied image. The result of placing such an image
over the background is shown in Plate 29. Note that the foreground element, in
areas where its matte is supposed to be 0, is still contributing to the result. If you
were to check out the math of what is happening, you’d see that in those areas
of the result image, it is exactly as if we had simply added the two images together.
Equally damaging problems can occur in the other direction, that is, if we feed
premultiplied images to a system that is expecting to combine the image with
the matte itself. Such a system will automatically multiply the image by its matte
channel, even though this has already been done in a normal premultiplied image.
In this situation, we have effectively multiplied the image by its matte channel
twice, thereby darkening all areas of soft-edged matte. The result of such a mistake
is seen as a dark halo around the foreground, as shown in Plate 30.
Although the preceding examples resulted in some very obvious problems, an
improper image/matte relationship can be the cause of some very subtle artifacts
as well. Such artifacts can show up even if we have properly synchronized our
image types with what the operators are expecting. One of the more common
places these will occur is when we are trying to color correct images that have
already been premultiplied.
Color-Correcting and Combining Premultiplied Images
Whenever we premultiply an image by a matte, there is a very specific brightness
relationship between the pixels in the color channels and the pixels in the matte.
Systems that assume you are working with premultiplied images will rely on this
image/matte relationship; consequently, the brightness of any color channel can
no longer be modified without taking the alpha channel into account (and vice
versa). Thus, any time you apply a color correction to a premultiplied image, you
run the risk of producing a new image whose matte/image relationship is no
longer ‘‘legal.’’ If you look at the math that is used when we premultiply an image
by a matte, it should be obvious that the brightness of any given red, green, or
blue channel in such an image can never exceed the value of the alpha channel.
This can sometimes be used as an indicator that there has been some kind of
operation performed on the image after the premultiply occurred. The result of
compositing with this image will vary, depending on the extent of the change