//! Decode an image with the exact decoder the hero pipeline uses (the `image` //! crate) and write lossless PNG. Lets the live-GPU hero prototype consume //! bit-identical pixels to the baked path — browsers decode JPEG chroma //! differently, which showed up as a subtle tint in A/B comparisons. //! //! Usage: decode_to_png fn main() { let mut args = std::env::args().skip(1); let (Some(input), Some(output)) = (args.next(), args.next()) else { eprintln!("usage: decode_to_png "); std::process::exit(2); }; let bytes = std::fs::read(&input).expect("read input"); let decoded = image::load_from_memory(&bytes).expect("decode"); decoded .save_with_format(&output, image::ImageFormat::Png) .expect("write png"); println!( "{} {}x{} -> {}", input, decoded.width(), decoded.height(), output ); }