colour of magic

colourofmagic · effects

COLOUR OF MAGIC — a multi-colorspace video PROCESSOR. One video IN runs through FIVE parallel colorspace blocks — RGB, YDbDr (the SECAM luma+chroma broadcast space), HSV-or-HSL, YIQ (the NTSC composite space, its orange↔cyan flesh-tone I axis + green↔magenta Q axis), and YCbCr BT.601 STUDIO-SWING (the broadcast-legal 16–235 / 16–240 window whose ~1.16× decode expansion CRUSHES super-black/white like a proc-amp) — each block encoding the picture into that space, adjusting each component, then decoding back to RGB. Every block has, per channel: a BIAS knob (additive offset, identity at 0) that also sums CV patched into its cv input; a MONO OVERRIDE input that REPLACES that channel with an incoming grayscale/video stream (bias still adds on top, so a patched key can still be offset); and an OVER/CLAMP toggle — CLAMP clips out-of-range to 0..1 (a legal clip) while OVER wraps it around via fract() (the LZX chroma-wrap look where over-driven values fold back through the spectrum). Bipolar chroma rides a 0.5 pedestal (YDbDr Db/Dr, YIQ I/Q) or the authentic 128/255 = 0.502 pedestal (studio-swing Cb/Cr); HUE always wraps regardless of its toggle (which is advisory). The third block switches HSV↔HSL. TWENTY-TWO outputs run in parallel: pass (the untouched source); rgb / ydbdr / hsvhsl / yiq / ycc (each block colorized); and per-block grayscale channel taps — r / g / b / luma (RGB), ydb_y/db/dr (YDbDr), hsv_h/s/v (HSV·HSL), yiq_y/i/q (YIQ, its mono I tap a ready-made warmth/skin key), ycc_y/cb/cr (studio-swing). The RGB block also has a palette REPLACE mode: three colour-picker swatches remap the adjusted R/G/B channels to chosen output colours (a duotone/tritone recolour) before the rgb out — picking a swatch auto-enables REPLACE and the swatches default to a non-identity teal/orange/violet so it recolours immediately. Only the outputs you PATCH downstream (plus the one you PREVIEW) are rendered each frame, so the many taps stay cheap. With nothing patched all outputs are opaque black. All colorspace math is a 1:1 mirror of the pure, unit-tested $lib/video/colourofmagic-colorspace core. The card has a live preview (with a 22-way output selector), the five block columns of knobs + OVER/CLAMP pills, the HSV/HSL toggle, and the palette REPLACE swatches; all CV + mono-override jacks + the 22 outputs live in the sectioned yellow drill-down PATCH PANEL (IN / RGB / YDbDr / HSV-HSL / YIQ / YCbCr / OUT, no raw side jacks).

COLOUR OF MAGIC is a multi-colorspace video processor. It takes ONE video input and runs it through FIVE parallel colorspace blocks at once — RGB, YDbDr (the SECAM broadcast luma+chroma space), HSV-or-HSL, YIQ (the NTSC composite space), and YCbCr BT.601 STUDIO-SWING (the broadcast-legal 16–235 / 16–240 quantization) — each block encoding the picture into that space, adjusting each component, then decoding back to RGB. Every block has, per channel: a BIAS knob (additive offset, identity at 0) that also sums any CV patched into its cv input; a MONO OVERRIDE input that REPLACES that channel's value with an incoming grayscale/video stream (bias still adds on top, so a patched key can still be offset); and an OVER/CLAMP toggle that decides what happens out of range — CLAMP clips to 0..1 (a legal, safe clip) while OVER wraps it around (fract(), the LZX chroma-wrap look where over-driven values fold back through the spectrum). Chroma components ride on a 0.5 pedestal (YDbDr Db/Dr, YIQ I/Q) or the authentic 128/255 = 0.502 pedestal (studio-swing Cb/Cr) so a bias pushes the colour-difference axes symmetrically; HUE always wraps regardless of the toggle. The third block switches between HSV and HSL with the HSL toggle. YIQ rotates the colour-difference plane onto the orange↔cyan flesh-tone (I) and green↔magenta (Q) axes — one I bias is a whole teal-&-orange grade. Studio-swing compresses into the legal window and decode expands it ~1.16×, so a bias CRUSHES super-black/white the way a proc-amp / legalizer does. TWENTY-TWO outputs run in parallel: pass (the untouched source); rgb / ydbdr / hsvhsl / yiq / ycc (each block's colorized picture); and per-block grayscale channel taps — r / g / b / luma (RGB), ydb_y/db/dr (YDbDr), hsv_h/s/v (HSV·HSL), yiq_y/i/q (YIQ), ycc_y/cb/cr (studio-swing). The mono taps emit the adjusted packed channel as grayscale — a mono I tap is a ready-made skin/warmth key; a hue tap has a hard black↔white seam at hue 0≡1 (the correct grayscale image of a circular quantity). The RGB block additionally has a palette REPLACE mode: three colour swatches remap the adjusted R/G/B channels to chosen output colours (a duotone/tritone recolour) before the rgb output; picking a swatch auto-enables REPLACE and the swatches default to a non-identity teal/orange/violet so the recolour is immediately visible. With no input patched all outputs are opaque black. Only the outputs you PATCH downstream (plus the one you PREVIEW on the card) are actually rendered each frame, so the many taps stay cheap. Patch a source into IN, choose which output to preview on the card, and use the block knobs / channel overrides / palette to recolour, split, or key the picture.

