The Keyer filter is intended for subjects shot in front of a blue screen or green screen. However, this filter can also be used to pull chroma keys from any range of color within a shot. The keyed portions of the image are rendered transparent, allowing background images to show through.
You apply a Keyer filter like any other filter in Motion—via the Library or the Add Filter pop-up menu in the toolbar. For more information about applying filters, see Applying and Removing Filters.
Important: When combining masks with a keying filter, make sure the masks you use to crop the keyed image are applied to the same image layer as the keying filter itself. Also, apply masks after you apply a keying filter.
At its default settings, the Keyer filter attempts to work as automatically as possible. When you apply the Keyer filter to an object, Motion analyzes the visible frame in the Canvas to detect a dominant color such as a green or blue background. The dominant color becomes the initial sample that generates the tolerance, or core transparency, of the underlying key; this key is rendered as transparent in your composite.
However, you can override the automatic initial color sampling to key any color. You do this by setting the Strength parameter to 0, then using the Sample Color tool to draw a selection box over the region containing the color you want to key.
After you apply the Keyer filter to a video or image layer in your project, you can modify and refine the keying parameters in the Filters Inspector or HUD. This section explains the operation of the tools and parameter controls found in the Keyer section of the Filters Inspector.
When you sample regions in multiple frames, keyframes are added to interpolate the difference from one frame to the next. (Unlike standard keyframes, color-sampling keyframes are hidden in the Motion workspace by default.) The Jump to Sample buttons let you navigate between frames you’ve sampled, to make changes. For more information on keyframing the Keyer filter, see Animating Parameters in the Keyer Filter.
There are two Refine Key tools:
After you create a selection box, you can resize it to sample more or fewer shades of color, increasing or decreasing the range of background color used to create transparency. You can also add more selection boxes to expand the range of color that is keyed. You can also add more sample color boxes at other frames of the clip to maintain transparency when lighting conditions change.
To add selection boxes, select the Keyer filter in the Layers list, then hold down the Shift key while dragging in the Canvas.
Note: Adding a Sample Color selection box to a frame adds to the sampled region that’s defined when you first apply this filter.
If the Keyer filter is selected in the Layers list, you can press the Command key and drag in the Canvas to create Edges sampling controls.
Note: To remove a Sample Color selection box or Edges control, select the box or control, then press Delete. Alternatively, Option-click inside the selection box or control line.
Important: Setting Strength to 0 bypasses the filter’s automatic sampling altogether, allowing you to manually sample a range of color using the Refine Key tools.
The color that’s suppressed in the final image is based on the sampled portion of the image. The Spill Level slider controls how much spill suppression is applied to the keyed subject. For example, if the subject was shot in front of a green screen background, increasing the Spill Level value adds magenta to the foreground image, which neutralizes any unwanted green cast that your subject may be exhibiting. Spill suppression can be further customized using the controls in the Spill Suppression group, described later. Setting Spill to 0 turns off spill suppression.
These controls are meant to be used after you begin creating a key using automatic sampling or the Sample Color and Edges tools. (However, you can skip those tools and create a key using the Color Selection controls in Manual mode.) The graphical Chroma and Luma controls in the Color Selection group provide a detailed way of refining the range of hue, saturation, and image lightness that define the keyed matte.
Before you adjust these controls, the graphs in the Chroma and Luma controls represent ranges of color and luma in the image that have been automatically and manually sampled (using the Refine Key tools and the Strength slider).
Important: When you switch to Manual mode, it’s inadvisable to switch back to Scrub Boxes mode. For best results, begin keying an image using the Sample Color and Edges tools in Scrub Boxes mode. Switch to Manual mode afterwards if you feel it’s necessary to refine your matte using the Chroma and Luma controls. However, after you switch to Manual mode, do not switch back to Scrub Boxes mode. If you do, you may experience unexpected combinations of additionally sampled and keyframed values that might be difficult to control.
Drag any side of either graph to expand or contract the graph’s border, which adds to or subtracts from the range of hue and saturation contributing to the key. In manual mode, you can also drag inside the tolerance graph to adjust its overall position in the color wheel.
To the left of the color wheel, a small graph displays the slope of chroma rolloff, the relative softness of matte edges in regions most affected by the Chroma control. Dragging the Chroma Rolloff slider (described below) modifies the shape of this slope.
It’s possible to zoom into and pan around the Chroma control to more precisely adjust the graphs:
To reset the zoom and recenter the Chroma control, move the pointer over the Chroma control and press Shift-Z.
The Graph mode governs which handles are adjustable. In Scrub Boxes mode, you can adjust only the lower softness handles, which modify the range of lightness and darkness affecting the edge transparency the matte. In addition to using the handles, you can drag the slope in the graph to adjust the softness.
In Manual mode, you can also adjust the upper tolerance handles, which modify core transparency within the luma channel of the matte. Dragging the slope in the graph adjusts the lower handles (the softness). To adjust all handles simultaneously, drag inside the curve in the graph.
By default, the slope of the left and right sides of the Luma graph has a slight “S” curve. You can modify the shape of the curve by adjusting the Luma Rolloff slider (described below).
Note: The luma softness handles may extend past the outer boundaries of the Luma control. This is due to the floating-point precision of the Keyer filter, and is an expected behavior.
The Spill Suppression controls work by letting you adjust the color correction that neutralizes unwanted color in the foreground subject. While the Spill Level slider (described above) controls how much suppression is applied, the controls in this group let you customize the quality of suppression being performed.
When first applied, the Keyer filter adds spill suppression to the video clip or image, based on the dominant color sampled to create the initial key. This automatic spill suppression desaturates the key color so fringing around the foreground subject appears gray (rather than blue or green). But if you reduce the Spill Level slider to 0, effectively turning off spill suppression, the gray fringing turns blue or green (the color of your background), proving that successful spill suppression is rendering the background a neutral gray.
In Motion, the Light Wrap operation blends light and dark values from the background with the edges of the keyed foreground subject, and can be used to create color mixing effects around the edges of the solid part of a key to better marry the background and foreground layers of your keyed composite.
Light Wrap is the last operation in the image-processing pipeline. In other words, the light-wrap effect is added after every other image operation is processed, including filters, lights and shading, and other composited effects. As a result, Light Wrap properly accounts for any other visual effect that might alter the look of the object it is applied to, yielding the most desirable result.
Important: A separate Light Wrap option appears in the Blend Mode pop-up menu of the Properties Inspector for selected layer or group in Motion. The Light Wrap blend mode in the Properties Inspector for a layer is ignored when you add a Keyer filter to that layer and set the Light Wrap Amount parameter to a value greater then 0. (The Light Wrap parameters of the Keyer filter take precedence.) However, if you set the Amount parameter of the Light Wrap group to 0, the Light Wrap blend mode becomes active again. Further, the Light Wrap blend mode in the Properties Inspector for a group overrides the Light Wrap parameters of any Keyer filters in that group.
The HUD contains the following controls: Strength, Jump to Sample, View, Fill Holes, Edge Distance, Spill Level, and Invert.
Getting started with the Keyer filter is easy. Here’s an example.
Import a background image into your project.
This example uses a high-resolution still image of an orange sky at sunset.
Import a foreground image or video clip of a subject positioned in front of a green screen or blue screen.
This example uses video footage of an actor standing in front of a green screen. Make sure the foreground (the actor and green screen) layer is above the background layer in the Layers list.
Move the playhead to a frame where the green screen is visible in the Canvas, then apply the Keyer filter to the foreground layer.
The Keyer filter analyzes the frame and guesses the color you are trying to remove, based on the dominant color in the image (if blue or green). For the best results, apply the filter to the frame with the greatest amount of the color to key.
If the automatic guess is incorrect (for example, if you want to key on red), you can set the Strength parameter in the Filters Inspector to 0 to disable automatic color sampling, then use the Sample Color tool to draw a selection box in the Canvas around the color you want to key. (This workflow is covered in the next task.)
The background layer shows through as long as the View control in the Filters Inspector is set to Composite.
Note: If the clip you add a Keyer filter to is not visible in the Canvas, the initial key is pulled based on the first or last frame in which the subject appears, whichever is closest to the playhead.
If the automatic key is too aggressive (keying out soft details of the keyed subject that you want to preserve), slowly drag the Strength slider left to reduce the tolerance (core transparency) of the matte until you’re satisfied with the amount of edge detail in the key.
Doing so allows areas of marginal transparency like hair, smoke, and reflections to show through. In general, it’s better to err on the side of a less aggressive key, using the parameters within the Matte Tools group to fine-tune the soft details you’re trying to preserve.
Tip: If you open the Color Selection controls while adjusting the Strength slider, you can see how the Chroma and Luma parameters are affected.
If necessary, you can fine-tune the default color sampling using the Sample Color and Edges tools in the Filters Inspector or HUD. Alternatively, you can override the Keyer filter’s default sampling, then set the key colors manually. The next example describes that method.
Select the applied Keyer filter in the Layers list, then open the Filters Inspector or HUD.
Set the Strength slider to 0.
Automatic color sampling is disabled, and the green screen background becomes visible in the Canvas.
In the Filters Inspector (or HUD), click to select the Sample Color tool.
In the Canvas, drag a selection box over an area of the green screen color that you are attempting to key.
Most of the green screen should disappear and be replaced by the image in the layer underneath the foreground layer in the Layers list (in this example, the orange sunset sky). You can add as many selection boxes as necessary to sample areas of the green background (for example, highlights or shadows on the green screen) to achieve a better result.
If the edges of the foreground subject are too sharp, use the Edges tool to soften the foreground edges. The Edges tool is also effective for fine-tuning semitransparent features such as smoke, glass reflections, and shadows.
In the Filters Inspector or HUD, click to select the Edges tool.
In the Canvas, drag a line over the edge of the foreground subject so one end point lies in the interior of the foreground subject and the other end point lies in the background (the orange sky).
An Edges control line appears in the Canvas.
In the Canvas, drag the center handle of the Edges control line to adjust the edge transparency of the keyed subject.
You can also set the View mode to Matte, which helps you see the effect of using the Edges tool. (The Matte mode also helps you review your work when you modify the Fill Holes and Edge Distance parameters.)
Tip: If you open the Color Selection controls while dragging the center handle, you can see how the Edges control alters the outer softness graph of the Chroma control and the bottom softness handles of the Luma controls.
When manually sampling colors to create a key, it’s not necessary to click the Sample Color and Edges tools in the Inspector or HUD before you drag in the Canvas. Instead, you can use keyboard shortcuts to activate the Sample Color and Edges tools while dragging in the Canvas.
In the Layers list, select the Keyer filter to adjust.
Do one of the following:
To create a Sample Color selection box, hold down the Shift key while dragging over the color you want to key in the Canvas.
To create a Edges sampling control, hold down the Command key while dragging to draw a line that crosses over the edge of the subject you’re keying in the Canvas.
To remove a Sample Color or Edges control, Option-click anywhere in the control you want to delete, or click to select a sample control, then press the Delete key.
For additional control over the transparency matte, use the Color Selection controls and the Matte Tools in the Filters Inspector. These controls provide options for creating a seamless composite without adding more Keyer filters.
With the Keyer filter selected in the Layers list, set the View mode in the Filters Inspector to Matte.
Matte mode lets you see how your adjustments affect the transparency of the image. The keyed image now appears in grayscale: white areas represent solid pixels in the final matte; black areas represent transparent pixels in the final matte, and varying levels of gray represent translucent pixels in the final matte (darker gray is more transparent; lighter gray is more opaque).
Click the disclosure triangle in the Color Selection row of the Filters Inspector to reveal additional controls.
Choose one of the two Graph modes to select a mode for the adjustments you need:
After you enter Manual mode, do not return to Scrub Boxes mode.
Note: For more information on keyframing the Color Selection controls, see Animating Parameters in the Keyer Filter.
Depending on the mode you selected in the previous step, adjust the controls to alter your matte:
In Scrub Boxes mode, drag any side of the outer graph in the Chroma control to alter the range of hue and saturation contributing to the matte’s edge softness (transparency around the edges of the key).
Note: In Scrub Boxes mode, you can also drag the two lower handles of the Luma control to alter the range of lightness and darkness contributing to the matte’s edge softness.
In Manual mode, drag any side of the outer graph in the Chroma control to alter the range of hue and saturation contributing to the matte’s edge softness. Drag any side of the inner graph to alter the range of hue and saturation contributing to the matte’s tolerance (core softness). Drag in the center of the inner graph to rotate the graph to a new position in the color wheel.
Note: In Manual mode, you can also drag any of the four Luma control handles. The two upper Luma handles alter the range of lightness and darkness contributing to the matte’s tolerance (core transparency); the two lower handles alter the range of lightness and darkness contributing to matte’s edge softness.
In either mode, expanding the Chroma graph or Luma handle outward increases the regions of transparency in the keyed image. Dragging the side of a Chroma graph or a Luma handle inward diminishes the transparent regions in the keyed image. In the example below, the top image shows the holes in the matte that result from increasing edge softness using the outer graph of the Chroma control. The bottom image shows how reducing edge softness closes these holes.
If you haven’t adjusted the Luma control, drag the left or right lower handles to alter the softness of the luma component of the image.
Tip: In Manual mode, you can adjust the lower handles by dragging the bar connecting the top and bottom handles. To adjust all handles simultaneously, drag inside the curve in the graph.
Adjust the Chroma and Luma Rolloff sliders to subtly alter the falloff between the tolerance and softness of the key.
With the Keyer filter selected in the Layers list, set the View mode in the Filters Inspector to Matte.
Matte mode lets you see how adjustments affect the transparency of the image. The keyed image appears in grayscale: white areas represent solid pixels in the final matte; black areas represent transparent pixels in the final matte; and varying levels of gray represent translucent pixels in the final matte (darker gray is more transparent; lighter gray is more opaque).
Click the disclosure triangle of the Matte Tools row of the Filters Inspector.
The row expands to reveal the Levels control, which adjusts the contrast of the matte. Also revealed are the Shrink/Expand slider, the Soften slider, and the Erode slider.
Use the Levels control to modify transparency and contrast in the matte.
A general rule for using the Levels control is to drag the center Bias handle left to decrease transparency in the matte or right to increase transparency in the matte. The Black slider on the left and the White slider on the right modify contrast in the shadows and highlights of the matte.
The effects of Levels adjustments are best seen when View is set to Matte. In this view, the white area of the matte is the solid part, and the black area of the matte is the transparent part. Gray is translucent, with lighter grays creating progressively more transparency. With this in mind, here are some guidelines:
Dragging the black bias handle right pushes gray areas to black, expanding areas of transparency within the matte.
Dragging the center bias handle left pushes the grays in the matte towards white, widening solid areas of the key as semitransparent areas are made solid.
Dragging the center bias handle right pushes the grays in the matte towards black, widening transparent areas of the key as semitransparent areas are made transparent.
Dragging the white bias handle left pushes the grays in the matte towards white, expanding areas of solidity within the matte
Drag the Shrink/Expand slider left to shrink the matte inwards, widening holes in the matte; drag the Shrink/Expand slider right to expand the matte outward, filling in holes in the matte.
Drag the Soften slider right to blur the matte overall, resulting in softer edges throughout the matte.
Drag the Erode slider right to soften the matte from the edge inward, while preserving the original matte outlines as a translucent outer boundary.
If necessary, you can animate the parameters of the Keyer filter to account for changes in the background screen you’re keying. For example, if there’s uneven lighting in the background, and the camera pans along with a moving subject as she walks from a bright part to a darker part of the colored background, you can animate the Keyer filter parameters to account for this change.
There are two ways of doing this. You can use the Refine Key controls (Sample Color and Edges) to sample background colors on multiple frames, or you can set manual keyframes using the Animation pop-up menu and keyframe controls found in the Filters Inspector.
After you’ve added at least one keyframe—by using the Refine Key tools, or by manually keyframing—adjustments to the Chroma and Luma controls on other frames will generate more keyframes, whether the Record button is enabled or not.
Tip: To make an adjustment without adding keyframes, use the Jump to Sample buttons (in Scrub Boxes mode only), or the Next/Previous keyframe buttons to the right of the Chroma and Luma controls in the Filters Inspector (in Scrub Boxes or Manual modes) to navigate to a previously keyframed frame.
After you switch from Scrub Boxes mode to Manual mode, work in Manual mode from that point onward. Switching from Manual mode back to Scrub boxes mode can create unexpected combinations of additionally sampled and keyframed values that are difficult to control.
Note: Chroma and Luma control keyframes do not appear in the Keyframe Editor. They are only visible using the keyframe controls at the right of each parameter in the Filters Inspector.