Premultiply and Unpremultiply Nodes
The Premultiply and Unpremultiply nodes each take a single RGBA input. For every pixel in the input image, the Premultiply node multiplies the value of each color component (the RGB channels) by the corresponding alpha channel value. The Unpremultiply node, on the other hand, attempts to restore the RGB channels of a premultiplied RGBA image to their original, non-premultiplied values.
Premultiplication is an integral step in the digital compositing process, as it transfers the transparency level represented by the alpha channel to the RGB components themselves before the RGB channels of two separate images are blended in a compositing operation. In general, computer-generated imagery is premultiplied, while digitized film footage is not.
When to Use the Premultiply Node
It is not necessary to use the Premultiply node to composite imagery in Chalice. Composite nodes such as Mcomp, Atop, Inside, Outside, and Over will premultiply the input images for you, unless you specify in the composite node that the image has already been premultiplied.
However, the Premultiply node can be used, if desired, to premultiply imagery that will not be subject to a composite operation, as when Chalice is used strictly for color correction.
How Premultiply Works
The Premultiply operation is automatic and does not require user modification; therefore the node panel features a standard Chalice Info tab only.
The Premultiply node performs the following computation, where A represents the input image; and r, g ,b, and a represent the red, green, blue, and alpha channels of the image:
- Argb * Aa
The multiplication in this formula is fractional, and for floating point images, the alpha channel value is assumed to be in the range of 0-1.
For 8-bit and 16-bit images, however, the alpha channel value (Aa) is converted into a fraction first by dividing it by an appropriate value: for 8-bit, the alpha is divided by 255; for 16-bit, by 65535.
Restoring Non-premultiplied RGB Channel Values
The Unpremultiply node attempts to restore the original, non-premultiplied RGB values of a premultiplied RGBA image. The accuracy of this operation varies, however, depending on the alpha channel values in the image. If the alpha channel value of a pixel is zero, you lose all information that would allow you to accurately reconstruct the original value of each color component.
Computer generated imagery, such as the output from a 3D rendering program, is almost invariably premultiplied. However, you may want to manipulate the alpha channel data to adjust the matte characteristics before compositing the image over a background. If the image is already premultiplied, the pixel values can become skewed.
For example, in a non-premultiplied image, a full red pixel with half alpha coverage would be represented as [1, 0, 0, .5]. After premultiplication, the same pixel would be represented as [.5, 0, 0, .5]. Assume that you adjust the matte such that the alpha channel value for this pixel changes from .5 to .75.
If this matte adjustment occurred after the pixel had been premultiplied, the value would become [.5, 0, 0, .75], whereas if the adjustment occurred before premultiplying, the pixel value would become [.75, 0, 0, .75]. These two values would generate a different result for the same pixel in a comp. Therefore, you may choose to run the image through an Unpremultiply node before adjusting the matte.
How Unpremultiply Works
The Unpremultiply operation is automatic and does not require user modification; therefore the node panel features a standard Chalice Info tab only.
The Unpremultiply node performs the following computation, where A represents the input image; and r, g ,b, and a represent the red, green, blue, and alpha channels of the image:
- Argb * Q
Q represents the alpha channel value, modified as follows (assuming floating point):
- Q = Aa == 0 then 1.0 else 1.0/Aa
(For 8-bit and 16-bit images, the alpha channel value (Aa) is converted into a fraction first by dividing it by an appropriate value: for 8-bit, the alpha is divided by 255; for 16-bit, by 65535.)
Table of Contents | Index
Copyright 1996-1999 by Silicon Grail Corporation