Introducing Aceternity UI Pro - 70+ premium component packs and templates to build amazing websites.
Logo

Dither Shader

A real-time ordered dithering effect for images, perfect for pixel art and retro aesthetics.

Open in

Installation

Run the following command

npx shadcn@latest add @aceternity/dither-shader

Examples

Dither Shader Demo Simple

Open in

Dither Shader Demo Duotone

Open in

Dither Shader Demo Interactive

Open in

Props

DitherShader Props

PropTypeDefaultDescription
srcstring-Source image URL
gridSizenumber4Size of the dithering grid cells
ditherMode"bayer" | "halftone" | "noise" | "crosshatch""bayer"Type of dithering pattern
colorMode"original" | "grayscale" | "duotone" | "custom""original"Color processing mode
invertbooleanfalseInvert the dithered output colors
pixelRationumber1Pixelation multiplier (1 = no pixelation, higher = more pixelated)
primaryColorstring"#000000"Primary color for duotone mode
secondaryColorstring"#ffffff"Secondary color for duotone mode
customPalettestring[]["#000000", "#ffffff"]Custom color palette array for custom mode
brightnessnumber0Brightness adjustment (-1 to 1)
contrastnumber1Contrast adjustment (0 to 2, 1 = normal)
backgroundColorstring"transparent"Background color behind the dithered image
objectFit"cover" | "contain" | "fill" | "none""cover"Object fit behavior
thresholdnumber0.5Threshold bias for dithering (0 to 1)
animatedbooleanfalseEnable animation effect
animationSpeednumber0.02Animation speed (lower = slower)
classNamestring-Additional CSS classes for the container (use this to set size via Tailwind)

Build websites faster and 10x better than your competitors with

Aceternity UI Pro

Next.js 15, Tailwind CSS v4 and Motion for react powered templates

70+ templates and component blocks combined

Ready to copy paste component blocks, save days of development time

Aceternity UI Pro Demo - Light Mode
A product by Aceternity
Building in public at @mannupaaji