the faceplate

colour of magicinvideorgb_r_cvcvrgb_r_inmono-videorgb_g_cvcvrgb_g_inmono-videorgb_b_cvcvrgb_b_inmono-videoydb_y_cvcvydb_y_inmono-videoydb_db_cvcvydb_db_inmono-videoydb_dr_cvcvydb_dr_inmono-videohsv_h_cvcvhsv_h_inmono-videohsv_s_cvcvhsv_s_inmono-videohsv_v_cvcvhsv_v_inmono-videoyiq_y_cvcvyiq_y_inmono-videoyiq_i_cvcvyiq_i_inmono-videoyiq_q_cvcvyiq_q_inmono-videoycc_y_cvcvycc_y_inmono-videoycc_cb_cvcvycc_cb_inmono-videoycc_cr_cvcvycc_cr_inmono-videopassvideorgbvideoydbdrvideohsvhslvideormono-videogmono-videobmono-videolumamono-videoydb_ymono-videoydb_dbmono-videoydb_drmono-videohsv_hmono-videohsv_smono-videohsv_vmono-videoyiqvideoyiq_ymono-videoyiq_imono-videoyiq_qmono-videoyccvideoycc_ymono-videoycc_cbmono-videoycc_crmono-videoaudiocvgatepitch
31 inputs · 22 outputs · 37 params

inputs

