A lossy image compression algorithm, based in a per-block level of detail detection, implemented in Rust.
Just put pixlzr = "0"
as one of the [dependencies]
into your Cargo.toml
.
```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!"); ```
Yet to be written...
Please check GitHub:guiga-zalu/smart-pixelizer, as it's the implementation in Node JS.