2 releases
0.1.1 | Feb 22, 2019 |
---|---|
0.1.0 | Feb 22, 2019 |
#6 in #img
86KB
166 lines
image-toolbox-rs
Image Tool Box Written in Rust based on Piston/Image
Quick to start, different and random Image operations. WIP, many more features to be added.
Feel free to contribute and add new features via a Pull Request.
How to use
In Cargo.toml
[dependencies]
image-toolbox = "*"
The histogram struct
use image_toolbox::{Histogram, load_img};
use image::{DynamicImage};
// load img
let img = load_img("./test/bright_miami.jpg").unwrap();
let histogram = Histogram::new(&img);
println!("{:?}",histogram);
// get the r,g,b probability of some pixel value
let (p_r,p_g,p_b) : (f32,f32,f32) = histogram.probability(200);
turn a TOO bright image into normal colors
use image_toolbox::{load_img,normalize_brightness,save_img};
let img = load_img("./test/bright_miami.jpg").unwrap();
let new_image = normalize_brightness(&img).unwrap();
save_img(&new_image,"./test/result.jpg").unwrap();
before
after
Dependencies
~13MB
~85K SLoC