[][src]Crate image_toolbox

Quick to start, different and random Image operations. Feel free to contribute and add new features via a Pull Request.

How to use

In Cargo.toml

This example is not tested
[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

This example is not tested
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(&img,"./test/result.jpg").unwrap();

Structs

Histogram

Histogram representation of an image represents the distribution of Red,Green,Blue pixels in an image.

Enums

Pix

used to represent pixel color type in Histogram struct

Functions

load_img

Load any type of image uses DynamicImage type.

normalize_brightness

transform a very bright image into normal brightness based on histogram equalization wrapper for transform_from_histogram function.

save_img

Save an image to disk

transform_from_histogram

turn a very bright image into a normal looking one by using histogram equalization.

transform_pixel