Skip to main content

load

Function load 

Source
pub fn load<P>(path: P) -> Result<(Vec<Record>, u32, u32), ImageError>
where P: AsRef<Path>,
Expand description

Open the image located at the path specified, return 16 dominant colors.

ยงExamples

let (colors, width, height) = image_palette::load("test.jpg").unwrap();
println!("total: {}", width * height);
for color in colors {
  println!("{}: {}", color.rgb().to_hex(), color.count());
}