mirror of
https://github.com/storytold/effectcraft.git
synced 2026-10-29 04:26:55 -06:00
Black & White offset each pixel's luminance by (hue weight - 0.5) times its HSL saturation. HSL saturation is near 1 for any tinted near-black pixel, so the code or two of colour noise in compressed footage's shadows came out as bright and black blocks, and a 32-bpc overbright such as (1.5, 0.5, 0.5) divided by zero and went black. The gray is now the pixel's smallest channel plus its chroma (largest - smallest channel) times the same hue-interpolated slider weight. Neutral pixels keep their value, a pure hue becomes its slider's percentage (Reds 40% turns pure red into 40% gray), noise moves the gray by no more than its own size, and nothing divides. The CPU effect and the GPU kernel change the same way.