Dithering with CSS
CSS can apply noise dithering to images at render time using SVG filters, letting sites enforce a consistent aesthetic without pre-processing every asset.
What Matters
-
SVG
feTurbulencewithbaseFrequency 0.90,numOctaves 1, andseed 2generates the noise layer. -
feCompositearithmetic mode blends noise into the image using k1–k4 coefficients (e.g., k2 0.75, k3 0.35). - Two-tone mode maps output to configurable dark/light values, enforcing strict palette conformance.
- Runtime dithering trades processing flexibility for storage efficiency; pre-dithering assets remains faster at scale.