Opomba:
Though the color keying effects built into After Effects can be useful for some purposes, you should try keying with Keylight before attempting to use these built-in keying effects. Some keying effects have been superseded by more modern effects like Keylight.
For information about keying in general, including links to tutorials and other resources, see Keying introduction and resources.
The Color Difference Key effect creates transparency from opposite starting points by dividing an image into two mattes, Matte Partial A and Matte Partial B. Matte Partial B bases the transparency on the specified key color, and Matte Partial A bases transparency on areas of the image that don’t contain a second, different color. By combining the two mattes into a third matte, called the alpha matte, the Color Difference Key creates well-defined transparency values.
The Color Difference Key produces high-quality keying for all well-lit footage items shot against a bluescreen or greenscreen and works especially well with images that contain transparent or semitransparent areas, such as smoke, shadows, or glass.
This effect works with 8-bpc and 16-bpc color.
-
Select the appropriate key color: To key out a bluescreen, use the default blue color. To key out a nonblue screen, select a key color in one of the following ways:
Thumbnail eyedropper: Select and then click in the Composition panel or the original thumbnail image on an appropriate area.
Key Color eyedropper: Select and then click in the Composition or Layer panel on an appropriate area.
Key Color swatch: Click to select a color from the specified color space.
Opomba:
The eyedropper tools move the sliders accordingly. Use the sliders in step 9 to fine-tune the keying results.
-
Select the White eyedropper, and then click inside the matte thumbnail on the darkest area of white to specify opaque regions. The opaque values in the thumbnail and the Composition panel are adjusted.
Opomba:
To produce the best possible key, make the black and white areas as different as you can so that the image retains as many shades of gray as possible.
-
Adjust transparency values for each partial matte and for the final matte by dragging one or more of the following sliders in the Matte Controls section:
Black sliders adjust the transparency levels of each matte. You can adjust the same levels using the Black eyedropper.
White sliders adjust the opaque levels of each matte. You can adjust the same levels using the White eyedropper.
Gamma sliders control how closely the transparency values follow a linear progression. At a value of 1 (the default), the progression is linear. Other values produce nonlinear progressions for particular adjustments or visual effects.
-
Before closing the Effect Controls panel, select Final Output from the View menu. Final Output must be selected for After Effects to render the transparency.
Opomba:
To remove traces of reflected key color from the image, apply Spill Suppressor using Better For Color Accuracy. If the image still has a lot of color, apply the Simple Choker or Matte Choker effect.
Opomba:
Starting with the October 2013 release of After Effects CC, the Color Key effect has been moved to the Obsolete effects category. Use other effects such as the Keylight effect instead.
For information about keying in general, including links to tutorials and other resources, see Keying introduction and resources.
The Color Key effect keys out all image pixels that are similar to a specified key color. This effect modifies only the alpha channel of a layer.
This effect works with 8-bpc and 16-bpc color.
Opomba:
Though the color keying effects built into After Effects can be useful for some purposes, you should try keying with Keylight before attempting to use these built-in keying effects. Some keying effects have been superseded by more modern effects like Keylight.
For information about keying in general, including links to tutorials and other resources, see Keying introduction and resources.
The Color Range effect creates transparency by keying out a specified range of colors in either the Lab, YUV, or RGB color space. You can use this key on screens that consist of more than one color or on bluescreens or greenscreens that have been unevenly lit and contain different shades of the same color.
This effect works with 8-bpc color.
-
Select the Key Color eyedropper, and then click in the matte thumbnail to select the area that corresponds to a color in the Composition panel you want to make transparent. Typically, this first color is the one that covers the largest area of the image.
Opomba:
To use the eyedroppers in the Layer panel, choose Color Range from the View menu in the Layer panel.
-
Use the sliders in the Min and Max controls to fine-tune the color range you selected with the plus and minus eyedroppers. The L, Y, R sliders control the first component of the specified color space; the a, U, G sliders control the second component; and the b, V, B sliders control the third component. Drag the Min sliders to fine-tune the beginning of the color range. Drag the Max sliders to fine-tune the end of the color range.
The Difference Matte effect creates transparency by comparing a source layer with a difference layer, and then keying out pixels in the source layer that match both the position and color in the difference layer. Typically, it’s used to key out a static background behind a moving object, which is then placed on a different background. Often the difference layer is simply a frame of background footage (before the moving object has entered the scene). For this reason, the Difference Matte effect is best used for scenes that have been shot with a stationary camera and an unmoving background.
This effect works with 8-bpc and 16-bpc color.
A. Original image B. Background image C. New background image D. Final composite image
-
In the source layer, find a frame that consists only of background, and save the background frame as an image file. (See Render and export a single frame of a composition.)
-
The imported image becomes the difference layer. Make sure that its duration is at least as long as the duration of the source layer.
Opomba:
If the shot doesn’t contain a full background frame, you may be able to assemble the full background by combining parts of several frames in After Effects or Photoshop. For example, you can use the Clone Stamp tool to take a sample of the background in one frame, and then paint the sample over part of the background in another frame.
-
In the Effect Controls panel, choose Final Output or Matte Only from the View menu. (Use the Matte Only view to check for holes in the transparency. To fill undesired holes after you complete the keying process, see Close a hole in a matte.)
-
If the difference layer isn’t the same size as the source layer, choose one of the following controls from the If Layer Sizes Differ menu:
The Extract effect creates transparency by keying out a specified brightness range, based on a histogram of a specified channel. It’s best used to create transparency in an image shot against a black or white background or against a background that is dark or bright but consists of more than one color.
Opomba:
The controls for this effect are similar to the controls of the Extract effect in Adobe Premiere Pro, but the purpose and results of the effect are different.
In the Effect Controls panel, the Extract effect displays a histogram for a channel specified in the Channel menu. The histogram displays a representation of the brightness levels in the layer, showing the relative number of pixels at each level. From left to right, the histogram extends from the darkest (a value of 0) to the lightest (a value of 255).
Using the transparency control bar beneath the histogram, you can adjust the range of pixels that are made transparent. The position and shape of the bar in relation to the histogram determine transparency. Pixels corresponding to the area covered by the bar remain opaque; pixels corresponding to the areas not covered by the bar are made transparent.
-
Drag the upper right or upper left selection handles to adjust the length of the bar and to shorten or lengthen the transparency range. You can also adjust the length by moving the White Point and Black Point sliders. Values above the white point and below the black point are made transparent.
Drag the lower right or lower left selection handles to taper the bar. Tapering the bar on the left affects the softness of transparency in the darker areas of the image; tapering it on the right affects the softness in the lighter areas. You can also adjust the softness levels by adjusting White Softness (lighter areas) and Black Softness (darker areas).
Opomba:
To taper the edges of the transparency control bar, first shorten the transparency bar.
Opomba:
Though the color keying effects built into After Effects can be useful for some purposes, you should try keying with Keylight before attempting to use these built-in keying effects. Some keying effects have been superseded by more modern effects like Keylight.
For information about keying in general, including links to tutorials and other resources, see Keying introduction and resources.
The Inner/Outer Key effect isolates a foreground object from its background.
This effect works with 8-bpc and 16-bpc color.
To use the Inner/Outer key, create a mask to define the inside and outside edge of the object you want to isolate. The mask can be fairly rough—it doesn’t need to fit exactly around the edges of the object.
In addition to masking a soft-edged object from its background, Inner/Outer Key modifies the colors around the border to remove contaminating background colors. This color decontamination process determines the contribution of the background to the color in each border pixel, and then removes that contribution—thus removing the halo that can appear if a soft-edged object is matted against a new background.
-
Draw a single closed mask near the border of the object; then select the mask from the Foreground menu and leave the Background menu set to None. Adjust the Single Mask Highlight Radius to control the size of the border around this mask. (This method works well only on objects with simple edges.)
Draw two closed masks: an inner mask just inside the object, and an outer mask just outside the object. Make sure that any fuzzy or uncertain areas of the object lie within these two masks. Select the inner mask from the Foreground menu and the outer mask from the Background menu.
Opomba:
Make sure that the mask mode for all masks is set to None.
-
To extract more than one object, or to create a hole in an object, draw additional masks and then select them from the Additional Foreground and Additional Background menus. For example, to key out a person’s hair blowing in the wind against a blue sky, draw the inner mask inside the head, draw the outer mask around the outside edge of the hair, and then draw an additional mask around the gap in the hair where you can see sky. Select the additional mask from the Additional Foreground menu to extract the gap and remove the background image.
-
Create additional open or closed masks to clean up other areas of the image, and then select them from the Cleanup Foreground or Cleanup Background menu. Cleanup Foreground masks increase the opacity along the mask; Cleanup Background masks decrease the opacity along the mask. Use the Brush Radius and Brush Pressure options to control the size and density of each stroke.
Opomba:
You can select the Background (outer) mask as a Cleanup Background mask to clean up noise from the background portions of the image.
Opomba:
Though the color keying effects built into After Effects can be useful for some purposes, you should try keying with Keylight before attempting to use these built-in keying effects. Some keying effects have been superseded by more modern effects like Keylight.
For information about keying in general, including links to tutorials and other resources, see Keying introduction and resources.
Linear keys create a range of transparency across an image. A linear key compares each pixel in the image to the key color you specify. If the color of a pixel closely matches the key color, it becomes completely transparent. Pixels that don’t match as well are made less transparent, and pixels that don’t match at all remain opaque. The range of transparency values, therefore, forms a linear progression.
The Linear Color Key effect uses RGB, hue, or chroma information to create transparency from a specified key color.
This effect works with 8-bpc, 16-bpc, and 32-bpc color.
In the Effect Controls panel, the Linear Color Key effect displays two thumbnail images; the left thumbnail image represents the unaltered source image, and the right thumbnail image represents the view you’ve selected in the View menu.
You can adjust the key color, the matching tolerance, and the matching softness. The matching tolerance specifies how closely pixels must match the key color before they start becoming transparent. The matching softness controls the softness of edges between the image and the key color.
You can also reapply this key to preserve a color that was made transparent by the first application of the key. For example, if you key out a medium-blue screen, you may lose some or all of a light-blue piece of clothing your subject is wearing. You can bring back the light-blue color by applying another instance of the Linear Color Key and choosing Keep This Color from the Key Operation menu.
-
In the Effect Controls panel, choose Final Output from the View menu. The view you choose appears in the right thumbnail and in the Composition panel. To see other results, work in one of the other views:
Matte Only
Shows the alpha channel matte. Use this view to check for holes in the transparency. To fill undesired holes after you complete the keying process, see Close a hole in a matte.
-
Select the Thumbnail eyedropper, and then click an appropriate area in the Composition panel or the original thumbnail image.
Select the Key Color eyedropper, and then click an appropriate area in the Composition or Layer panel.
To preview transparency for different colors, select the Key Color eyedropper, hold down the Alt key (Windows) or Option key (Mac OS), and move the pointer to different areas in the Composition panel or the original thumbnail image. The transparency of the image in the Composition panel changes as you move the pointer over different colors or shades. Click to select the color.
Click the Key Color swatch to select a color from the specified color space. The selected color becomes transparent.
note: The eyedropper tools move the sliders accordingly. Use the sliders in steps 6 and 7 to fine-tune the keying results. To use eyedroppers in the Layer panel, choose Linear Color Key from the View menu in the Layer panel.
-
Select the Plus (+) or the Minus (-) eyedropper, and then click a color in the left thumbnail image. The Plus eyedropper adds the specified color to the key color range, increasing the matching tolerance and the level of transparency. The Minus eyedropper subtracts the specified color from the key color range, decreasing the matching tolerance and the level of transparency.
Drag the matching tolerance slider. A value of 0 makes the entire image opaque; a value of 100 makes the entire image transparent.
-
In the Effect Controls panel or Timeline panel, turn off any current instances of keys or matte effects by deselecting the Effect option to the left of the key name or tool name. Deselecting the option causes the original image to appear in the Composition panel so that you can select a color to preserve.
-
In the first application of the Linear Color Key effect, choose Final Output from the View menu in the Effect Controls panel, and then turn other instances of the Linear Color Key effect back on to examine the transparency. You may need to adjust colors or reapply the key a third time to get the results you need.
Opomba:
Starting with the October 2013 release of After Effects CC, the Luma Key effect has been moved to the Obsolete effects category and users are recommended to use other effects such as the Keylight effect.
For information about keying in general, including links to tutorials and other resources, see Keying introduction and resources.
The Luma Key effect keys out all the regions of a layer with a specified luminance or brightness. The quality setting of the layer doesn’t influence the Luma Key effect.
Use this effect if the object from which you want to create a matte has a greatly different luminance value than its background. For example, if you want to create a matte for musical notes on a white background, you can key out the brighter values; the dark musical notes become the only opaque areas.
This effect works with 8-bpc and 16-bpc color.
Opomba:
Starting with the June 2014 release of After Effects CC, the Spill Suppressor effect has been moved to the Obsolete effects category and users are recommended to use the Advanced Spill Suppressor effect.
The Key Cleaner effect recovers alpha-channel detail from a scene keyed by a typical keying effect, including recovering detail lost due to compression artifacts.
Opomba:
If you see that unwanted semi-transparency effects have crept in along edges that should be sharp, use an effect mask (with a little mask feather) to restrict the Key Cleaner effect to the intended area.
The Advanced Spill Suppressor effect removes color spill on a foreground subject from a colored background used for color keying.
The Advanced Spill Suppressor effect has two methods for spill suppression:
- Standard - The Standard method is simpler, automatically detects the dominant key color, and requires less user input.
- Ultra - The Ultra method is based on the spill suppression in the Ultra Key effect in Premiere Pro. See the Ultra Key section in Premiere Pro for details about the Ultra Key.
An easy way of applying these effects is by using the Keylight + Key Cleaner + Spill Suppressor animation preset.
Opomba:
Starting with the June 2014 release of After Effects CC, the Spill Suppressor effect has been moved to the Obsolete effects category and users are recommended to use the Advanced Spill Suppressor effect.
After Effects includes several built-in keying effects, as well as the Academy Award–winning Keylight effect, which excels at professional-quality color keying. For information on the Keylight effect, see its documentation in the folder in which the Keylight plug-in is installed. (See Plug-ins.)
For information about keying in general, including links to tutorials and other resources, see Keying introduction and resources.
Opomba:
The Key Color property is already linked with an expression to the Keylight effect's Screen Colour property, so you don't need to change it unless you want to use a different color for the despill process. To use a different color for the despill process, just disable or remove the Keylight expression.
Follow the steps below to apply the Keylight effect with the Key Cleaner and Advanced Spill Suppressor effect:
- Use the Keylight + Key Cleaner + Advanced Spill Suppressor animation preset (in the Image-Utlities folder under Animation Presets) to apply the three effects in order to the layer.The Advanced Spill Suppressor effect is turned off by default to allow you to sample the key color in the Keylight effect or if the footage does not have any color spill to be removed.
- Use the Keylight effect's Screen Colour eyedropper to sample the key color from the layer in the Composition panel. Adjust other Keylight effect settings as you normally would to get the best results.
- Turn on the effect switch for the Advanced Spill Suppressor effect to remove color spill from the scene, if required.
Opomba:
If you see unwanted semitransparency along edges that should be sharp, use an effect mask (with a little bit of mask feather) to restrict Key Cleaner to the intended area.
See variable-width mask feathering and soften the edges of a mask articles for information on mask feathering
Follow the steps below to apply the Key Cleaner and Advanced Spill Suppressor effect to a keying effect other than the Keylight effect:
- Apply the keying effect to the layer.
- Set the effect to the equivalent of the Keylight effect's Indeterminate Result setting, so that the keying effect gives the full RGB result without attempting to perform its own spill suppression.
- Apply the Key Cleaner effect after the keying effect.
- Apply the Advanced Spill Suppressor effect after the Key Cleaner effect.
Watch this video to learn how to get better keying results from compressed or badly shot green-screen footage with the new Key Cleaner effect and remove color spill with the Advanced Spill Suppressor controls.