This is a hastily-made app designed to reverse-engineer macOS icon metrics.
Starting in macOS 26, app icons are no longer simple images. Developers are required to create icons with Icon Composer and then have Xcode generate various image assets at compile time. This does not work if your application is running within another app (such as "Python.app") – your app icon will always be the one specified by the parent.
The only way to change your app icon is -[NSApplication setApplicationIconImage:]. This API does not automatically apply any kind of styling – it's up to you to mimic the appearance of the system icons.
It's extremely difficult to reproduce the background gradient and inner shadow effect in code. For matplotlib Issue 31895, we generate macos_appicon_darkbg26.png and macos_appicon_darkbg27.png and composite a transparent version of our logo on top of the opaque background.
- Create a blank icon in Icon Composer.
- Launch app with blank icon.
- Call
-[NSApplication applicationIconImage]to fetch the blank icon. Note that this has slightly different metrics than the embedded.icnsfiles in the app bundle. As matplotlib uses-[NSApplication setApplicationIconImage:], these are the metrics that we need. - Dilate/bleed the pixels surrounding the edge of the squircle. Search for "alpha bleeding", "color bleeding", "edge padding", "alpha dilation" to understand this problem.
- Save the result as an opaque PNG file.
- For best results, switch "Icon & widget style" to "Dark".
- Launch AppIconReverser.
- Use the "Exporter" window to export both a background image and a reference image. The Exporter will try to detect the length of the app icon squircle and default to an image
(length + 2)pixels wide/high. - Open the "Reverser" window. Drag the exported background image into "Content Image" and the exported reference image into "Reference Image".
- Change the view mode to "Diff (White, 8x)". Adjust the Squircle Length to remove as much darkness from the top of the squircle as possible. This should result in the same number as "Detected Length" during export:

- Adjust Shadow Opacity and Shadow Blur to remove darkness from the sides of the squircle:

- Adjust Shadow Offset to remove darkness from the bottom of the squircle:

- Adjust Squircle Radius to remove darkness from the corners:

| macOS 11-15 | macOS 26 - 27 | |
|---|---|---|
| Squircle Length | 206 | 208 |
| Squircle Radius | 45.5 | 54.5 |
| Shadow Opacity | 30 | 25 |
| Shadow Offset | 3 | 3 |
| Shadow Blur | 3 | 4.8 |
The files in this repository are dedicated to the public domain.
SPDX-License-Identifier: CC0-1.0