palettize
palettize applies ordered Bayer dithering to images using custom color palettes.
Quick start
[]
= "0.25"
= "0.2"
use ;
let image = open?;
let palette = grayscale;
let output = dither;
output.save?;
# Ok::
Features
- Generate Bayer matrices from 2×2 through 64×64.
- Build palettes from RGB colors, hex values, or grayscale stops.
- Extract palettes with median cut or k-means++ clustering.
- Remap an image's color distribution onto a palette's distribution in Oklab before dithering.
Requirements
This crate requires Rust 1.85 or later, edition 2024.
More examples and documentation
- API documentation — every public type and function.
- Changelog
- Issue tracker
License
Licensed under either of Apache License, Version 2.0 or MIT license at your option.