chromakey
chromakey · effectschromakey 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
inputs
| id | cable | what it does |
|---|---|---|
fg | video | Foreground video frame — the layer shot against the key colour that gets keyed out where its chroma matches. RGB video stream |
bg | video | Background video frame — composited in wherever the foreground is keyed out; shown directly if no foreground is patched. RGB video stream |
keyR | cv | CV 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) |
keyG | cv | CV 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) |
keyB | cv | CV 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) |
threshold | cv | CV 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) |
softness | cv | CV 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) |
spillSuppress | cv | CV 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
| id | cable | what it does |
|---|---|---|
out | video | The 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
| id | label | range | default | curve |
|---|---|---|---|---|
keyR | R | 0..1 | — | linear |
keyG | G | 0..1 | — | linear |
keyB | B | 0..1 | — | linear |
threshold | Thr | 0..1 | — | linear |
softness | Soft | 0..0.5 | — | linear |
spillSuppress | Spill | 0..1 | — | linear |
controls
| control | what it does |
|---|---|
| B | B — blue channel of the key colour, set via the colour-picker swatch (0..1); default 0 for the green-screen default. |
| G | G — green channel of the key colour, set via the colour-picker swatch (0..1); default 1 so the keyer starts on a green screen. |
| R | R — 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. |
| Soft | Soft 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. |
| Spill | Spill 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. |
| Thr | Thr 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.