🖼️

Image Dither

Reduce an image to a limited colour palette with Floyd-Steinberg dithering

GET 10 credits /v1/image/dither
curl "https://image.toolkitapi.io/v1/image/dither?url=https://toolkitapi.io/static/samples/sample-image.png&colors=16&format=png"
import httpx

resp = httpx.get(
    "https://image.toolkitapi.io/v1/image/dither?url=https://toolkitapi.io/static/samples/sample-image.png&colors=16&format=png",
)
print(resp.json())
const resp = await fetch("https://image.toolkitapi.io/v1/image/dither?url=https://toolkitapi.io/static/samples/sample-image.png&colors=16&format=png", {
});
const data = await resp.json();
console.log(data);
# See curl example
Response 200 OK
{
  "image": "iVBORw0KGgoAAAANSUhEUg...(base64 data)...",
  "format": "png",
  "colors": 16,
  "size": {"width": 1920, "height": 1080}
}

Try It Live

Live Demo

Description

Reduce an image to a limited colour palette with Floyd-Steinberg dithering

How to Use

1

1. Provide the source image via the `url` query parameter.

2

2. Set `colors` to the desired palette size (2–256). Lower values create more dramatic retro effects.

3

3. Choose `format` as png or gif. GIF is ideal for palette-limited images.

4

4. The response includes the dithered image and the palette size used.

About This Tool

Use the Image Dither endpoint to reduce an image to a limited colour palette using Floyd-Steinberg dithering and median cut quantization. This creates a stylised, retro look and dramatically reduces file size.

Dithering is essential for GIF preparation (which supports a maximum of 256 colours), creating pixel art aesthetics, and achieving retro-styled visuals. The result maintains the appearance of more colours than are actually present through the dithering pattern.

Why Use This Tool

Frequently Asked Questions

What dithering algorithm is used?
Floyd-Steinberg dithering with median cut quantization. This distributes quantization error to neighbouring pixels, creating the illusion of more colours than the palette actually contains.
What is the minimum number of colours?
You can go as low as 2 colours for a dramatic 1-bit bitmap effect (black and white with dithering).
Why does my dithered image look larger than expected?
PNG files with dithering patterns can sometimes be larger than the original JPEG because the dithering pattern reduces PNG's compression efficiency. Try GIF format for palette-limited images.

Start using Image Dither now

Get your free API key and make your first request in under a minute.