chromakey
chromakey · effects · schema v1chromakey 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 whose hue is close to the chosen key colour with the matching background pixel. Per pixel it converts foreground and key colour to HSV, measures the hue distance, and builds an alpha via smoothstep over the thr/soft window (alpha 0 = show background, alpha 1 = keep foreground); near-gray pixels are biased toward keep so shadows and highlights are not punched out, and edge pixels are desaturated by the spill amount to kill the key-colour halo. Pick the key colour with the swatch (defaults to pure green), then tune thr until the backdrop drops out cleanly, raise soft to feather the matte edge, and add spill to remove green fringing on the subject; if no foreground is patched it just passes the background through.
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 hue 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 close a pixel's hue 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 aggressively key-colour spill is desaturated from foreground edges (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. 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 hue being matched, default 0 for the green-screen default. |
| Soft | Soft fader — smoothstep feathering of the matte edge (0..0.5, default 0.08); 0 = hard cutoff, higher = softer, more gradual key edge. |
| Spill | Spill fader — desaturates the foreground at edge pixels proportional to (1-alpha)*spill (0..1, default 0.5); 0 = off, 1 = full removal of key-colour halo from the subject. |
| Thr | Thr fader — how close a pixel's hue must be to the key to be keyed out (0..1, default 0.15); higher widens the keyed hue band so more colour drops to background. |
source
chromakey.ts on GitHub.