chromakey

chromakey · effects · schema v1

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 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.

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 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

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 hue 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 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)
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 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

idcablewhat it does
outvideoThe composited RGB video frame: foreground over background with the key colour replaced.
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 hue being matched, default 0 for the green-screen default.
SoftSoft fader — smoothstep feathering of the matte edge (0..0.5, default 0.08); 0 = hard cutoff, higher = softer, more gradual key edge.
SpillSpill 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.
ThrThr 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.

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