Dithr: buffer-first halftoning and dithering

โš“ Rust    ๐Ÿ“… 2026-04-08    ๐Ÿ‘ค surdeus    ๐Ÿ‘๏ธ 6      

surdeus

Hi all,

I've been working on Dithr, a buffer-first dithering and halftoning library. Dithr is designed around typed mutable slices rather than heavyweight image containers. It implements 35 different halftoning/dithering methods which range from practical methods to some more niche halftoning techniques.

before_dither
after_dither

Before (left) and after (right) using yliluoma_2_in_place.

Features:

  • Buffer-first API over explicit width / height / stride image data.
  • Typed Gray / RGB / RGBA support for u8, u16, and f32.
  • Bayer, Floyd-Steinberg, Stucki, Sierra, Atkinson, Yliluoma 1/2/3, Ostromoukhov, Zhou-Fang, Riemersma, Knuth dot diffusion, direct binary search, lattice-Boltzmann, electrostatic halftoning, and more.
  • Palette-constrained and indexed workflows via Palette<S> and IndexedImage<S>.
  • Optional rayon parallel wrappers for selected stochastic, Yliluoma and ordered families.
  • Optional image adapters for DynamicImage-based pipelines.

github: GitHub - pbkx/dithr: Buffer-first rust dithering and halftoning library. ยท GitHub
crates: crates.io: Rust Package Registry

1 post - 1 participant

Read full topic

๐Ÿท๏ธ Rust_feed