beeware / beeware/briefcase

Backfill icons from provided images

Open
#386 4 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
3.3k
Forks
549
Avg merge
1d 4h
Merged PRs (30d)
40

Description

Briefcase currently requires that the user provide icons of in various formats. However, if you have a high-res PNG format, any other format can be generated by image conversion.

Briefcase should try to use a correctly named file in the right size and format if it's available; but if it isn't, it should try to backfill by converting the high-res PNG to the needed size and format. This should be clearly logged so the end user knows what has happened.

Pillow can be used for most of these operations, but Pillow doesn't currently support ICNS; however, macOS ships with a tool to generate ICNS files from PNGs.

## Creating an ICNS file:

Into a directory named `myicon.iconset`, put files with the following names and sizes:

* `icon_512x512@2x.png`
* `icon_512x512.png`
* `icon_256x256@2x.png`
* `icon_256x256.png`
* `icon_128x128@2x.png`
* `icon_128x128.png`
* `icon_32x32@2x.png`
* `icon_32x32.png`
* `icon_16x16@2x.png`
* `icon_16x16.png`

A 16x16@2x icon is 32x32 pixels; so yes - you need to have 2 copies of the same 32x32 icon (if you're paying close attention to the details you can specify a different icon; however, if you're autoscaling from other sizes, you're not paying that sort of attention).

Then, invoke: `iconutil -c icns myicon.iconset`. This will produce `myicon.icns`.

Contributor guide

Open the contributing guide

Research direction

No source files or tests are named, so first locate Briefcase’s icon-generation path and trace how required icon sizes and formats are selected. Check Pillow for conversion and the macOS `iconutil -c icns` workflow; done means missing assets can be generated from a high-resolution PNG and the fallback is clearly logged.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos, python
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.