Skip to content

Keying

Pull a key that survives the edge: the keyer family, in the order that works.

A key does three separate jobs, and the keyers keep them separate so you can fix one without breaking the others:

  1. The matte - how much of each pixel is foreground.
  2. Despill - taking the screen's colour off the foreground, which is a colour fix and has nothing to do with the matte.
  3. The edge - the mixed pixels where foreground and background meet: hair, motion blur, soft focus.

Every keyer works in scene-linear float and never clips inside the key, so bright highlights and values below zero survive. A keyer's alpha is straight until you Premult.

Which keyer

NodeUse it for
KeyerScreenthe daily green or blue screen: sample the backing, get a matte and despilled colour together
KeyerScreenCleana badly or unevenly lit screen: it keys against a clean plate of the empty screen, pixel by pixel - the one for hair on a patchy backing
CleanScreenbuilds that clean plate from the shot itself, to feed KeyerScreenClean
KeyerSamplearm 🎯 and click: screen samples say what leaves, foreground samples say what stays - an uneven screen from a few clicks
KeyerChromaa quick key by distance from one sampled colour
Keyerbrightness or one channel: skies, windows, simple extractions
KeyerMLa learned matte for hair and edges the samplers struggle with; refine it with the others
Cruciblea subject that is not on a screen at all - see the Crucible page

Each keyer has a status view (black, white and grey for "in", "out" and "in between"), and inside / outside masks that force alpha to 1 or 0 after the key, the same way on every keyer.

The supporting nodes

  • SpillKill - removes green or blue spill from the foreground while keeping its brightness. Run it on the colour, separately from the matte, and judge it with the alpha at 1.
  • Despot - fills pinholes in the core and removes specks in the background.
  • EdgeBlur - blurs only the matte's edge.
  • Erode / FilterErode - shrink or grow a matte.
  • CrucibleRefine - finishing for any matte: clean black and white, shift the edge without losing its softness, grow or shrink only the core.
  • BS_LightWrap and EdgeMix - let the background's light into the foreground's edge, and blend the edge into the plate.

A key that holds up

The arrangement that works on hard shots splits the matte in two:

  1. Garbage roto to throw away what can never be foreground.
  2. A core matte - hard, clipped, eroded a little: its only job is to be solid.
  3. An edge matte - gentle and never clipped: it carries the hair and the blur.
  4. Put them together (the core, plus the edge, inside the garbage, minus any holdout).
  5. Despill the colour on its own branch.
  6. Premult, merge over the background, then light wrap and the edge blend.

The edge matte is never clipped. If the edge looks crunchy, the edge matte is being clipped somewhere; if the core has holes, it is the core matte that needs work, not the edge.