No description
Find a file
2022-01-27 16:46:07 +01:00
src made quantize generic for Image 2022-01-27 16:46:07 +01:00
testdata first commit 2022-01-24 22:33:53 +01:00
.gitignore first commit 2022-01-24 22:33:53 +01:00
Cargo.lock made quantize generic for Image 2022-01-27 16:46:07 +01:00
Cargo.toml made quantize generic for Image 2022-01-27 16:46:07 +01:00
LICENSE Initial commit 2022-01-24 22:27:07 +01:00
README.md updated example in readme 2022-01-24 22:38:16 +01:00

Does quantization in pure rust on Rgba image, using https://crates.io/crates/image

algorithm: https://observablehq.com/@tmcw/octree-color-quantization

inspired by to https://github.com/objectProfessionals/movieMaps

fn quantize_image() -> Result<(), ImageError> {
    let src: RgbaImage = image::open("some_image.jpg").unwrap().into_rgba8();
    let dest = quantize(&src, 256);
    dest.save_with_format("output.jpg", image::ImageFormat::Jpeg)?;
    Ok(())
}