From 79e29c6f0240626ee99de6db7c861bf392e2ae6e Mon Sep 17 00:00:00 2001 From: gnxlxnxx Date: Fri, 22 Dec 2023 21:44:13 +0100 Subject: [PATCH] Skip fully transparent pixels --- src/painter/painter.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/painter/painter.rs b/src/painter/painter.rs index bf26a0e..ea1f1b8 100644 --- a/src/painter/painter.rs +++ b/src/painter/painter.rs @@ -67,6 +67,10 @@ impl Painter { // Get the channels let channels = pixel.channels(); + if channels[3] == 0 { + continue; + } + // Define the color let color = Color::from(channels[0], channels[1], channels[2], channels[3]);