Dither
Dither images or animated procedural waves with configurable color and pattern controls.
Overview
Dither applies ordered, halftone, noise, or crosshatch patterns to images and procedural waves. Both sources share the same pixelation, tone, inversion, quantization, and palette controls.
The playground uses free Unsplash photographs by Martin Péchy and Marc Wieland.
Installation
Usage
Procedural waves
import { DitherShader } from "honestui/shaders"
<DitherShader
className="h-80 rounded-xl"
sourceMode="waves"
waveColor="#a5f3fc"
waveFrequency={3}
enableMouseInteraction
/>Wave mode animates by default. Set animated={false} to render a static field.
Image
<DitherShader
alt="Blue and orange apartment buildings against a clear sky."
className="h-80 rounded-xl"
colorMode="duotone"
primaryColor="#111827"
secondaryColor="#f97316"
src="https://images.unsplash.com/photo-1553933420-77617bac448e?auto=format&fit=crop&w=1600&q=85"
/>Remote image hosts must allow cross-origin image use so the canvas can read its pixels. Use a same-origin image when you control the asset pipeline. Larger canvases and smaller grid cells require more work, especially when animation is enabled.
Accessibility
In image mode, write alt text for the image's purpose and context; use an empty string when the image is decorative. The source image provides the accessible content and remains visible if canvas processing fails. Wave mode is decorative, its pointer interaction is optional, and animation stops when the user enables reduced motion.