From 185cc91c56581d6bb7048bf23fadcaef42b2f191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?East=20Monster=20=F0=9F=8D=89?= <89259667+EastMonster@users.noreply.github.com> Date: Fri, 15 Aug 2025 18:39:55 +0800 Subject: [PATCH] Fixed checkerboard patterns on black pixels (#143) Close #122 --- src/Template.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Template.js b/src/Template.js index b28d8ad..357ec50 100644 --- a/src/Template.js +++ b/src/Template.js @@ -214,10 +214,12 @@ export default class Template { imageData.data[pixelIndex] = 0; imageData.data[pixelIndex + 1] = 0; imageData.data[pixelIndex + 2] = 0; - imageData.data[pixelIndex + 3] = 32; // Translucent black - } else { // Transparent negative space - imageData.data[pixelIndex + 3] = 0; + } else { + imageData.data[pixelIndex] = 255; + imageData.data[pixelIndex + 1] = 255; + imageData.data[pixelIndex + 2] = 255; } + imageData.data[pixelIndex + 3] = 32; // Make it translucent } else if (x % shreadSize !== 1 || y % shreadSize !== 1) { // Otherwise only draw the middle pixel imageData.data[pixelIndex + 3] = 0; // Make the pixel transparent on the alpha channel } else {