No description
Find a file
2025-12-29 14:13:00 -08:00
.github/workflows Fix doc site generation 2025-12-29 14:11:36 -08:00
example Fix up example build 2025-12-29 14:02:28 -08:00
src Fix up example build 2025-12-29 14:02:28 -08:00
tests Support grey scale palette 2025-12-26 19:14:52 -08:00
.gitignore Fix up example build 2025-12-29 14:02:28 -08:00
dither.nimble Version 0.2.0 2025-12-29 14:09:32 -08:00
LICENSE Initial commit 2024-01-28 19:27:23 -08:00
README.md Add readme badges 2025-12-29 14:13:00 -08:00

dither-nim

Build License

Dithering algorithms implemented in Nim

API

API Documentation

Algorithms

This library supports two primary classifications of algorithms:

  • Ordered Dithering: This is a fast dithering algorithm that uses a matrix of predefined values to vary what color is selected.
  • Error Diffusion: A slightly slower dithering algorithm that tracks the error incurred when a color is clamped to the palette, then distributes that error to surrounding pixels.

A more detailed list of supported algorithms can be found here:

https://nycto.github.io/dither-nim/dither/types.html#DitherModes

Example

A working example that uses pixie for images and chroma for colors can be seen here:

https://github.com/Nycto/dither-nim/blob/main/example/src/dither_img.nim

A note on concepts

This library uses Nim concepts to control the inputs to its algorithms. This allows it to integrate with arbitrary image, color, and palette libraries -- as long as they implement the interface described by the concepts.