Skip to content

Instantly share code, notes, and snippets.

@theoretick
Created March 8, 2015 23:49
Show Gist options
  • Save theoretick/a7a98e6164885fa85437 to your computer and use it in GitHub Desktop.
Save theoretick/a7a98e6164885fa85437 to your computer and use it in GitHub Desktop.
extern crate hla_rs;
extern crate image;
use hla_rs::extensions;
use image::GenericImage;
use image::ImageBuffer;
fn main() {
let path = &Path::new("/Users/theoretick/code/rust/hla_rs/Test.png");
let img = image::open(path).unwrap();
let (width, height) = img.dimensions();
//Iterate over all pixels in the image
for pixel in img.pixels() {
println!("{}", pixel.to_rgba());
}
println!("Height: {}, Width: {}", height, width);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment