Chroma key

On this page 7

Chroma key is a compositing technique that makes pixels of one chosen color transparent, so that a subject filmed in front of a uniform green or blue background can be placed over a different image. In motion graphics and VFX for video, it is the standard method for separating foreground from background without drawing masks by hand, and it underpins everything from weather forecasts to feature-film set extensions.

The technique generates a matte, also called an alpha channel, from color differences in the image. Its quality depends on two things in roughly equal measure: how the background was lit and shot, and how the key was pulled and refined in software.

How a chroma key builds a matte

A keyer compares each pixel with the reference key color and assigns an alpha value between 0 and 1. Pixels close to the background color become fully transparent, pixels far from it remain fully opaque, and pixels in between, such as hair, motion blur and glass, become partially transparent.

Most professional keyers use a color difference method rather than a simple hue range. For a green screen, the matte is derived from how much the green channel exceeds the larger of red and blue. This approach preserves fine edge detail and semi-transparency far better than selecting a hue band.

Removing the background alone is not enough. The keyer also performs spill suppression, which neutralizes green or blue light reflected onto the subject, and outputs a premultiplied or straight alpha that the compositor combines with the new background.

StageWhat happensResult
Key color selectionSample the background colorReference for the matte
Matte extractionCompute alpha from color differenceRaw transparency map
Matte refinementAdjust clip black, clip white, shrink and softenClean core and natural edges
Spill suppressionRemove key color cast from the subjectNeutral skin and clothing
Edge and light wrapBlend background light into edgesBelievable integration
Stages of a chroma key

Green screen and blue screen compared

Green and blue are chosen because they are far from human skin tones. The choice between them depends on the camera, the subject’s wardrobe and the lighting conditions, and neither is universally better.

FactorGreen screenBlue screen
Sensor luminanceBrighter, cleaner channel on Bayer sensorsDarker, noisier channel
Light neededLess light for an even backgroundMore light for the same evenness
SpillStronger and more visible on skinWeaker, easier to hide
Wardrobe conflictsGreen clothing, foliageBlue jeans, blue eyes in close-up
Typical useVideo, daylight exteriors, digital captureNight scenes, blond hair, film heritage
Green screen versus blue screen

Digital cameras with a Bayer pattern have twice as many green photosites as red or blue, which gives the green channel the lowest noise and the most detail. That is the main reason green became dominant in digital video production.

Shooting for a clean key

The most reliable improvement to a chroma key happens on set, not in software. A well-lit, evenly exposed background with clear separation from the subject can be keyed in minutes, while a poorly lit one may need hours of rotoscoping.

ParameterTypical targetWhy it matters
Background evennessWithin about one-third stop across the frameOne key works everywhere
Background exposureAround middle gray or slightly below subjectSaturated color without clipping
Subject distanceSeveral feet or more from the screenLess spill and no shadows on screen
Chroma subsampling4:2:2 or 4:4:4 recordingSharper color edges for the matte
Shutter and motionShorter shutter for fast actionLess blur that becomes semi-transparent
CompressionHigh bit rate, 10-bit or rawFewer artifacts in the background
Practical shooting parameters

Recording format matters because a keyer works on color information. With 4:2:0 subsampling, chroma resolution is a quarter of luma resolution, so edges become blocky and stair-stepped. Banding and compression artifacts in the background are also amplified by the matte extraction.

Separate lighting of subject and background helps. A backlight or rim light on the subject counteracts spill and separates hair from the screen, while the screen itself is lit with soft, even sources.

Chroma key is one of several ways to isolate parts of an image in VFX. It is fast when the shot was planned for it, but other methods take over when there is no uniform background or when only part of the subject must be separated.

TechniquePrincipleBest suited for
Chroma keyTransparency from a key colorPlanned green or blue screen shots
Luma keyTransparency from brightnessFire, smoke, elements on black
RotoscopingHand-drawn animated masksShots without a usable screen
Difference matteCompare with a clean background plateLocked-off cameras
LED volumeReal-time background on LED wallsIn-camera VFX with natural reflections
Chroma key and neighboring techniques

In practice, these techniques are combined. A typical shot uses a chroma key for the core, rotoscoping for problem areas such as a rig or a hand crossing the frame edge, and motion tracking to match the camera move of the replaced background.

Common chroma key problems

Most failed keys show recognizable symptoms. Identifying the cause behind each symptom is quicker than pushing the keyer settings harder, which usually trades one artifact for another.

SymptomLikely causeFix
Green fringe around edgesSpill not suppressedSpill suppression and edge color correction
Holes in the subjectSubject contains key-like colorCore matte or garbage matte inside the subject
Noisy, chattering edgesLow light or heavy compressionDenoise before keying, better recording format
Hard, cut-out lookMatte choked too muchSoften edges and add light wrap
Uneven transparency in the backgroundUneven screen lightingGarbage matte and multiple keys by region
Chroma key symptoms, causes and fixes

A plain-language summary

Chroma key is the trick behind the weather presenter standing in front of a moving map. The person is actually standing in front of a plain green wall, and the software is told to treat every green pixel as see-through.

Whatever is placed behind the image then shows through the green areas. The hard part is keeping the edges natural, especially hair and fast movement, which is why good lighting on set matters as much as the software.

An example from practice

A small production team records a product explainer in which a presenter appears inside an animated 3D environment. They light a green cyclorama wall with soft panels to within one-third of a stop, place the presenter about eight feet in front of it and add a warm rim light to counter spill.

The camera records 10-bit 4:2:2 at a high bit rate. In the compositing application, the editor pulls a color difference key, uses a garbage matte to remove the unlit corners, applies spill suppression to the presenter’s shoulders and adds a subtle light wrap from the animated background.

The finished shots needed no frame-by-frame rotoscoping, and the presenter’s hair edges remained soft and natural over the bright animation, which kept the turnaround to a single day of compositing.