pixelize

Crates.iopixelize
lib.rspixelize
version0.3.1
sourcesrc
created_at2020-02-02 13:50:17.344826
updated_at2020-04-05 11:08:57.354517
descriptionA CLI tool to pixelate your supplied image.
homepagehttps://github.com/geekyme/pixelize
repositoryhttps://github.com/geekyme/pixelize
max_upload_size
id204202
size1,517,512
Shawn Lim (geekyme)

documentation

README

Pixelize crates.io

This crate provides:

  • a CLI tool to pixelate your supplied image
  • a utility pixelize function to do the same thing

CLI Installation

cargo install pixelize

CLI Usage

pixelize -i girl.jpg -o girl_10.jpg -d 10
Original -d 10
Before After @ 10d
-d 20 -d 50
After @ 20d After 50d

Lib Installation

[dependencies]
pixelize = "<version>"

Lib Usage

let opts = pixelize::Options {
  degree: 10,
  preserve_size: false,
};
let in_file = "temp.jpg";
let out_file = "temp_10.jpg";
let buf = fs::read(in_file).unwrap();

let out = pixelize::pixelize(buf.as_slice(), &opts).unwrap();

match out.save(out_file) {
    Ok(_) => println!(
        "{} pixelated with degree {} and saved to {}",
        in_file, &opts.degree, out_file
    ),
    Err(e) => panic!("Error pixelating your image: {}", e),
}
Commit count: 23

cargo fmt