Docs / Components / Dither Image

Dither Image

A high-performance dithering component for images and videos with multiple algorithms (Bayer, Floyd-Steinberg, Halftone, etc.) and real-time color palette mapping.

Installation

Run the following command in your terminal to add the component to your project:

1npx rankflow-ui@latest add dither

Props Reference

PropTypeDefaultDescription
srcstring'https://images.unsplash.com/photo-1550684848-fac1c5b4e853?q=80&w=1470&auto=format&fit=crop'Source image URL.
altstring''Accessibility text.
fit'cover' | 'contain' | 'fill' | 'none''cover'CSS object-fit behavior.
gridSizenumber4Pixelation/grid size.
ditherModeDitheringMode'bayer'Dithering algorithm: 'bayer', 'bayer8', 'floyd', 'halftone', 'noise', 'crosshatch'.
thresholdnumber0.5Dither threshold bias (0-1).
colorMode'grayscale' | 'duotone' | 'original' | 'custom''grayscale'Color mapping mode.
primaryColorstring'#000000'Dark color for duotone modes (hex).
secondaryColorstring'#ffffff'Light color for duotone modes (hex).
invertbooleanfalseInvert final colors.
brightnessnumber0Brightness offset (-1 to 1).
contrastnumber1Contrast multiplier (0 to 2).
animatedbooleanfalseAnimate the dither pattern (works with noise mode).
animationSpeednumber0.02Speed of animation increment.