idcablewhat it does
invideoThe source picture. All three blocks read it in parallel. With nothing patched here every output is opaque black.
RGB video stream
rgb_r_cvcvCV that modulates the RGB block's r bias (linear -1..1 additive offset on the red channel).
control voltage (CV); modulates bias_r (additive offset — ±1 CV sweeps the full range, centered on the knob)
rgb_r_inmono-videoMono override for the RGB red channel: when patched, its value REPLACES red before the bias/CV offset and OVER/CLAMP. Accepts a keys/mono-video stream (a full video/image lands legally and is read as its red).
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
rgb_g_cvcvCV that modulates the RGB block's g bias (linear -1..1 offset on green).
control voltage (CV); modulates bias_g (additive offset — ±1 CV sweeps the full range, centered on the knob)
rgb_g_inmono-videoMono override for the RGB green channel (replaces green pre-offset). Accepts keys/mono-video/video/image.
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
rgb_b_cvcvCV that modulates the RGB block's b bias (linear -1..1 offset on blue).
control voltage (CV); modulates bias_b (additive offset — ±1 CV sweeps the full range, centered on the knob)
rgb_b_inmono-videoMono override for the RGB blue channel (replaces blue pre-offset). Accepts keys/mono-video/video/image.
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
ydb_y_cvcvCV that modulates the YDbDr block's y (luma) bias (linear -1..1 offset in the packed 0..1 space).
control voltage (CV); modulates bias_y (additive offset — ±1 CV sweeps the full range, centered on the knob)
ydb_y_inmono-videoMono override for the YDbDr luma (Y) channel, packed 0..1 (replaces Y pre-offset).
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
ydb_db_cvcvCV that modulates the YDbDr Db (blue-yellow chroma) bias (linear -1..1 in packed space).
control voltage (CV); modulates bias_db (additive offset — ±1 CV sweeps the full range, centered on the knob)
ydb_db_inmono-videoMono override for the YDbDr Db chroma channel, packed 0..1 (0.5 = neutral).
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
ydb_dr_cvcvCV that modulates the YDbDr Dr (red-cyan chroma) bias (linear -1..1 in packed space).
control voltage (CV); modulates bias_dr (additive offset — ±1 CV sweeps the full range, centered on the knob)
ydb_dr_inmono-videoMono override for the YDbDr Dr chroma channel, packed 0..1 (0.5 = neutral).
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
hsv_h_cvcvCV that modulates the HSV/HSL block's hue bias (linear -180..180 degrees; hue always wraps).
control voltage (CV); modulates bias_h (additive offset — ±1 CV sweeps the full range, centered on the knob)
hsv_h_inmono-videoMono override for HUE (0..1, wraps): replaces the hue angle before the degree bias.
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
hsv_s_cvcvCV that modulates the HSV/HSL block's saturation bias (linear -1..1 offset).
control voltage (CV); modulates bias_s (additive offset — ±1 CV sweeps the full range, centered on the knob)
hsv_s_inmono-videoMono override for SATURATION (0..1): replaces saturation pre-offset.
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
hsv_v_cvcvCV that modulates the HSV/HSL block's value/lightness bias (linear -1..1 offset).
control voltage (CV); modulates bias_v (additive offset — ±1 CV sweeps the full range, centered on the knob)
hsv_v_inmono-videoMono override for VALUE (HSV) / LIGHTNESS (HSL), 0..1: replaces it pre-offset.
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
yiq_y_cvcvCV that modulates the YIQ block's Y (luma) bias (linear -1..1 offset in packed 0..1 space).
control voltage (CV); modulates bias_yiq_y (additive offset — ±1 CV sweeps the full range, centered on the knob)
yiq_y_inmono-videoMono override for the YIQ luma (Y) channel, packed 0..1 (replaces Y pre-offset).
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
yiq_i_cvcvCV that modulates the YIQ I (orange↔cyan flesh-tone) bias (linear -1..1 in packed space).
control voltage (CV); modulates bias_yiq_i (additive offset — ±1 CV sweeps the full range, centered on the knob)
yiq_i_inmono-videoMono override for the YIQ I chroma channel, packed 0..1 (0.5 = neutral; a warmth/skin key).
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
yiq_q_cvcvCV that modulates the YIQ Q (green↔magenta) bias (linear -1..1 in packed space).
control voltage (CV); modulates bias_yiq_q (additive offset — ±1 CV sweeps the full range, centered on the knob)
yiq_q_inmono-videoMono override for the YIQ Q chroma channel, packed 0..1 (0.5 = neutral).
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
ycc_y_cvcvCV that modulates the studio-swing Y' (studio luma) bias (linear -1..1; decode amplifies it ~1.16×).
control voltage (CV); modulates bias_ycc_y (additive offset — ±1 CV sweeps the full range, centered on the knob)
ycc_y_inmono-videoMono override for the studio-swing luma (Y') channel, encoded 0..1 (blacks ~0.063, whites ~0.922).
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
ycc_cb_cvcvCV that modulates the studio-swing Cb (blue-yellow legal chroma) bias (linear -1..1).
control voltage (CV); modulates bias_ycc_cb (additive offset — ±1 CV sweeps the full range, centered on the knob)
ycc_cb_inmono-videoMono override for the studio-swing Cb chroma channel, encoded 0..1 (0.502 = neutral).
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream
ycc_cr_cvcvCV that modulates the studio-swing Cr (red-cyan legal chroma) bias (linear -1..1).
control voltage (CV); modulates bias_ycc_cr (additive offset — ±1 CV sweeps the full range, centered on the knob)
ycc_cr_inmono-videoMono override for the studio-swing Cr chroma channel, encoded 0..1 (0.502 = neutral).
mono video stream; also accepts: mono still image (keys), RGB still image, RGB video stream

outputs

idcablewhat it does
passvideoThe source video, UNMODIFIED — independent of all three blocks. Opaque black when IN is unpatched.
RGB video stream
rgbvideoThe RGB block's colorized output: per-channel adjusted red/green/blue, then the optional palette REPLACE remap.
RGB video stream
ydbdrvideoThe YDbDr block's colorized output: adjusted Y/Db/Dr decoded back to RGB (the SECAM look).
RGB video stream
hsvhslvideoThe HSV or HSL block's colorized output (per the HSL toggle): adjusted hue/sat/value(lightness) decoded to RGB.
RGB video stream
rmono-videoMono-video: the R channel of the ADJUSTED RGB block as grayscale (before the palette remap).
mono video stream
gmono-videoMono-video: the G channel of the ADJUSTED RGB block as grayscale.
mono video stream
bmono-videoMono-video: the B channel of the ADJUSTED RGB block as grayscale.
mono video stream
lumamono-videoMono-video: Rec.601 luma (0.299R+0.587G+0.114B) of the ADJUSTED RGB block, grayscale.
mono video stream
ydb_ymono-videoMono-video: the adjusted YDbDr luma (Y) channel as grayscale (packed 0..1).
mono video stream
ydb_dbmono-videoMono-video: the adjusted YDbDr Db (blue-yellow) chroma as grayscale (0.5 = neutral).
mono video stream
ydb_drmono-videoMono-video: the adjusted YDbDr Dr (red-cyan) chroma as grayscale (0.5 = neutral).
mono video stream
hsv_hmono-videoMono-video: the adjusted HUE as grayscale (0..1, circular — a hard black↔white seam at 0≡1 is correct, not a defect).
mono video stream
hsv_smono-videoMono-video: the adjusted SATURATION as grayscale (0..1).
mono video stream
hsv_vmono-videoMono-video: the adjusted VALUE (HSV) / LIGHTNESS (HSL) as grayscale (0..1).
mono video stream
yiqvideoThe YIQ block's colorized output: adjusted Y/I/Q decoded back to RGB (the NTSC composite look).
RGB video stream
yiq_ymono-videoMono-video: the adjusted YIQ luma (Y) channel as grayscale (same Rec.601 luma as `luma`).
mono video stream
yiq_imono-videoMono-video: the adjusted YIQ I (orange↔cyan flesh-tone) chroma as grayscale — a ready-made warmth/skin key (0.5 = neutral).
mono video stream
yiq_qmono-videoMono-video: the adjusted YIQ Q (green↔magenta) chroma as grayscale (0.5 = neutral).
mono video stream
yccvideoThe studio-swing block's colorized output: adjusted Y'/Cb/Cr expanded + decoded to RGB (the broadcast-legal crush look).
RGB video stream
ycc_ymono-videoMono-video: the adjusted studio-swing luma (Y') as grayscale (studio range — blacks ~0.063, whites ~0.922).
mono video stream
ycc_cbmono-videoMono-video: the adjusted studio-swing Cb (blue-yellow legal chroma) as grayscale (0.502 = neutral).
mono video stream
ycc_crmono-videoMono-video: the adjusted studio-swing Cr (red-cyan legal chroma) as grayscale (0.502 = neutral).
mono video stream

params

idlabelrangedefaultcurve
bias_rr-1..1linear
bias_gg-1..1linear
bias_bb-1..1linear
bias_yy-1..1linear
bias_dbdb-1..1linear
bias_drdr-1..1linear
bias_hh-180..180deglinear
bias_ss-1..1linear
bias_vv-1..1linear
bias_yiq_yy-1..1linear
bias_yiq_ii-1..1linear
bias_yiq_qq-1..1linear
bias_ycc_yy-1..1linear
bias_ycc_cbcb-1..1linear
bias_ycc_crcr-1..1linear
over_rr wrap0..1discrete
over_gg wrap0..1discrete
over_bb wrap0..1discrete
over_yy wrap0..1discrete
over_dbdb wrap0..1discrete
over_drdr wrap0..1discrete
over_ss wrap0..1discrete
over_vv wrap0..1discrete
over_hh wrap0..1discrete
over_yiq_yy wrap0..1discrete
over_yiq_ii wrap0..1discrete
over_yiq_qq wrap0..1discrete
over_ycc_yy wrap0..1discrete
over_ycc_cbcb wrap0..1discrete
over_ycc_crcr wrap0..1discrete
mode_hslhsl0..1discrete
replacereplace0..1discrete
pal_rr0..0discrete
pal_gg0..0discrete
pal_bb0..0discrete
previewpreview0..21discrete
freezefreeze0..1discrete

controls

controlwhat it does
bb: additive offset on the RGB blue channel, -1 to 1 (default 0). Sums with rgb_b_cv.
dbdb: additive offset on the YDbDr Db (blue-yellow) chroma, -1 to 1 (default 0), around the 0.5 pedestal. Sums with ydb_db_cv.
drdr: additive offset on the YDbDr Dr (red-cyan) chroma, -1 to 1 (default 0), around the 0.5 pedestal. Sums with ydb_dr_cv.
gg: additive offset on the RGB green channel, -1 to 1 (default 0). Sums with rgb_g_cv.
hh: hue rotation for the HSV/HSL block, -180 to 180 degrees (default 0). Hue always wraps. Sums with hsv_h_cv.
rr: additive offset on the RGB red channel, -1 to 1 (default 0 = no change). Sums with the rgb_r_cv input.
ss: additive offset on saturation, -1 to 1 (default 0). Sums with hsv_s_cv.
vv: additive offset on value (HSV) or lightness (HSL), -1 to 1 (default 0). Sums with hsv_v_cv.
yy: additive offset on the YDbDr luma channel (packed 0..1 space), -1 to 1 (default 0). Sums with ydb_y_cv.
cbcb: additive offset on the studio-swing Cb (blue-yellow legal chroma), -1 to 1 (default 0), around the 0.502 pedestal. Sums with ycc_cb_cv.
crcr: additive offset on the studio-swing Cr (red-cyan legal chroma), -1 to 1 (default 0), around the 0.502 pedestal. Sums with ycc_cr_cv.
yy: additive offset on the studio-swing luma (Y'), -1 to 1 (default 0). Decode expands studio→full range, so the offset is AMPLIFIED ~1.16× (the broadcast crush). Sums with ycc_y_cv.
ii: additive offset on the YIQ I (orange↔cyan flesh-tone) chroma, -1 to 1 (default 0), around the 0.5 pedestal — one nudge is a whole teal-&-orange grade. Sums with yiq_i_cv.
qq: additive offset on the YIQ Q (green↔magenta) chroma, -1 to 1 (default 0), around the 0.5 pedestal. Sums with yiq_q_cv.
yy: additive offset on the YIQ luma channel (packed 0..1 space), -1 to 1 (default 0). Sums with yiq_y_cv.
freezefreeze: hidden determinism toggle — at 1 the renderer holds its last rendered frame (no redraw) for stable VRT capture. Default 0; no card control.
hslhsl: selects the third block's colorspace — HSV (0, default) or HSL (1). Affects the hsvhsl output + the v channel's meaning (value vs lightness).
b wrapb wrap: overflow mode for the RGB blue channel (CLAMP default / WRAP).
db wrapdb wrap: overflow mode for the YDbDr Db chroma (CLAMP default / WRAP).
dr wrapdr wrap: overflow mode for the YDbDr Dr chroma (CLAMP default / WRAP).
g wrapg wrap: overflow mode for the RGB green channel (CLAMP default / WRAP).
h wraph wrap: ADVISORY only — hue ALWAYS wraps regardless of this toggle. Declared for UI symmetry with the other channels; disabled on the card.
r wrapr wrap: overflow for the RGB red channel — CLAMP (0, default) clips out-of-range to 0..1; WRAP (1) folds it around via fract().
s wraps wrap: overflow mode for saturation (CLAMP default / WRAP).
v wrapv wrap: overflow mode for value/lightness (CLAMP default / WRAP).
y wrapy wrap: overflow mode for the YDbDr luma channel (CLAMP default / WRAP).
cb wrapcb wrap: overflow mode for the studio-swing Cb chroma (CLAMP default / WRAP — the illegal-chroma fold).
cr wrapcr wrap: overflow mode for the studio-swing Cr chroma (CLAMP default / WRAP — the illegal-chroma fold).
y wrapy wrap: overflow mode for the studio-swing luma (CLAMP clips at the legal boundary — a legalizer; WRAP folds super-white through black).
i wrapi wrap: overflow mode for the YIQ I chroma (CLAMP default / WRAP — WRAP on the narrow-band chroma is the NTSC chroma-crawl fold).
q wrapq wrap: overflow mode for the YIQ Q chroma (CLAMP default / WRAP).
y wrapy wrap: overflow mode for the YIQ luma channel (CLAMP default / WRAP).
bpal b: the palette colour the RGB blue channel maps to under REPLACE (packed 0xRRGGBB, default violet). Set via the card's colour picker.
gpal g: the palette colour the RGB green channel maps to under REPLACE (packed 0xRRGGBB, default teal). Set via the card's colour picker.
rpal r: the palette colour the RGB red channel maps to under REPLACE (packed 0xRRGGBB, default orange). Set via the card's colour picker (which auto-enables REPLACE).
previewpreview: which of the 22 outputs the on-card preview canvas shows (discrete 0..21: 0 pass, 1 rgb, 2 ydbdr, 3 hsvhsl, 4 r, 5 g, 6 b, 7 luma, 8 ydb_y, 9 ydb_db, 10 ydb_dr, 11 hsv_h, 12 hsv_s, 13 hsv_v, 14 yiq, 15 yiq_y, 16 yiq_i, 17 yiq_q, 18 ycc, 19 ycc_y, 20 ycc_cb, 21 ycc_cr). Default 1 (rgb). The previewed output is always rendered even when unpatched; other outputs render only when patched downstream.
replacereplace: turns the RGB palette REPLACE mode on (1) or off (0, default). When on, the adjusted R/G/B channels are recomposed from the three picked palette colours (duotone/tritone). Picking any swatch auto-enables it, and the swatches default to a non-identity teal/orange/violet, so it visibly recolours the rgb out as soon as it is on.

source

colourofmagic.ts on GitHub.

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