Home
Softono
ordered-dithering

ordered-dithering

Open source MIT Python
12
Stars
0
Forks
0
Issues
1
Watchers
5 months
Last Commit

About ordered-dithering

Python implementation of ordered dithering that works with custom palettes.

Platforms

Web Self-hosted

Languages

Python

Links

Ordered dithering

This repository contains an implementation of ordered dithering that works with custom palettes.

Two Python 3 scripts are included. The first is generate_lut.py, which generates a lookup table for a given palette. The second is dither.py, which uses a previously generated lookup table and dithers a given image using it. The scripts require NumPy and Pillow to be installed.

The actual dithering algorithm is very fast when it uses a pre-built lookup table. It handles each pixel individually, and therefore the algorithm is also very easy to implement in a shader to achieve real-time dithering.

Examples

Here are some example images that have been dithered using this algorithm. All examples use the Commodore 64 palette (https://lospec.com/palette-list/commodore64).

Commodore 64 palette

Parrot Dithered Parrot

Lenna Dithered Lenna

RGB Dithered RGB