Attempt expand bit depth

This commit is contained in:
Andrew 2023-05-09 20:31:48 +12:00
parent f8a93545ea
commit 0879f678d5

View file

@ -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 // Attempt to reduce the palette
// This may change bytes but should always be beneficial // This may change bytes but should always be beneficial
if opts.palette_reduction && !deadline.passed() { if opts.palette_reduction && !deadline.passed() {