Skip to content

Optimize app icon PNGs losslessly - #664

Merged
hannesa2 merged 1 commit into
gitx:masterfrom
tagliala:chore/optimize-app-icon-pngs
Sep 17, 2026
Merged

hannesa2 merged 1 commit into
gitx:masterfrom
tagliala:chore/optimize-app-icon-pngs

Conversation

@tagliala

@tagliala tagliala commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Losslessly optimize the two PNG source layers of the app icon (Resources/AppIcon.icon/Assets/). These assets are used in production: they compose the macOS app icon at build time via Resources/AppIcon.icon/icon.json (layers border and +++---).

No pixels change — verified byte-identical (SHA-256 of decoded RGBA pixels before/after). border.png is re-encoded as an 8-bit palette and +++---.png as a 1-bit palette; dimensions are unchanged.

Command used:

optipng -o7 -strip all Resources/AppIcon.icon/Assets/border.png Resources/AppIcon.icon/Assets/+++---.png

Before / After

File Before (B) After (B) Saved (B) Saved %
Resources/AppIcon.icon/Assets/border.png 49,734 14,579 35,155 70.7%
Resources/AppIcon.icon/Assets/+++---.png 5,677 242 5,435 95.7%
Total 55,411 14,821 40,590 73.3%

Resources/Images/Preferences/Updates.png was already optimally compressed (36,779 B before and after), so it is left untouched.

Changes were made at the request of the PR author; the work was carried out by Big Pickle AI.

Build verification

Ran xcodebuild locally on this branch to confirm the optimized icon layers compile and ship correctly.

  • Build result: BUILD SUCCEEDED (exit 0). The only hiccup was pre-existing and unrelated to this change: MGScopeBar pins MACOSX_DEPLOYMENT_TARGET=10.13, below the current SDK minimum (12.0); worked around for the local check with MACOSX_DEPLOYMENT_TARGET=12.0 on the command line.
  • Icon pipeline: the .icon source (Resources/AppIcon.icon) was compiled by Xcode into Contents/Resources/AppIcon.icns (42.7 KB) inside the built GitX.app, and Info.plist points CFBundleIconFile/CFBundleIconName at AppIcon.
  • Round-trip: iconutil -c iconset decodes the built .icns back into a valid iconset with all expected icon sizes, so the compiler accepted the palette-based PNGs.
  • Pixel fidelity: the two source layers are byte-identical to master (SHA-256 of decoded RGBA pixels), so the composed icon is guaranteed visually unchanged.

So the optimized border.png (8-bit palette) and +++---.png (1-bit palette) are consumed by the production icon build and render as before.

Verification performed by Big Pickle AI at the request of the PR author.

Shrink the two source layers of the app icon with optipng at
maximum effort, stripping ancillary chunks. Pixels are identical;
each is re-encoded as an indexed palette.

Command: optipng -o7 -strip all <file>

border.png:  49,734 -> 14,579 bytes (-70.7%)
+++---.png:   5,677 ->    242 bytes (-95.7%)
@hannesa2
hannesa2 merged commit 01bb16f into gitx:master Sep 17, 2026
2 checks passed
@tagliala
tagliala deleted the chore/optimize-app-icon-pngs branch September 17, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants