The Composite nodes enable you to combine two or more image sequences in a variety of ways.
The most versatile and commonly used composite node is Multi-comp. The Multi-comp node is the "Swiss army knife" of composite nodes. You can composite an unlimited number of image layers in one node, using the operator you specify for each layer of the comp--over, multiply, screen, and so on. The section on Choosing a Composite Operator includes a comparison chart of all the Multi-comp composite operators. In addition, each layer can be transformed individually to position it in the context of the entire composite.
The other multi-input node, Z-comp, is used instead of Multi-comp when the image layers to be composited include z-depth channel data.
You can't beat the convenience and flexibility of using Multi-comp for multilayer composites. For a simple two-layer composite, however, you also have the option of using a binary (two-input) composite node.
The Over, Under, Atop, Inside, and Outside nodes composite two image inputs based on the alpha coverage, as specified in each node description.
The Add, Subtract, Multiply, and Difference nodes, on the other hand, composite two images without regard to alpha coverage; in fact, the inputs to these nodes need not include alpha channels.
The Dissolve node performs a dissolve between two inputs, while the MinMax node compares two inputs and uses the minimum or maximum value in the output, as you specify.
Ultimate AE is designed to composite an Ultimatte foreground image over a background while controlling various edge characteristics.
You can composite input images that differ in spatial resolution, frame range, and bit depth, and RAYZ will use the following criteria to determine the output:
The bit depth of the output is determined by the input with the highest bit depth. (The only exception would be the Ultimatte AE node, assuming that the optional garbage matte input is connected, as the bit depth of the garbage matte is irrelevant.) RAYZ actually converts all of the inputs to floating point, or fractional, values internally to perform the node operations (see Composite Formulas). Then the result is converted back to 8- or 16-bit integer for output as needed to match the input data.
The frame size of the output is determined by the bottom input to the Over, Atop, Inside, Outside, and Ultimatte AE nodes, based on the assumption that the bottom input is the background image. For the same reason, the top input determines the output size for Multi-comp, Z-comp and Under. The top input also controls the output of the remaining composite nodes: Add, Difference, Dissolve, MinMax, Multiply, and Subtract.
The frame range of the output is determined by the same input that controls output size (see previous paragraph). This means that you will only generate an error if you navigate outside the range of the controlling input. If you navigate to a frame at which the other input is out of range, the composite node will use the controlling input image for the output. In the case of the multilayer composite nodes, Multi-comp and Z-comp, the node ignores any input layer that does not have image data at the current frame and comps the rest of the inputs.
In the descriptions of the various composite nodes, we resort to the following notation for composite formulas. "A" denotes the A image, the top layer, or foreground (the top input to a binary composite node); and "B" denotes the B image, the bottom layer, or background image. The lowercase letters r, g, b, and a represent the red, green, blue, and alpha channels. For example, "Aa" would refer to the alpha channel of the A image.
All multiplication in these formulas is fractional; that is, at floating point precision. For 8-bit and 16-bit per channel images, this means that the pixel values of each channel are converted into decimal fractions. For example, a 16-bit pixel with RGB values of [65535, 52428, 0] would be converted to [1.0, 0.8, 0].
The alpha channel contains the opacity information for each pixel of the RGB channels it accompanies. In RAYZ, a value of 0 represents total transparency (no coverage) while a value of 1 represents complete opacity (full coverage). The alpha channel is displayed in the Image Viewer as a monochrome image where white represents a value of 1 and black is 0.
In reference to the composite nodes, the terms alpha channel and matte can be considered synonymous.
The term alpha coverage, as in the phrase "wherever the image has alpha coverage," refers to any pixel in an image where the alpha channel value is greater than zero. The concept of coverage is central to composite operations where the alpha channel value determines the extent to which the RGB channels contribute to the result, such as the over, under, inside, outside, and atop operations.
A premultiplied image is one in which, for every pixel, the value of each color component (RGB) has been premultiplied by the alpha component and stored in the color component. This transfers the opacity 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.
As a general rule, computer-generated images, such as those from a 3D animation package, have been premultiplied while digitized frames of film footage, such as Cineon files, have not.
The premultiplication status of an image is important because premultiplication is an initial step in many compositing operations. An input image to a composite node will always be premultiplied by the node, unless it has already been premultiplied. Normally, a premultiplied image should not be premultiplied again, although it is certainly possible that this could create a desired effect in some cases.
RAYZ also provides nodes in the Conversion menu that are dedicated to the tasks of premultiplication and its reversal: the Premultiply Node in chapter 20 and the Unpremultiply Node in chapter 20. |
RAYZ automatically evaluates each input to determine its status and sets the Premultiply parameter in the Node Panel accordingly. For example, an RGBA image that was imported into the Image In node is assumed to be premultiplied, while an RGB image for which the alpha was generated in a matte node is assumed to be unpremultiplied. One exception is the output from an Ultimatte node, which is premultiplied.
Fig. 18.1 The Over node settings (left) indicate that the node will premultiply the background input but not the foreground. The layer shown in the Multi-comp node example (right) will not be premultiplied.
The Multi-comp node enables you to composite a virtually unlimited number of image layers in one node.
You simply connect imagery from upstream nodes to the input connectors of the Multi-comp node. Each time you connect a new input to the Multi-comp node, another input connector is automatically created, and at the same time, a corresponding layer entry is created for that input in the Multi-comp Node Panel.
Each layer entry provides parameters that control how that layer is composited into the output image, including the type of operation and opacity level to use. You can even transform any layer using numeric or interactive overlay controls.
Each input can be a different size and bit depth. Lower bit depth inputs are promoted to the highest bit depth, and the output of the Multi-comp node will match the highest input bit depth. The output size is determined by the first (background) input.
You can change the order of the existing inputs to a Multi-comp node, and you can also replace one input with a different input image, which will appear in the same layer of the composite as the old image.
To change the order of an input in the composite, drag the layer button with the double-arrow icon up or down in the layer list. See Fig. 18.3.
To replace the input to a layer with a different image, you can disconnect the input where it flows into the node (Ctrl-click on the connector line). This will leave a connector hanging off the node which you can use to connect a different input image.
Fig. 18.2 Ctrl-click connector line (left) to disconnect input (middle) and drag free connector to connect new image (right).
In this way you can replace the input image with another image at the same level in the stack of image layers without having to reorder the layers manually. This also enables you to keep the parameter values set for the old image so that, for example, the replacement image will be transformed in the same way as the old image.
To delete a layer altogether, select the layer and use the Layer Actions menu. (See Copying, Pasting, and Deleting Layers in chapter 7 if you need more information.) This disconnects the corresponding input, deletes the layer entry, and moves the subsequent layers up.
Be aware, however, before you delete the background layer that the background image sets the frame size and range of the output. You may want to disable the background instead of deleting it, or replace it with another input image.
Fig. 18.3 Top-level controls available in the Node Panel for each layer of the composite.
Any layer can be disabled temporarily without disconnecting its input from the node by clicking the checkbox in the top-level controls for the layer entry. When the box is checked, the layer is included in the composite, and when it is not, it is as if the layer did not exist (at least until you turn it back on again).
If you disable the background layer (the top layer in the Node Panel), the layer disappears, in that all pixel values become 0, but the input image to that layer still determines the size and range of the output.
Each successive layer becomes the A image in a composite, with the B image being the result of all the composite operations performed on preceding image layers in turn.
Assume, for example, that you have a five-layer composite in which the first entry in the Node Panel list (which is the bottom image layer in the composite) is layer 1, the next entry is layer 2, and so on to the last entry in the list (the top image layer in the composite), which is 5.
If you select the Over operator for layer 3, layer 3 becomes the A image in an "A over B" composite in which the B image is the result of the whatever type of composite was performed on layers 1 and 2. Then layer 4 is composited as the A image with the result of the A over B composite in layer 3, and so on.
When you create a new Multi-comp node, the Node Panel is blank until you connect an input. A new layer entry is created in the Node Panel for each input you connect to the node.
Each layer can be reordered, temporarily disabled, or deleted using the top-level layer controls, as described previously in Changing Inputs. And each layer can be expanded to access additional parameters: Premultiply, Opacity, Composite, and Transform, as described next.
Fig. 18.4 Multi-comp layer expanded to access layer parameters.
RAYZ automatically sets this parameter based on the nature of the incoming image. This checkbox gives you the ability to override the setting if necessary. See also About Premultiplication.
If the box is checked, RAYZ will premultiply the image; if the box is unchecked, RAYZ will not premultiply it. When an input does not have an alpha channel, the Premultiply parameter is grayed out.
The Opacity parameter enables you to proportionally increase or decrease the opacity of the layer as a whole. The default value of 1 represents no change to the opacity of the input. Values greater than one will increase the opacity where the image is not already fully opaque, while values less than 1 will decrease the opacity where the image is not already fully transparent. For example, a value of 0.5 would reduce the opacity of the layer by 50 percent.
Use the Composite menu to select the type of composite operation to perform on the current layer. The default is the commonly used Over operator, however you can also choose Under, Atop, Inside, Outside, Add, Subtract, Multiply, and Difference, as well as Screen, Overlay, Soft Light, Hard light, Lighten, and Darken.
Some composite operators require an alpha channel and others do not. Be aware, however, that once an RGBA layer is added to the composite, all subsequent layers in the list will also require an alpha.
The following table lists and describes the available composite operations in Multi-comp. "A" refers to the current layer, the layer with the Composite menu you are currently setting, while "B" refers to the layer under it in the composite. The "B" image will itself be a composite of all the previous layers in the Multi-comp node. (See also How Multiple Layers Are Composited.)
The order of the layers affects the result for all of the alpha-centric operators--Over, Under, Atop, Inside, and Outside--as well as for Subtract, Hard Light, Soft Light, and Overlay.
The Screen, Overlay, Hard Light, Soft Light, Lighten, and Darken operators are analogous to blending modes in Gimp or Photoshop. They are frequently used to composite translucent objects such as smoke and fog into a scene (the Screen operator, e.g.) or to accentuate or de-emphasize some aspect of an image--often by layering the same image data over itself or by layering it with a grayscale ramp or similar input.
See also Fig. 18.6 and Fig. 18.7 for examples of the effect various operators have on the same pair of images.
Expand the Transform parameters when you want to adjust the position of an element in the composite. The Multi-comp Transform parameters are identical to those in the Transform node. Refer to the description of the Transform Node in chapter 17 if you need more information about using them.
Fig. 18.5 The interactive Transform overlay for this layer will be active in the Image Viewer.
You can also use the Transform overlay tool in the Viewer to transform the layer interactively, as described in Using the Transform Overlay in chapter 17. To display the overlay, press the Overlay toggle button in the layer button list (the button icon will turn green).
Press the Lock button for any layer to lock the current Transform settings (the padlock icon on the button turns red when locked). This will prevent you from accidentally moving the Transform overlay when it is displayed in the Viewer.
The Z-comp node enables you to use both z-depth and alpha channel information to composite multiple layers of imagery. Z-comp requires two inputs per image layer: an RGBA input and a single-channel z-depth input.
If your images do not contain z-depth data, use the Multi-comp Node to do multilayer composites.
The Z-comp node composites the input layers in a series of over operations, using the values contained in the z-depth channel of each input image to determine, for each pixel, the order in which that pixel will be layered in the composite. You can specify whether larger or smaller z-depth values are nearer to the camera.
A single layer entry is created in the Input List in the Z-comp Node Panel for each pair of inputs (one RGBA input and one z-channel input) you connect to the node.
You can change the order of a layer in the list, to change the corresponding order of the image layers in the composite. The order of the layers in the list is superseded by the z-depth channel values, however, so layer order is only relevant when z-depth values are equal.
Using the top-level layer controls, you can disable a layer temporarily to see what the composite would look like without the contribution of that pair of image inputs, or delete the layer altogether.
You can expand any layer to specify whether the RGBA input should be premultiplied and adjust the overall opacity of the layer.
When checked, the Premultiply parameter specifies that the RGB channels will be premultiplied by the alpha channel. This parameter should only be checked when the input has not already been premultiplied. See also About Premultiplication.
This parameter can be used to proportionally increase or decrease the opacity of the matte as a whole. The alpha channel value of each pixel is multiplied by the value set in the Opacity parameter, which means that the default value of 1 makes no change to the opacity of the input layer.
Set this parameter, which applies to all layers, to match your z-depth data. If larger values in the z-depth channel represent pixels that are closer to the camera, leave the box checked, as it is by default. If smaller values represent pixels that are closer, uncheck the box.
These are binary composite nodes; that is, they take only two inputs each. Both inputs can be RGBA images, however, the alpha channel is only required for the B input, with two exceptions: the Over node, for which the A input requires an alpha channel, and the Atop node, for which both inputs require an alpha channel.
The computations performed by these composite operators will be preceded by a premultiplication step, unless the input is already premultiplied. The checkboxes in the Node Panel indicate whether each input will be premultiplied by the node, and you can change the setting by clicking the box. For more information, refer to About Premultiplication at the beginning of this chapter.
Fig. 18.6 How the Over, Under, Atop, Inside, and Outside nodes composite the same pair of inputs.
The Over node places a foreground image over a background image wherever the A image has alpha coverage, which means that only the A input requires an alpha channel.
The Over node performs the following computation:
The under operation is identical to the over operation, described above, with the inputs reversed (which means that only the background requires an alpha channel):
The Atop node places the A image over the B image wherever the A image has alpha coverage, but only where the A image falls inside the alpha coverage of the B image.
The Atop node accepts two RGBA inputs and performs the following computation:
The Inside node places the A image wherever the A image falls inside the alpha coverage of the B image. However, none of the B image is visible in the result (even where the A image has no alpha coverage). Only the B input requires an alpha channel.
The Inside node performs the following computation:
Effectively, the B image acts as a matte, and the Inside and Outside nodes can be used to create complementary mattes from the same B image. |
The Outside node places the A image wherever the A image falls outside the alpha coverage of the B image. However, none of the B image is visible in the result, even where the A image has no alpha coverage. Only the B input requires an alpha channel.
The Outside node performs the following computation:
These four nodes composite two images based on the RGB values of two input images as specified in the following descriptions. Unlike the nodes discussed in the previous section (Over, Under, Atop, Inside, and Outside Nodes), the composites performed by these nodes are not based on alpha coverage.
Due to the nature of the operations, the two required inputs must have the same number of channels. The order in which the inputs are connected to the nodes (i.e., to the top or bottom input connector) is irrelevant to the node operation, with the exception of the Subtract node, as described below. However, the input order does determine the size of the output image, when the inputs are different sizes: the A (top) input size is always used for the output.
Fig. 18.7 How the Add, Subtract, Multiply, and Difference nodes composite the same pair of inputs.
The Add node adds the values of the A image to the values of the B image:
The Add node results in higher RGB values, creating a lighter composite.
The Subtract node subtracts the values of the B image from the values of the A image:
Subtract darkens the output image most where the B input is brightest.
The Multiply node multiplies the values of the A image by the values of the B image:
Multiply accentuates the dark areas of the composited image, and can be used to emphasize shadows.
The Difference node calculates the difference between the A and B images. The difference is the absolute value of the result of subtracting image B from image A:
This means that Difference has the effect of subtracting the lower pixel value from the higher, whether the higher value is in the A image or the B image. For example:
[0.5, 0.25, 0.75] - [0.5, 0.5, 0.5] = [0.0, 0.25, 0.25]
The Difference node can result in a dramatic, colorful composite that is difficult to predict unless one of the inputs is a grayscale image.
The Dissolve node performs a cross-dissolve from the A image (top input) to the B image (bottom input). The dissolve is calculated by multiplying the A image by the dissolve value (V) and the B image by the inverse of the dissolve value and then adding the results:
In the Dissolve parameter, the value you specify controls the transparency of the A image: a value of 0 represents a complete dissolve to the B image, a value of 0.5 is a 50 percent dissolve, and a value of 1 represents no dissolve from the A image.
The MinMax node combines two inputs by comparing each channel on a pixel-by-pixel basis and selecting which values to use in the output based on the Node Panel settings. For each output channel, you can specify whether to use the lower (MINimum) or higher (MAXimum) values, or the A input or B input values.
The most common use for the MinMax node is to combine two mattes by selecting the maximum alpha channel values of the two inputs. In this case, the RGB channels are all set to one of the two inputs, either A or B.
An entry is created in the MinMax Node Panel for every channel in the inputs. Each entry consists of a row of buttons labeled Input A, Input B, Minimum, and Maximum.
Depress the Input A button to use the channel data of the top input image as the output value for the referenced channel.
Depress the Input B button to use the channel data of the bottom input image as the output value for the referenced channel.
Depress the Minimum button to use the minimum value of the two inputs as the output value for the referenced channel.
Depress the Maximum button to use the maximum value of the two inputs as the output value for the referenced channel.
Use this menu when the inputs to the MinMax node do not have the same number of channels. It specifies whether the output image should have the same number of channels as the input with fewer channels (Minimum Input Channels) or the input with more channels (Maximum Input Channels).
When Maximum Input Channels is selected, as it is by default, and the node tries to compare a channel that is missing in one of the inputs, the existing channel data will be used for the output regardless of the parameter setting for that channel.
Ultimatte AdvantEdge is a composite node optimized for foreground imagery processed with the Ultimatte node. It can correct edge artifacts and matte lines created by a number of factors including lighting problems, unwanted shadows, and detail generator enhancement settings often used on video and telecine equipment.
The AdvantEdge node would replace the composite node used in the sample Ultimatte network illustrated in Overview of the Ultimatte Process in chapter 15.
The AdvantEdge node works by identifying darker areas of the edges of a foreground matte that may represent undesirable edge artifacts. Because you may wish to preserve some of these darker areas while suppressing others, the node offers a wide range of controls to vary the strength, position, and direction of the filtering process that corrects edges of the matte.
The AdvantEdge parameters allow you to specify how the edges of the foreground image will be adjusted in the composite.
These two checkboxes, which are on by default, specify the direction in which the node should search for edge-correction criteria. However, you can turn either parameter off to limit the search direction if you wish. And you can turn both parameters off to see what the composite would like without the edge correction.
The Horizontal parameter specifies that the correction and smoothing operations search horizontally; that is, that the left or right inside edges be searched for edge-correction criteria. This means that Horizontal AdvantEdge will correct edges that run vertically in the image.
The Vertical parameter specifies that the correction and smoothing operations search vertically; which means that the upper or lower inside edges are searched. Vertical AdvantEdge will correct edges that run horizontally.
The Position parameter adjusts the center of the edge identified for correction by moving the edge away from or toward the outside of subject areas. This may help cover problem areas without increasing the overall thickness of the edge correction area.
The Width parameter sets the width, or thickness, of edge correction. Increasing Width control too far may cause detail loss in the edge area.
The Correction parameter sets the strength, or amount, of gray/black suppression in the matte edges. Adjust this control until problem edges disappear. Advancing Correction too far may cause loss of detail within the edge area.
The Smoothing parameter smooths hard or jagged object edges in the direction specified by the Horizontal and Vertical parameters. Smoothing is not often recommended, as it can degrade fine detail.
This parameter, when checked, configures AdvantEdge for interlaced video images that have been s