From 7fe145dbef7e6fae817d6b8263ea340032e7562a Mon Sep 17 00:00:00 2001 From: Jon Staab Date: Wed, 8 Jul 2026 08:57:33 -0700 Subject: [PATCH] Trim padding on push logo --- scripts/generate-notification-icon.mjs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/generate-notification-icon.mjs b/scripts/generate-notification-icon.mjs index 789cc3f7..b98f9a90 100644 --- a/scripts/generate-notification-icon.mjs +++ b/scripts/generate-notification-icon.mjs @@ -22,8 +22,13 @@ const generate = async (size, out) => { const pad = Math.round(size * 0.14) const inner = size - pad * 2 - // The logo's alpha channel is the shape we want to render. + // The logo's alpha channel is the shape we want to render. Trim the source's + // own transparent margin first — logo.png carries ~15% baked-in padding, and + // without trimming that stacks on top of `pad` below, leaving the glyph at + // only ~half the icon's width. Trimming lets `pad` be the single source of + // padding so the shape actually fills the status-bar icon. const alpha = await sharp(source) + .trim({threshold: 1}) .resize(inner, inner, {fit: "contain", background: {r: 0, g: 0, b: 0, alpha: 0}}) .ensureAlpha() .extractChannel(3)