From 6f159755ac8cfdcfd764438f2b1b753b3491c1ec Mon Sep 17 00:00:00 2001 From: Andrew Date: Mon, 31 Oct 2022 18:09:15 +1300 Subject: [PATCH] Improve performance of up --- src/reduction/alpha.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reduction/alpha.rs b/src/reduction/alpha.rs index 145f7fe4..06df0676 100644 --- a/src/reduction/alpha.rs +++ b/src/reduction/alpha.rs @@ -117,8 +117,8 @@ fn reduced_alpha_to_up(png: &PngImage, bpc: usize, bpp: usize) -> Vec { reduced[offset..(offset + bpp - bpc)] .copy_from_slice(&pixel[..(bpp - bpc)]); } - transparent[col] = 0; } + transparent[col] = i32::MIN; // Prevent copying upwards again reduced.extend_from_slice(pixel); line_transparent = false; }