Keying: Correction Tools

Now that you have generated your matte, the Correction Tools will allow you to tweak it to achieve a superior composite. These tools perform most of the same functions as the Fine Tuning tools, but they do so with a greater degree of automation. Whether to use the Correction or Fine Tuning tools largely depends on the particular keying situation you are facing. Once you get the hang of using all of the tools available to you in Primatte Keyer you will know when to use Correction and when to use Fine Tuning. Generally speaking, these controls should be used before attempting a Fine Tuning operation, but this is not a requirement. There are four main components to the Correction tools.

Spill Sponge

The Spill Sponge tool is used, as its name suggests, to “sponge away” color spill from the foreground area. Unlike the Spill control in the Fine Tuning tool, the Spill Sponge does not have any sliders or other controls. When removing spill from your foreground objects it is a good idea to try using the Spill Sponge first, then follow up with a Fine Tuning operation if necessary. Sample areas of spill with the Spill Sponge and they disappear like magic. In the example below, the woman's cheek has some blue spill. Sample through it using the Spill Sponge...

...and the spill disappears.

If you happen to sample too much of a non-spill area your image will take on a magenta or yellow tint. In this case simply undo the sample stroke and try again using the Spill Minus tool which gives you more control over the spill removal.

Matte Sponge

The Matte Sponge is used after the keying operation is mostly completed and some transparent pixels have appeared in the foreground area; these pixels can be seen in the matte as gray areas in the 100% foreground region. With the Matte Sponge selected and the Matte view visible, click on the unwanted gray or black pixels and they will become white (100% foreground) while still retaining the spill suppression information for that color region.

This same operation can be achieved manually by using the Fine Tuning tools. Sample the offending pixels and move the Transparency slider to a lower value.

Restore Detail

The Restore Detail tool allows you to bring back detail in areas that have been fully keyed out by the sampling process. Black background pixels (100% transparent) sampled in the image window become translucent. This operation is useful for restoring lost detail in semitransparent objects like hair, clothing, or smoke. In the image below we see a key of some smoke. Notice that much of the edge detail and the “fullness” of the center of the smoke column has been keyed out.

Sampling some of these transparent edge pixels brings them back into visibility (see image below), greatly improving the overall detail and realism of the keyed smoke element.

This same operation can be achieved manually by using the Fine Tuning tools. Sample the offending pixels and move the Detail slider to a higher value.

FG Opacity

The FG Opacity tool is used to make opaque foreground areas slightly less opaque. This tool is useful for the subtle tuning of foreground objects which are otherwise entirely obscured with smoke, clouds, or other wispy or semitransparent items.

Defocus Matte

The Defocus Matte slider determines the defocusing level being applied to the matte. It blurs the matte in both the inward and outward direction and is useful when you end up with a “hard edged” foreground object and results in softer, cleaner edges on the foreground objects. When using this tool, some noise may appear around the edges of the foreground object. To avoid this problem, enable the Inward Defocus checkbox (see below).

The image below shows the original matte...

The image below shows the same matte with a 15 pixel defocus applied. (You will probably never need to use a defocus value this high. Try using values between 0.5 and 3.0 to begin with.)

Note that w hen using this feature, foreground details and smoothness of motion blur may be adversely affected.

Inward Defocus

The Inward Defocus checkbox works in conjunction with the Defocus control. When this is not enabled, the blur will be applied in both the inward and outward directions from the edge of the foreground object as in the large image above. This can sometimes cause a 'halo of light' to appear around the foreground objects. When this checkbox is enabled, the defocus operation will start at the outside matte edge and blur only in an inwards direction and eliminates that 'halo' artifact.

The image below shows the original matte...

...and the image below shows the same matte with a 15 pixel Inward Defocus applied.

Shrink Matte Slider

The Shrink Matte Slider allows you to choke in the foreground areas of the matte by lowering the brightness levels of the pixels that make up the matte edge. You can use this control to get rid of unwanted edge artifacts on troublesome images.

The Shrink Matte function is a gamma correction. The Shrink Matte slider ranges in value from 0 to 99. A value of 99 translates into a reduction of 50% in the gray levels. Why 50%? Because unlike the input gamma value in the AE Levels filter, which defaults to the middle and allows you to push values towards either white or black, the Shrink Matte function starts in the middle but only permits values to be pushed to black.

Let’s put it in more simple terms. When using the Shrink Matte filter, pixels that are 100% black will stay black and pixels that are 100% white will stay white. This correction affects only those pixels that range somewhere in between pure black and pure white. The more you increase the value of the slider, the more those pixels will be pushed towards black. The pixels that were originally closer to black will become black first as the slider value increases.

Consider the image below...

The image above shows a keyed matte with a large degree of semi-transparent detail. The darkest, most transparent pixels are in the wispy strands of hair poking out to the left. The image below shows the matte with the Shrink Matte slider set at 10, which equals a 5% reduction in the luminance values of the edge pixels.

