From d43d85d258f8125d67ec3beb8389ca531b1bc280 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 2 Nov 2021 17:22:48 -0400 Subject: Write PNG frames faster --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index d4c39fb..9107079 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,7 +14,7 @@ use crate::frontier::Frontier; use clap::{self, clap_app, crate_authors, crate_name, crate_version}; use image::{self, ColorType, ImageError, Rgba, RgbaImage}; -use image::png::PngEncoder; +use image::png::{CompressionType, FilterType, PngEncoder}; use rand::{self, SeedableRng}; use rand_pcg::Pcg64; @@ -391,7 +391,7 @@ impl App { let stdout = io::stdout(); let writer = BufWriter::new(stdout.lock()); - let encoder = PngEncoder::new(writer); + let encoder = PngEncoder::new_with_quality(writer, CompressionType::Rle, FilterType::NoFilter); encoder.encode(image, image.width(), image.height(), ColorType::Rgba8)?; Ok(()) -- cgit v1.2.3