Eyeon:Manual/Tool Reference/Composite/Merge

From VFXPedia

< Eyeon:Manual | Tool Reference | Composite
Revision as of 18:41, 20 September 2006 by Izyk (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Composite Tools

Tool Reference

Dissolve

Merge

The Merge Tool combines two images based on the alpha (opacity) channel associated with the one in front. This tool takes two inputs; a background and a foreground image. The operation mode of the merge determines what method is used to combine the images.

Instead of providing the artist with a dozen tools for each different method used to combine images, Fusion uses a single merge tool that supports the standard over, in, held out, atop and xor methods for compositing images, as well as many common blending modes like screen, dissolve, multiply and overlay.

The merge tool can handle both additive (premultiplied) and subtractive (non-premultiplied) compositing. Use merge to blend between the additive and subtractive results, providing solutions for some otherwise tricky problems.

This tool can also be used to composite images based on information from the Z-buffer channel of the images, if available. Rather than relying on the foreground and background order to determine layer order, Z-merging compares the depth value of each pixel to determine which is the foreground pixel and which is the background pixel.

Merge Tab

Center X And Y

This control determines the position of the foreground image in the composite. The default is 0.5, 0.5, which centers the foreground image in the exact center of the background image. The value shown is always the actual position in normalized coordinates, multiplied by the reference size. See below for a description of the reference size controls.

Size

Use this control to increase or decrease the size of the foreground image before it is composited over the background. The range of values for this slider is 0.0 to 5.0, but any value greater than 0 can be entered manually. A size of 1.0 gives a pixel-for-pixel composition, where a single pixel in the foreground is the same size as a single pixel in the background.

Angle

Use this control to rotate the foreground image before it is combined with the background.

Apply Mode

The Apply Mode determines the math used when blending or combining the foreground and background pixels.

Normal
The default merge mode uses the foreground's alpha channel as a mask to determine which pixels are transparent and which are not. When this is active, another menu shows possible operations, including over, in, held out, atop and xor.
Screen
Screen merges the images based on a multiplication of their color values. The alpha channel is ignored and layer order becomes irrelevant. The resulting color is always lighter. Screening with black leaves the color unchanged, whereas screening with white will always produce white. This effect creates a similar look to projecting several film frames onto the same surface.
Dissolve
Dissolve mixes two image sequences together. It uses a calculated average of the two images to perform the mixture.
Multiply
Multiply the values of a color channel. This will give the appearance of darkening the image as the values are scaled from 0 to 1. White has a value of one so the result would be the same. Grey has a value of 0.5 so the result would be a darker image or, in other words, an image half as bright.
Overlay
Overlay multiplies or screens the color values of the foreground image, depending on the color values of the background image. Patterns or colors overlay the existing pixels while preserving the highlights and shadows of the color values of the background image. The background image is not replaced but is mixed with the foreground image to reflect the original lightness or darkness of the background image.
Soft Light
Soft Light darkens or lightens the foreground image, depending on the color values of the background image. The effect is similar to shining a diffused spotlight on the image.
Hard Light
Hard Light multiplies or screens the color values of the foreground image, depending on the color values of the background image. The effect is similar to shining a harsh spotlight on the image.
Color Dodge
Color Dodge uses the foreground's color values to brighten the background image. This is similar to the photographical practice of "dodging" by reducing the exposure of an area of a print.
Color Burn
Color Burn uses the foreground's color values to darken the background image. This is similar to the photographical practice of "burning" by increasing the exposure of an area of a print.
Darken
Darken looks at the color information in each channel and selects the background or foreground images' color value, whichever is darker as the result color. Pixels lighter than the merged colors are replaced and pixels darker than the merged color do not change.
Lighten
Lighten looks at the color information in each channel and selects the background image's or foreground image's color values, whichever is lighter as the result color value. Pixels darker than the merged color are replaced and pixels lighter than the merged color do not change.
Difference
Difference looks at the color information in each channel and subtracts the foreground color values from the background color values or the background from the foreground, depending on which has the greater brightness value. Merging with white inverts the color. Merging with black produces no change.
Exclusion
Exclusion creates an effect similar to but lower in contrast than the difference mode. Merging with white inverts the base color values. Merging with black produces no change.
Hue
Hue creates a result color with the luminance and saturation of the background color values and the hue of the foreground color values.
Saturation
Saturation creates a result color with the luminance and hue of the base color and the saturation of the blend color.
Color
Color creates a result color with the luminance of the background color value and the hue and saturation of the foreground. This preserves the gray levels in the image and is useful for coloring monochrome images.
Luminosity
Luminosity creates a result color with the hue and saturation of the background color values and the luminance of the foreground color values. This mode creates an inverse effect from that of the color mode.


Operator Mode

This menu is used to select the operation mode of the merge. Changing the Operation Mode changes how the foreground and background are combined to produce a result. The menu will only be visible when the merge tool's Apply mode is set to Normal.

This is a new feature to Fusion 5. Previous versions of Fusion would always use the Over operation.

For an excellent description of the math underlying the operation modes, read Compositing Digital Images, Porter, T., and T. Duff, SIGGRAPH 84 proceedings, pages 253-259. Essentially, the math is as described below. Note that some modes not listed in the Operator dropdown (under, in, held in, below) are easily obtained by swapping the foreground and background inputs (with Ctrl+W) and choosing a corresponding mode.

The formula used to combine pixels in the merge is always fg * x + bg * y. The different operations determine exactly what x and y are, as shown in the description for each mode.

Over
The Over mode adds the FG layer to the BG layer by replacing the pixels in the BG with the pixels from the Z wherever the FG's alpha channel is greater than 1.
x = 1, y = 1-[foreground alpha]
In
The In mode multiplies the alpha channel of the BG input against the pixels in the FG. The color channels of the FG input are ignored. Only pixels from the FG are seen in the final output. This essentially clips the FG using the mask from the BG.
x = [background alpha], y = 0
Held Out
Held Out is essentially the opposite of the In operation. The pixels in the FG image are multiplied against the inverted alpha channel of the BG image. Accomplish exactly the same result using the In operation and a Matte Control tool to invert the matte channel of the BG image.
x = 1-[background alpha], y = 0
ATop
ATop places the FG over the BG only where the BG has a matte.
x = [background alpha], y = 1-[foreground alpha]
XOr
XOr combines the FG with the BG wherever either the FG or the BG have a matte, but never where both have a matte.
x = 1-[background alpha], y = 1-[foreground alpha]
Subtractive And Additive

This slider controls whether Fusion performs an "Additive" or a "Subtractive" merge. An additive merge assumes that the foreground image is pre-multiplied, meaning that the pixels in the color channels have been multiplied by the pixels in the alpha channel. The result is that transparent pixels are always black, since any number multiplied by 0 is always going to be 0.

When the merge tool can assume the image is pre-multiplied, it can perform an additive merge. This "obscures" the background (by multiplying with the inverse of the foreground alpha), then simply adds the pixels from the foreground.

If the images are not pre-multiplied then usually all that is required is a subtractive merge. This method is similar to additive, but the foreground image is first multiplied by its own alpha, to eliminate any background pixels outside the alpha area.

Fusion defaults to Additive merging for most operations, assuming that the images are pre-multiplied. Using Subtractive merging on a pre-multiplied image may result in darker edges, whereas using Additive merging with a non-premultiplied image will cause any non-black area outside the foreground's alpha to be added to the result.

Although the Additive/Subtractive option could easily have been a checkbox to select one mode or another, Fusion allows for blending between the additive and subtractive modes, an operation that can occasionally be useful for dealing with problem images.

Alpha Gain

Alpha Gain linearly scales the values of the foreground's alpha channel. In subtractive merges, this controls the density of the composite, similarly to Blend. In additive merges, this effectively reduces the amount that the background is "obscured" by, thus brightening the overall result. In an additive merge with Alpha Gain set to 0.0, the foreground pixels are simply added to the background.

Burn In

The Burn In control adjusts the amount of alpha used to darken the background, without affecting the amount of foreground added in. At 0.0, the merge behaves like a straight alpha blend, whereas at 1.0, the foreground is effectively added onto the background (after alpha multiplication if in Subtractive mode).

This gives the effect of the foreground image brightening the background image, as with Alpha Gain. In fact, for additive merges, increasing the Burn In gives an identical result to decreasing Alpha Gain.

Blend

This is a cloned instance of the Blend slider in the common controls tab. Changes made to this control are simultaneously made to the one in the common controls.

The Blend slider mixes the result of the tool with its input, blending back the effect at any value less than 1.0. In this case it will blend the background with the merged result.

Invert Transform

Select the Invert Transform control to invert any position, rotation or scaling transformation. This option is useful when connecting the merge to the position of a tracker for the purpose of match moving.

Flatten Transform

The Flatten Transform option prevents this tool from concatenating its transformation with subsequent tools. The tool may still concatenate transforms from its input but it will not concatenate its transformation with the tool at its output. See the Transformations chapter earlier in this manual for details on concatenated transformation.

Reference Size

The controls under the Reference Size reveal do not directly affect the image. Instead they allow you to control how Fusion represents the position of the merge tool's center.

Normally, coordinates are represented as values between 0 and 1, where 1 is a distance equal to the full width or height of the image. This allows for resolution independence, because the size of the image can be changed without having to change the value of the center.

One disadvantage to this approach is that it complicates making pixel accurate adjustments to an image. To demonstrate, imagine an image that is 100 x 100 pixels in size. To move the center of the foreground element to the right by 5 pixels, we would change the X value of the merge center from 0.5, 0.5 to 0.55, 0.5. We know the change must be 0.05 because 5/100 = 0.05.

If you specify the dimensions of the background image in the Reference Size controls, this changes the way the Center control values are displayed so that it shows the actual pixel positions in its X and Y fields.

Extending the example, set the width and height to 100 each and the center will now be shown as 50, 50, and we would move it 5 pixels toward the right by entering 55, 50.

Internally, the merge tool still stores this value as a number between 0 to 1 and, if the center control's value were to be queried via scripting or the center control were to be published for use by other tools, the original normalized value would be retrieved. The change is only visible in the value shown for merge center in the tool control.

Use Frame Format Settings

Select this to force the merge to use the compositions current frame format settings to set the reference width and reference height values.

Width And Height

Set these sliders to the width and height of the image to change the way that Fusion displays the values of the merge tools center control.

Channels Tab

Perform Depth Merge

When checked, the Z-buffer channel of both images will be used to determine the composite order. Alpha channels are still used for transparency, but the values of the Z-buffer channel will determine the ordering of image elements. If a Z-buffer channel is not available for either image, the setting of this checkbox will be ignored, and no depth compositing will take place.

Depth merging is on by default. If an image has an associated Z-buffer channel, and that channel is not to be used to perform a depth merge, turn this checkbox off.

Foreground Z-Offset

This slider sets an offset applied to the foreground image's Z value. Click the Pick button to pick a value from a displayed image's Z-channel, or enter a value using the slider or input boxes. Raising the value causes the foreground image's Z-buffer to be offset further away along the Z-axis, whereas lowering the value causes the foreground to move closer.

Subtractive And Additive

When Z-compositing, it is possible for image pixels from the background to be composited in the foreground of the output because the Z-buffer for that pixel is closer than the Z of the foreground pixel. This slider controls whether these pixels are merged in an additive or a subtractive mode, in exactly the same way as the comparable slider in the Merge tab.

When merged over a background of a different color, the original background will still be visible in the semi-transparent areas. An additive merge will maintain the transparencies of the image but will add their values to the background.



Tips for Merge (edit)

EyeonTips:Manual/Tool Reference/Composite/Merge



The contents of this page are copyright by eyeon Software.