Dither Shader

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

Installation

Run the following command

npx shadcn@latest add @aceternity/dither-shader

Examples

Dither Shader Demo Simple

Dither Shader Demo Duotone

Dither Shader Demo Interactive

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

200+ templates and blocks combined

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

Aceternity UI Pro Demo - Light Mode

Access an ever-growing collection of premium, meticulously crafted templates and Component Blocks.

A product by Aceternity
Building in public at @mannupaaji

© 2026 Aceternity Labs LLC. All Rights Reserved.