##
Chroma Key

This effect erases pixels which match the selected color. They are replaced with black if there is no alpha channel and transparency if there is an alpha channel. In this case, you create a matte in the alpha channel, which is not visible to us. The selection of color model is important to determine the behavior (figure 10.31).

Figure 10.31: Chroma Key control window

Chroma key uses either the lightness or the hue to determine what is erased. Use value singles out only the lightness to determine transparency (Luma Key).

Color section

Select a key color to erase using the Color button. Alternatively a color can be picked directly from the output frame by first using the color picker in the compositor window and then selecting the Use color picker button. This sets the chroma key color to the current color picker color.

Be aware that the output of the chroma key is fed back to the compositor, so selecting a color again from the compositor will use the output of the chroma key effect. The chroma key should be disabled when selecting colors with the color picker.

Key parameters section

If the lightness or hue is within a certain threshold it is erased. Increasing the threshold determines the range of colors to be erased. It is not a simple on/off switch; it's a range color. As the color approaches the edge of the threshold, it gradually gets erased if the slope is high or is rapidly erased if the slope is low. The slope as defined here is the number of extra values flanking the threshold required to go from opaque to transparent. The Default button returns Threshold to the value 10.0; Slope to the value 0.0; and Color to black (#ff000000). The Reset button and the reset icons next to the sliders always return to the value 0.0. Before the sliders are the input boxes so that the precise numerical values can be written.

Normally threshold is very low when using a high slope. The two parameters tend to be exclusive because slope fills in extra threshold. The slope tries to soften the edges of the chroma key but it does not work well for compressed sources. A popular softening technique is to use a maximum slope and chain a blur effect below the chroma key effect to blur just the alpha.