use image::io::Reader;
use pixtra::canvas::Canvas;
use pixtra::utility::{count_colors, counted_colors_to_html};
use std::path::Path;
fn main() {
let canvas = Canvas::load(&Path::new("testing.png")).unwrap();
let colors = count_colors(&canvas);
let output = counted_colors_to_html(&colors);
println!("{}", output);
canvas.save(Path::new("here.png")).expect("To be saved");
println!("Test");
}
fn identify(p: &Path) -> String {
let reader = Reader::open(p).unwrap().with_guessed_format().unwrap();
reader
.format()
.unwrap()
.extensions_str()
.get(0)
.unwrap()
.to_owned()
.to_string()
}