geekyme / pixelize

A CLI tool to pixelate your supplied image

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 d = 10;
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(), d).unwrap();

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

About

A CLI tool to pixelate your supplied image

License:GNU General Public License v3.0


Languages

Language:Rust 100.0%