Skip to content

icon: flatten iOS app icons opaque (App Store 90717), keep Android transparent#37

Merged
GenericJam merged 1 commit into
masterfrom
icon-ios-flatten
Jul 8, 2026
Merged

icon: flatten iOS app icons opaque (App Store 90717), keep Android transparent#37
GenericJam merged 1 commit into
masterfrom
icon-ios-flatten

Conversation

@GenericJam

Copy link
Copy Markdown
Owner

Problem

App Store upload validation rejects an app whose 1024 marketing icon has an alpha channel:

altool error 90717: Invalid large app icon … can't be transparent or contain an alpha channel.

IconGenerator.write_ios_icons just Image.thumbnail!'d the source into each iOS size, so a transparent source (a common design — a rounded badge on transparent corners) produced transparent iOS icons and tripped 90717. The bundled fallback mob_logo iOS assets had the same issue.

Android must not be flattened — adaptive foregrounds + legacy launcher icons rely on transparency, and a flat background renders badly on some launchers. So the fix is platform-specific.

Fix

  • write_ios_icons runs the source through a new flatten_for_ios/2: an alpha-bearing source is composited onto an opaque background via Image.flatten!/2; an opaque source is left untouched.
  • Background colour = explicit :background_color option, else sampled with the same extract_background_color/1 the adaptive Android background uses → the opaque iOS icon and the Android adaptive background share one colour.
  • mix mob.icon threads --adaptive-bg to both platforms.
  • Android paths unchanged (keep transparency).
  • Bundled fallback mob_logo iOS-size PNGs pre-flattened opaque (they can't be flattened at runtime without the image dep). iOS/Android sizes are disjoint files, so Android assets keep their alpha.

Tests

icon_generator_test.exs:

  • transparent source → all iOS icons opaque, all Android icons keep alpha
  • explicit :background_color fills the flattened iOS icon (asserts the centre pixel)
  • opaque source is left unflattened

Verified

Sloppy Joe (rounded-badge transparent icon): the rebuilt IPA passed App Store validation and reached TestFlight (this exact 90717 was how it was found).

ADR: decisions/2026-07-08-ios-icons-flattened-opaque.md.

🤖 Generated with Claude Code

…ansparent

Apple rejects any alpha channel on the App Store marketing icon (error 90717).
write_ios_icons now flattens an alpha-bearing source onto an opaque background
(explicit :background_color or the sampled adaptive-icon colour) before
resizing; an opaque source is untouched. Android keeps transparency — adaptive
foregrounds and legacy launcher icons need it, and a flat background looks bad
on some launchers. mix mob.icon threads --adaptive-bg to both platforms. The
bundled fallback mob_logo iOS assets (can't be flattened at runtime without the
image dep) were pre-flattened opaque; Android-size assets keep their alpha.

Verified on Sloppy Joe: the rebuilt IPA passed App Store validation to TestFlight.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@GenericJam GenericJam merged commit eda462c into master Jul 8, 2026
3 checks passed
@GenericJam GenericJam deleted the icon-ios-flatten branch July 8, 2026 17:57
@GenericJam GenericJam mentioned this pull request Jul 8, 2026
GenericJam added a commit that referenced this pull request Jul 8, 2026
iOS app icons are now flattened onto an opaque background so App Store upload
validation no longer rejects a transparent source (altool error 90717). Android
keeps its adaptive/legacy transparency. (#37)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant