clean app icon script

This commit is contained in:
polv committed 2026-03-24 12:59:56 +07:00
1 parent 9fc970b295
commit 8365c8d635
3 files changed
+2 -3

No files matched your search

+1 -3
View File
@@ -12,7 +12,7 @@ async function resizeAndMakeWhiteTransparent(inputPath, outputPath) {
if (!origW || !origH) throw new Error("Unable to read image dimensions");
const targetW = Math.max(origW, origH);
const targetH = Math.max(origW, origH);
const targetH = targetW;
// Resize and output raw RGBA buffer
const { data, info } = await img
@@ -23,8 +23,6 @@ async function resizeAndMakeWhiteTransparent(inputPath, outputPath) {
const { width: w, height: h, channels } = info; // channels should be 4 (RGBA)
if (channels < 3) throw new Error("Unexpected channel count");
console.log(targetH, targetW, info);
// Modify alpha for near-white pixels
for (let i = 0; i < data.length; i += channels) {
const r = data[i];