How To Pull The Perfect Key

Chroma keying might appear as a daunting task to the uninitiated video editor, but it doesn’t have to be that way. Proper planning and preparation go a long way in setting up a clean chroma key.  Any video editor, from the novice to the experienced veteran, when equipped with some basic knowledge about chroma keying tools, can hide in plain sight and pull the perfect key.

Chroma keying is the process of selecting a narrow chromatic range in a video image and applying that selection to the video’s alpha channel, making it transparent. The post-production vernacular often refers to chroma keying as “pulling a key.” It’s a technique every video editor should be familiar with and will eventually find themselves performing. Chroma keying has never been easier than it is today because of the technological capabilities of production gear and post-production tools. 

The perfect key hides in plain sight, never to be found.

Finesse It In Post

There are some situations a video editor can never fix in post, but if chroma key footage is shot correctly, the video editor can most definitely finesse it in post. Almost every video editing program has the ability to execute a chroma key, some are more in-depth than others. The process described here is using Keylight in Adobe After Effects. It’s a common application for chroma key work, and offers a robust set of features. Although the process here is specific to Keylight, its basic principles and techniques translate across video editing applications and video effects. There are comprehensive books about pulling a perfect key, but the tips here are an introduction to help the editor gain a firm understanding of chroma keying practices. 

Almost every video editing program has the ability to execute a chroma key, some are more in-depth than others.

Garbage Time

A video editor can set themselves up to make pulling a key a lot easier. The video editor should preview their footage before making a selection.

Screen grab of Adobe After Effects, Keylight, of a ballet dancer with green screen background.
Having a head-to-toe green screen with seamless edges will make the keying process much easier.

They should look for regions of the chroma background that are inconsistent with the majority of the chroma background. If there is an abnormality, such as a shadow created by light falloff, and the subject of the footage never intersects that portion of the screen, the editor should mask out that portion of the image. If the video editor is comfortable at masking footage and animating masks, they will do themselves a favor by animating a garbage matte around their subject. The subject should never violate the edge of the mask. This decreases the area of the screen the editor needs to pull a key from, and makes it easier in the long run. 

Make a Selection

The easiest way to get immediate results with chroma keying is to make the right selection. Keylight and other chroma keyers have an eyedropper tool so the video editor can select which color they want to key. There are a few simple ways to make the best selection possible, one that will require less finesse work when pulling the key. The color selected should be one that represents the middle range of the color to be keyed. More often than not, there will be a degree of variance in the luminance values in a chroma key background. Selecting a pixel that represents the middle of this luminance range will make it easier to isolate all the correct pixels of the same color value. 

Screen grab of Adobe After Effects, Keylight, of a ballet dancer with initial key.
In the initial key, we can see that there are some rough edges around the dancer’s black outfit. Plus, some of the green backdrop remains, though it’s now grey.

The selection should be made near the subject but not on a pixel bordering the subject. If there is any compression in the color channels of the footage, a pixel right next to the subject may be slightly tinted away from the rest of the background. Once the Screen Color is selected the editor will notice transparency in their image, hopefully across the entirety of the chroma colored background. 

Point of View

A helpful feature in Keylight, and one that exists in other keying plug ins, is the View pull-down menu. The View menu allows the editor to see different visualizations of the key. The obvious options are the Source, Source Alpha, and Final Result options. Source shows the source footage, without the Keylight plugin applied, Source alpha shows the alpha channel of the source footage, and Final Result shows the current final result of the key as set up by Keylight. 

There are eleven options in all on the View menu, but none is more useful for refining a key than the Screen Matte view.

Screen grab of Adobe After Effects, Keylight, of a ballet dancer showing Matte view.
Screen matte view shows us exactly what’s opaque (white) and what’s transparent (black).

The Screen Matte view shows a representative matte that is generated by the user’s selection and refinement of the chroma key. Black represents complete transparency, while white represents full opacity. Gray is representative of variable transparency, moving from white (fully opaque) to black (full transparency). The video editor can better refine their key by viewing and understanding the Screen Matte view. 

Pulling the Perfect Key

Screen grab of Adobe After Effects, Keylight, of a ballet dancer showing final key.
After some tweaking, we have a truly clean key.

When garbage mattes are applied and chroma selections are made, the video editor can refine their key. One thing they may notice in the Screen Matte view is pixels of gray “noise” inside of predominantly black  or white regions. This should be a cue to the editor that there is either some color spill in their image, or visual noise that is inherent to their footage. If this isn’t corrected it will show up in the final results as either grainy noise in the keyed areas, or transparent holes in the subject.

The first adjustment that should be made are with the Screen Gain and the Screen Balance. The Screen Gain affects the areas of the image that are selected with the Screen Colour, the user’s selected chroma color. The Screen Gain by default is set at 100. By raising this value, it boosts the gain of the selected color, often cleaning up noise in the black regions of the Screen Matte. The Screen Balance is set to 50 by default. It measures the value of the saturation of the selected chroma key color and compares it to the other primary colors of the image. Lowering the Screen Balance value will result in eliminating gray noise from the predominantly white regions of the Screen Matte, or what should be the editor’s subject. The important thing to note here is that moderation is the editor’s friend. Footage that is shot well will not need major adjusting. The greater variance in adjustments that are made will introduce adverse results to the final image. A little finesse will go a long way.

Under the Screen Matte section of Keylight, the video editor will note several selections. Two that will help them refine the key are Clip Black and Clip White. They do exactly as their name implies, they both clip their respective ends of the luminance spectrum within the Screen Matte. Clip Black will raise the floor of what is read by Keylight as black in the matte, anything below the selected value will be read as black and made transparent. Likewise, Clip White will clip anything above it’s selected value to white, making it fully opaque.

Chroma keying, as a process, isn’t elusive. However, any key pulled by an editor should be. Audiences shouldn’t find hidden pixels. The best work will go unnoticed, or at least be appreciated as a well crafted image that composites together without distracting the viewer. A video editor who spends time looking for the details that make their work better will surely find them. 


Pulling a Key Starts in Production

Video cameras output footage into various formats and codecs. One way video codecs reduce the file size of footage is by compressing the color values of an image more than the luminance values of an image. While normally unseen by the human eye, chroma subsampling becomes visually evident when the color information of the image is processed through effects such as chroma keying. The reduced color information shows up as digital artifacts in the resultant image. Formats with a color sampling of 4:2:2 or better work best for the chroma key process. 

It’s Not Easy Being Green

The basis of chroma keying is using an isolated color to create transparency. The background used for shooting chroma key footage should be  flat and consistent. The most common colors used are green and blue because they are the easiest to isolate. It’s not just any green or blue, varying hues do work, but the best results are shot on backgrounds that are specifically tinted for the purpose of chroma keying. 

Light It Right

The right paint might make a consistent color backdrop to the human eye, but it doesn’t for the camera. Lighting and shadows play a big role in shooting proper chroma key footage. The chroma colored background and foreground subject being shot should be lit separately. This can be achieved by pulling the subject off of the background, allowing light spill and shadows to fall flat. It is also important to use a quality lighting instrument that provides a consistent and balanced color, without changing the chromatic value of the background. Lights, such as the Lowel PRO Power LED, are dimmable light sources that provide balanced light without any color shift.

Chris “Ace” Gates is a four time Emmy Award-winning writer and video producer.

Related Content