Dither Canvas & Pixelation

Ordered Bayer matrix and Floyd-Steinberg error-diffusion quantization engine with theme-adaptive palette mapping.

Interactive Playground

Source Type

Sample Artwork

Custom URL

Matrix Algorithm

Variant

Pixelation Factor1.00x
Pixelation Factor1.00x

Anatomy

import { DitherCanvas } from "@shavin/fx";

<DitherCanvas
  src="/assets/hq_marshall.jpg"
  algorithm="bayer8x8"
  color="accent"
  scale={1.2}
  className="rounded-[var(--radius-panel)]"
/>

Examples

Bayer 8×8 Ordered Dithering

High-frequency 64-level ordered dither pattern with true RGB preservation.

High-frequency 64-level ordered dither pattern with true RGB preservation.
<DitherCanvas
  src="/assets/hq_marshall.jpg"
  algorithm="bayer8x8"
  color="default"
  scale={1.0}
  className="max-w-xs"
/>

Bayer 4×4 Coarse Dithering

16-level matrix with theme accent mapping for coarse 8-bit retro crunch.

16-level matrix with theme accent mapping for coarse 8-bit retro crunch.
<DitherCanvas
  src="/assets/hq_marshall.jpg"
  algorithm="bayer4x4"
  color="accent"
  scale={1.6}
  className="max-w-xs"
/>

Real-Time Video Dithering (60 FPS GPU)

Hardware-accelerated WebGL Bayer dithering on live streaming video.

Hardware-accelerated WebGL Bayer dithering on live streaming video.
<DitherCanvas
  src="/assets/dither-sample.mp4"
  algorithm="bayer8x8"
  color="accent"
  scale={1.4}
  autoPlay={true}
  loop={true}
  muted={true}
  className="max-w-md rounded-[var(--radius-panel)]"
/>

Props Reference

PropTypeDefaultDescription
srcstring | ThemedValue<string>"/assets/hq_marshall.jpg"Image or Video URL / path (.jpg, .png, .webp, .svg, .mp4, .webm, blob).
color"default" | "true" | "accent" | "monochrome" | string"default"Color mapping mode ("default" preserves source RGB, "accent" tints with theme accent, "monochrome" renders high-contrast B&W, or custom hex string).
algorithm"bayer8x8" | "bayer4x4" | "floyd-steinberg""bayer8x8"Dithering threshold matrix or error diffusion algorithm.
scalenumber1.0Pixelation scale factor multiplier.
mediaType"auto" | "image" | "video""auto"Explicit media type override (auto-detects from extension or blob).
thresholdnumber128Dither bias threshold (0 to 255).
autoPlaybooleantrueFor video sources: automatically play video on mount.
loopbooleantrueFor video sources: loop playback indefinitely.
mutedbooleantrueFor video sources: mute audio track for autoplay compatibility.
playsInlinebooleantrueFor video sources: play inline on mobile browsers.
Configure Theme
Theme
Accent Color
Custom
Gray Family
Appearance
Radius
Scaling
Panel Style
Heading Font
Body Font