From 0879f678d56b44d2ece81ae90ee758af567b5a62 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 9 May 2023 20:31:48 +1200 Subject: [PATCH] Attempt expand bit depth --- src/reduction/mod.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/reduction/mod.rs b/src/reduction/mod.rs index e07f57db..f53a8f3c 100644 --- a/src/reduction/mod.rs +++ b/src/reduction/mod.rs @@ -57,6 +57,15 @@ pub(crate) fn perform_reductions( } } + // Attempt to expand the bit depth to 8 + // This does need to be evaluated but will be done so later when it gets reduced again + if opts.bit_depth_reduction && !deadline.passed() { + if let Some(reduced) = expanded_bit_depth_to_8(&png) { + png = Arc::new(reduced); + reduction_occurred = true; + } + } + // Attempt to reduce the palette // This may change bytes but should always be beneficial if opts.palette_reduction && !deadline.passed() {