fix(desktop): build macOS icns with sips + iconutil - #596
Draft
liukewia wants to merge 1 commit into
Draft
Conversation
wails3's encoder resizes with Mitchell-Netravali, whose negative lobe overshoots on the logo's high-contrast edges. The R channel clips at 0 while G/B keep mid values, leaving near-opaque dark pixels scattered over the red tile: 4 in the 64px layer, 13 at 128px, 23 at 256px. It also emits only 8 layers, missing icon_16x16 and icon_32x32, so Finder has to downscale a larger layer for small sizes. Generate the .iconset with sips and pack it with iconutil instead. All 10 layers are present and Core Graphics downsampling leaves no overshoot. generate:icons is split because sips and iconutil are macOS-only: the shared task keeps emitting the Windows .ico on every platform, while the new darwin-only task owns the .icns. Co-authored-by: Cursor <cursoragent@cursor.com>
liukewia
marked this pull request as draft
September 7, 2026 11:26
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Dock/Finder icon has visible dark specks at 64, 128 and 256 px.
wails3 generate iconsencodes the.icnsthroughjackmordaunt/icns, whichresizes with Mitchell-Netravali. Its negative lobe overshoots on the logo's
high-contrast edges (white glyph on red, squircle on transparent): the R channel
clips at 0 while G/B keep mid values, producing near-opaque teal-black pixels
such as
(1, 51, 54, 254)scattered across the red tile.Measured against the source image's opaque RGB gamut:
That encoder also emits only 8 layers. Its smallest osType is 32px (
ic11),which icns treats as
icon_16x16@2x— soicon_16x16andicon_32x32areabsent and Finder downscales a larger layer for small sizes.
Change
Build the
.iconsetwithsips -zand pack it withiconutil. All 10 layersare present, and Core Graphics downsampling leaves no overshoot.
generate:iconsis split becausesips/iconutilare macOS-only: the sharedtask still emits the Windows
.icoon every platform, and the newgenerate:icons:darwinowns the.icns. The darwin build depends on the latter(it never needed the Windows
.ico).Verification
Not covered: the source
appicon-macos.pngcarries black RGB in itssemi-transparent edge (4138 px at alpha 6-9, RGB ~
(39,30,30)) — non-premultipliedexport without edge extend. It tints the 256px edge band but stays under
alpha 120, so it is not the speck problem above and would need a fix in the
design source, not the packaging script.