A lossy image compression algorithm, based in a per-block level of detail detection, implemented in Rust.

pixzlr

Crate downloads Crate recent downloads Crate version Last GitHub commit

Installing

Just put pixlzr = "0" as one of the [dependencies] into your Cargo.toml.

Using

```rust use image::{open, DynamicImage}; use pixlzr::{process, treeprocess, treefull_process};

// ...

let image: DynamicImage = open("img.png").expect("Expected an image!");

process(&image, 64, Some(|v| v / 4.0)) .save("img-processed.png") .expect("Error saving the processed image!");

tree_process(&image, 64, 0.25, Some(|v| v / 6.0)) .save("img-processed-tree.png") .expect("Error saving the processed image!");

treefullprocess(&image, 0.25, Some(|v| v / 6.0)) .save("img-processed-tree-full.png") .expect("Error saving the processed image!"); ```

Core concept

Yet to be written...
Please check GitHub:guiga-zalu/smart-pixelizer, as it's the implementation in Node JS.