Skip to content

osxbundle: add and generate new macOS 26 compatible App icon - #17127

Closed
Akemi wants to merge 2 commits into
mpv-player:masterfrom
Akemi:mac_icon
Closed

osxbundle: add and generate new macOS 26 compatible App icon#17127
Akemi wants to merge 2 commits into
mpv-player:masterfrom
Akemi:mac_icon

Conversation

@Akemi

@Akemi Akemi commented Dec 13, 2025

Copy link
Copy Markdown
Member

alternative to #16926. generated with mpv-player/random-stuff#6

this is a lazy macOS 26 compatible icon. it just uses our current icon at 1024x1024px for an Icon Composer project. it tries to preserve the current colour scheme, see remark on the PR mentioned above. it also deactivates all the liquid glass effects, because they don't work well with raster images. for a proper macOS 26 icon we need a properly layered (layered in Icon Composer) vector image(s).

the macOS theming only works with the bundle but not from the CLI. see remarks on the first commit.

add the Icon Composer project to generate all icon variants with it.

actool will generate an Assets.car file which is compatible with all the
new Theme variants of macOS 26 (default, dark, monochrome, tinted, etc).
it also generates an old icns file as a fallback, only default style.

since the new Assets.car file can't be used from cocoa directly, without
using private APIs, we still use the icns file when used from CLI.
this also means that from CLI only the default icon is used and the
macOS theming doesn't have any effect.

the macOS theming mechanism only works with the bundle and a Assets.car
file. all icons are generated on the fly depending on the Theme. this
generation has no public API and the mechanism would need to be
replicated by hand. to replicate this behaviour at least three different
icns would need to be generated, tinting needs to be implemented,
several system events need to be subscribed, and this wouldn't guarantee
the same look as the system mechanism. also none of the tools make it
possible to generate macOS 26 compatible icns file, besides for the
default file, since it at least is missing the necessary padding.

just some generation infos:

// convert Icon Composer file to Assets.car file
// https://www.hendrik-erz.de/post/supporting-liquid-glass-icons-in-apps-without-xcode
// man actool 
actool ./icon.icon \
  --compile ./ \
  --app-icon icon \
  --enable-on-demand-resources NO \
  --development-region en \
  --target-device mac \
  --platform macosx \
  --include-all-app-icons \
  --minimum-deployment-target 10.15 \
  --output-partial-info-plist /dev/null \
  --standalone-icon-behavior all
  
// extract old icns file from Assets.car file, only default appearance
// https://www.alansiu.net/2023/04/24/extracting-icons-from-assets-car-on-macos/
iconutil -c icns Assets.car icon -o test.icns
  
// extract specific variation out of a Icon Composer file
// rendition: Default, Light, Dark, TintedLight, TintedDark, ClearLight, ClearDark
// ictool (System, Xcode) not the same as ictool (Icon Composer)
// does only extract images without padding (padding is needed for new macOS 26 look)
// https://mjtsai.com/blog/2025/10/02/how-to-export-a-mac-icon-file-with-the-proper-margins/
// https://www.macscripter.net/t/a-script-to-create-tahoe-looking-icons-from-existing-png-or-icns-files/77424/2
/Applications/Xcode.app/Contents/Applications/Icon\ Composer.app/Contents/Executables/ictool icon.icon --export-image --output-file output.png --platform macOS --rendition Default --width 1024 --height 1024 --scale 2

// convert iconset folder to old icns file
iconutil -c icns icon/default.iconset

default, dark, clear light, clear dark, tinted light, tinted dark:

dafault dark clear light clear dark tinted light tinted dark quicklook

@Akemi
Akemi force-pushed the mac_icon branch 4 times, most recently from be3ea98 to 66d290b Compare December 13, 2025 18:46
add the Icon Composer project to generate all icon variants with it.

actool will generate an Assets.car file which is compatible with all the
new Theme variants of macOS 26 (default, dark, monochrome, tinted, etc).
it also generates an old icns file as a fallback, only default style.

since the new Assets.car file can't be used from cocoa directly, without
using private APIs, we still use the icns file when used from CLI.
this also means that from CLI only the default icon is used and the
macOS theming doesn't have any effect.

the macOS theming mechanism only works with the bundle and a Assets.car
file. all icons are generated on the fly depending on the Theme. this
generation has no public API and the mechanism would need to be
replicated by hand. to replicate this behaviour at least three different
icns would need to be generated, tinting needs to be implemented,
several system events need to be subscribed, and this wouldn't guarantee
the same look as the system mechanism. also none of the tools make it
possible to generate macOS 26 compatible icns file, besides for the
default file, since it at least is missing the necessary padding.
use the newly generates App icons for the bundle. keep the old icns file
as fallback for older macOS versions.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this icon is in oxsbundle and not with other icons in repository?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you mean that specific png, then it's because it's within the Icon Composer project folder (icon.icon). we have to keep that folder structure.

if you mean the whole Icon Composer project folder (icon.icon), i just kept it besides the bundle close to where the old icon was. so not much of a reason. if you prefer i can move the whole folder to /etc, since we move the generated icon files into the bundle anyway?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, we already have icons in etc/ directory.

@Akemi

Akemi commented Dec 14, 2025

Copy link
Copy Markdown
Member Author

sadly we can't generate the various icons in our pipelines with the actool and the Icon Composer project because only the latest xcode 26 has support for this.

see as alternative #17131

@Akemi Akemi closed this Dec 14, 2025
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