chromakey

chromakey · effects

chromakey is a two-input green-screen compositor: it takes a foreground video (the layer shot against a key colour) and a background video, and replaces every foreground pixel that is chromatically close to the chosen key colour with the matching background pixel. Per pixel it measures the DISTANCE IN THE CHROMA PLANE (full-swing Rec. 601 Cb/Cr) between the pixel and the key colour, normalized by the key's own chroma strength — the industry-standard keying metric — and builds an alpha via smoothstep over the thr/soft window (alpha 0 = show background, alpha 1 = keep foreground). A neutral gray always sits at exactly distance 1.0 from a saturated key, so shadows, highlights and low-saturation subject pixels survive the key without any special gating. Spill suppression then limits the key colour's dominant channel on the KEPT foreground (for a green key: green is pulled down toward max(red, blue)), removing green contamination from the subject itself — not just from the matte edge. Pick the key colour with the swatch (defaults to pure green), then tune thr: the default 0.5 keys real-world screen variation (shading, off-tint) while keeping subjects; lower it toward 0.15 to key only near-pure key pixels, raise soft to feather the matte edge, and raise spill to remove key-colour fringing from the subject. If no foreground is patched it just passes the background through. Note: an achromatic (black/white/gray) key colour has no chroma to measure against, so ALL neutral pixels key out together regardless of brightness — for keying off a black or white backdrop use lumakey instead.

chromakey is a two-input green-screen compositor: it takes a foreground video (the layer shot against a key colour) and a background video, and replaces every foreground pixel that is chromatically close to the chosen key colour with the matching background pixel. Per pixel it measures the DISTANCE IN THE CHROMA PLANE (full-swing Rec. 601 Cb/Cr) between the pixel and the key colour, normalized by the key's own chroma strength — the industry-standard keying metric — and builds an alpha via smoothstep over the thr/soft window (alpha 0 = show background, alpha 1 = keep foreground). A neutral gray always sits at exactly distance 1.0 from a saturated key, so shadows, highlights and low-saturation subject pixels survive the key without any special gating. Spill suppression then limits the key colour's dominant channel on the KEPT foreground (for a green key: green is pulled down toward max(red, blue)), removing green contamination from the subject itself — not just from the matte edge. Pick the key colour with the swatch (defaults to pure green), then tune thr: the default 0.5 keys real-world screen variation (shading, off-tint) while keeping subjects; lower it toward 0.15 to key only near-pure key pixels, raise soft to feather the matte edge, and raise spill to remove key-colour fringing from the subject. If no foreground is patched it just passes the background through. Note: an achromatic (black/white/gray) key colour has no chroma to measure against, so ALL neutral pixels key out together regardless of brightness — for keying off a black or white backdrop use lumakey instead.

the faceplate

chromakeyfgvideobgvideokeyRcvkeyGcvkeyBcvthresholdcvsoftnesscvspillSuppresscvoutvideoaudiocvgatepitch
8 inputs · 1 outputs · 6 params

inputs

idcablewhat it does
fgvideoForeground video frame — the layer shot against the key colour that gets keyed out where its chroma matches.
RGB video stream
bgvideoBackground video frame — composited in wherever the foreground is keyed out; shown directly if no foreground is patched.
RGB video stream
keyRcvCV input that modulates the R control — the red component of the key colour (linear 0..1).
control voltage (CV); modulates keyR (additive offset — ±1 CV sweeps the full range, centered on the knob)
keyGcvCV input that modulates the G control — the green component of the key colour (linear 0..1).
control voltage (CV); modulates keyG (additive offset — ±1 CV sweeps the full range, centered on the knob)
keyBcvCV input that modulates the B control — the blue component of the key colour (linear 0..1).
control voltage (CV); modulates keyB (additive offset — ±1 CV sweeps the full range, centered on the knob)
thresholdcvCV input that modulates the Thr control — how chromatically close a pixel must be to the key to be removed (linear 0..1).
control voltage (CV); modulates threshold (additive offset — ±1 CV sweeps the full range, centered on the knob)
softnesscvCV input that modulates the Soft control — the feathering width of the matte edge (linear 0..0.5).
control voltage (CV); modulates softness (additive offset — ±1 CV sweeps the full range, centered on the knob)
spillSuppresscvCV input that modulates the Spill control — how strongly the key colour's dominant channel is limited on the kept foreground (linear 0..1).
control voltage (CV); modulates spillSuppress (additive offset — ±1 CV sweeps the full range, centered on the knob)

outputs

idcablewhat it does
outvideoThe composited RGB video frame: foreground over background with the key colour replaced and key-colour spill suppressed on the kept subject.
RGB video stream

params

idlabelrangedefaultcurve
keyRR0..1linear
keyGG0..1linear
keyBB0..1linear
thresholdThr0..1linear
softnessSoft0..0.5linear
spillSuppressSpill0..1linear

controls

controlwhat it does
BB — blue channel of the key colour, set via the colour-picker swatch (0..1); default 0 for the green-screen default.
GG — green channel of the key colour, set via the colour-picker swatch (0..1); default 1 so the keyer starts on a green screen.
RR — red channel of the key colour, set via the colour-picker swatch (0..1); part of the chroma being matched, default 0 for the green-screen default.
SoftSoft fader — smoothstep feathering of the matte edge over the chroma-distance band (0..0.5, default 0.08); 0 = hard cutoff, higher = softer, more gradual key edge.
SpillSpill fader — dominant-channel despill on the kept foreground (0..1, default 0.5): for a green key the green channel is pulled toward max(red, blue) by this amount, removing key-colour contamination from the subject itself. 0 = exactly off (bit-identical passthrough), 1 = full limit.
ThrThr fader — the normalized chroma-plane distance from the key colour below which a pixel is keyed out (0..1, default 0.5). The scale: 0 = only the key colour itself, 0.5 = shaded/off-tint screen variation drops out (a half-brightness key green sits at exactly 0.5), 1 = even neutral grays (distance 1.0) reach the edge of the key band. Lower it to key only near-pure key pixels; raise it if screen shading survives the key.

source

chromakey.ts on GitHub.

Generated from packages/web/src/lib/{audio,video}/module-registry.ts · repo