Note that the darkest pixels have been pushed towards black while the brighter pixels have been left unchanged. The image below shows the same matte with the Shrink Matte slider set to 40.

And this image (below) shows the same matte with the Shrink Matte slider set to 99. At 99 all pixels which were not 100% white to begin with have been pushed to black, creating a solid, hard-edge. Obviously you will almost never need to shrink the matte to this severe an amount.

Decreasing the brightness levels will decrease the perceived transition between the foreground and background, and can make the matte edge rough. If this happens you can use Defocus Matte to soften the matte and lessen the effect of the harsh edges.

Edge Color Replace

The Edge Color Replace function does just what its name states; it enables you to re-color just the edges of the foreground area.

When selected, the pop-up menu gives you three color replacement options.

Complement is the default spill replacement mode and uses the complement of the backing screen color to replace the spill. Essentially Primatte finds the matte edge, then uses the color of the corresponding pixels in the background element. This spill replacement mode is best used when maximum detail must be retained (see image below).

Solid allows the user to select a solid color to be used in replacing spill. It is useful when the foreground object is white and replacing spill with the complement color of the backing screen introduces strange colors or artifacting (see images below)...

The Solid mode works in conjunction with the Replacement Color Selector (see below). The default replacement color is a 50% gray value (R:128 G:128 B:128). By using a gray replacement shade, we get the results seen below..

Replacement Color Selector

To change the solid color replacement color, the user must click on the color tile and select a color value, or select a color with the eyedropper. This mode is problematic if the foreground object has multiple colors. For those instances, try the Defocus mode.

Defocus uses a defocused copy of the background image to determine the spill replacement colors. Replacement colors are selected from an area on the blurred background image that corresponds to the selected area on the foreground image. This mode works well on diffuse transparent objects like glass. For a translucent candelabra in the images below, you can see the results using the Complement and Color replacement methods and the more natural results you would get using the Defocus method...

Grain Tools

The Grain Tools are used when a foreground image is highly compromised by film grain. As a result of the grain, when backing screen noise is completely removed, the edges of the foreground object often become harsh and jagged leading to a poor key. These tools were created to, hopefully, help when a compositing artist is faced with a grainy image.

Grain Type

The Grain Type selector gives the user a range of grain removal from Small to Large. The use of this tool is explained further along in this section.

• None - When None is selected, the user gets the color of the exact pixel sampled.

• Small - When Small is selected, the user gets the average color of a small region of the area around the sampled pixel. This should be used when the grain is very dense.

• Medium - When Medium is selected, the user gets the average color of a medium-sized region of the area around the sampled pixel. This should be used when the grain is less dense.

• Large - When Large is selected, the user gets the average color of a larger region of the area around the sampled pixel. This should be used when the grain is very loose.

Grain Value Slider

The Grain Value Slider adjusts the effect of the Clean BG tool without changing the edge of the foreground object.

Grain Tools Tutorial

Here is a short tutorial on using the Grain Tools. If you have a noisy image as in the example below...

...you will find that the matte is also noisy:

Currently you can use the Clean B G sampling mode to remove the noisy pixels, but this can also modify the edge of the foreground object in a negative manner.

Using the Grain Tools in the following way may help you clean up the image and still get a good edge on the matte:

1. Use the Clean BG sampling mode just a small amount to remove some of the white noise in the Matte View but do use it so much that you affect to the edge of the foreground object.

2. Then select the Grain Type tool and select Small as a first step to reduce the grain:

With the Grain Value Slider slider set at 0, move it around some. This should increase the affect of the Clean BG tool without changing the edge of the foreground object.

Sometimes this may not be enough to totally remove the grain so by adjusting the Grain Value Slider , you can tell the Primatte algorithm what brightness of pixels you think is grain. You should try not to use too high of a value otherwise it will affect the overall matte. For an example of an 'over adjusted' image see below...

The Primatte grain algorithm uses a 'Defocused Foreground' image to compute the noise. So the Grain Value slider is changing the amount of defocus applied to the 'Defocused Foreground' which will look something like this...

NOTE: The Small, Medium and Large settings for the Grain Tools all produce defocused foregrounds that have larger blurs respectively.

NOTE: It is important to make sure that the crop settings are correctly applied otherwise when the defocus image is generated, if there is 'garbage' on the edges of the images, then that garbage will be blurred into the defocus foreground.

As a review:

1. Select the Select BG sampling mode and click on a backing screen color.

2. Select the Clean BG sampling mode and use it sparingly so that it has minimum affect to the edge of the foreground object.

3. If there is still grain in the backing screen area, then use the Grain Type functionality starting at the Small setting to reduce the grain

4. If the grain is still present, then try increasing the Grain Value Slider a little - not too much.

5. If grain is still a problem then try changing the Grain Size to Medium or Large and also changing the grain tolerance until the desired effect is achieved.

NOTE: The grain functionality does not always remove grain perfectly but is sometimes useful to minimize its effects.