Function image_colors::fetch_colors_img
[−]
[src]
pub fn fetch_colors_img(img: &DynamicImage, depth: usize) -> ColorCounts
Returns a ColorCounts
pixel to count vector for a image
Arguments
- 'image' - A Image reference to the instance of the picture
- 'depth' - How many pixels from the image to ingest
Example
fn main() { let filepath = &Path::new("path/to/file.jpg"); let img = image::open(filepath).expect("File couldn't be opened!"); let _colors = image_colors::fetch_colors_img(&img, 5); }