From: Bernie Innocenti Date: Sat, 8 Jul 2017 18:36:21 +0000 (-0400) Subject: Remove alpha from screenshots. X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=60a2f678c55bb31471b04315cb607a17fdcc1c89;p=mandelwow.git Remove alpha from screenshots. --- diff --git a/lib.rs b/lib.rs index 98797f3..21e7a4c 100644 --- a/lib.rs +++ b/lib.rs @@ -26,7 +26,8 @@ pub use shaded_cube::ShadedCube; pub fn screenshot(display : &glium::Display) { let image: glium::texture::RawImage2d = display.read_front_buffer(); let image = image::ImageBuffer::from_raw(image.width, image.height, image.data.into_owned()).unwrap(); - let image = image::DynamicImage::ImageRgba8(image).flipv(); + let image = image::DynamicImage::ImageRgba8(image).flipv().to_rgb(); + let image = image::DynamicImage::ImageRgb8(image); let mut output = std::fs::File::create(&std::path::Path::new("screenshot.png")).unwrap(); image.save(&mut output, image::ImageFormat::PNG).unwrap(); }