Key

Remove a colour background with a chroma key.

What it does

Key pulls a transparency matte by comparing every pixel against a reference, a key colour, a brightness level, or a clean background plate, and turning matching pixels transparent. It covers green-screen and blue-screen work, brightness keys, and difference keys against a locked-off empty background.

Five modes: Chroma and Chroma (Video) key out a specific hue, Luma keys out shadows or highlights, Color keys out an exact colour by distance, and Difference compares against a Clean Plate to key out anything that has not changed. Tolerance and Softness set how tight the key is and how soft its edge falls off. Despill cleans colour spill from the screen onto the subject's edges.

When to use it

ParameterTypeDefault
content_inOneOf([FieldOf(Raster)])
clean_plateOneOf([FieldOf(Raster)])
depth_inOneOf([FieldOf(Raster)])
object_id_inOneOf([FieldOf(Raster)])
modeString"Chroma"
target_objectString""
antialiasedBooleanfalse
key_colorColorrgba(0.00, 1.00, 0.00, 1.00)
toleranceNumber0.200
softnessNumber0.100
depth_nearNumber0
depth_farNumber1
clip_blackNumber0
clip_whiteNumber1
invertBooleanfalse
despillNumber0.500
despill_methodString"Average"
luma_targetString"Dark"
edge_refineBooleanfalse
erodeNumber0
dilateNumber0
edge_blurNumber0
output_modeString"Keyed"
spatial_strengthField
strengthNumber1

Gotchas

Despill acts only when Key Color is a green or blue hue. With a red, yellow or other off-hue key colour the Despill slider stays visible and has no visible effect: spill suppression is built around the green and blue screen case.

Difference mode needs a Clean Plate wired in, an empty background plate shot from the same locked-off camera position. Without one there is nothing to compare against and the key does not work.

Edge Refinement (Erode, Dilate, Blur) affects the alpha edge only, so it does nothing when Output Mode is set to Matte, which is fixed fully opaque for preview. Switch back to Keyed to see refinement take effect.

Worked example

  1. Add a Key node and wire green-screen footage into Content In.

  2. Leave Mode on Chroma and set Key Color by sampling the screen colour.

  3. Raise Tolerance until the background disappears, then raise Softness slightly to smooth the cutout edge.

  4. If a green fringe shows around the subject, raise Despill.

  5. If the matte has small holes or ragged edges, enable Edge Refinement and adjust Erode, Dilate and Blur to clean it up.

See also

Matte Refine · Blur · Color Space · Rasters (images)