[Media] dithr - buffer-first dithering library with 35 halftoning methods

70 points 53071896674746349663 6 comments
[Media] dithr - buffer-first dithering library with 35 halftoning methods

I've been working on Dithr, a buffer-first Rust dithering and halftoning library for image pipelines, designed around typed mutable slices rather than heavyweight image container abstractions. Dithr implements 35 different halftoning/dithering methods which range from practical methods to research-grade halftoning techniques.

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 and ordered families.
  • Optional image adapters for DynamicImage-based pipelines.

github: https://github.com/pbkx/dithr

crates: https://crates.io/crates/dithr