fix(mobile): derive dark palettes from artwork regions #80

Merged
joshuafhiggins merged 3 commits from t3/match-album-color-algorithm into t3/ipad-sidebar-layout 2026-11-13 21:50:28 -05:00
Owner

The iOS artwork extractor could pick small colored details over dominant black or white regions, and the old palette rules exaggerated shadow tints.

This samples a 64-pixel sRGB histogram, clusters nearby colors in Oklab, and derives the canvas from regional color, overall color, coverage, and shadow agreement. Shared lightness/chroma calibration replaces the yellow and magenta hue exceptions. Primary text and controls stay white. Reference targets are isolated in a measurement fixture that runtime code never imports; there are no album IDs or title checks in the algorithm.

Depends on #79, and targets its branch. Main-to-branch screenshots include that parent work as well. Android retains its platform extractor and uses the revised shared palette derivation.

Exact matching is not achieved. On the nine measured iOS backgrounds, RGB RMSE is 2.43 channel values, compared with 15.80 for the previous PR head. Broadway Wicked matches exactly; the remaining backgrounds differ by up to 6/255 in a channel. This measures flat canvases, not full UI equality. The exact-match comparison command correctly exits with failure.

Validation: mobile TypeScript and six focused tests pass. All nine revised iPad canvases were pixel-sampled from simulator screenshots and equal the derivation output exactly. All nine albums were recaptured on Android too. Existing iOS/Android development binaries were reused because this iteration changes only TypeScript; the native sampler builds passed in the previous revision.

Run node --test apps/mobile/lib/cover-palette.test.cjs apps/mobile/lib/color-histogram.test.cjs for focused checks. Run node apps/mobile/lib/cover-palette.compare.cjs --exact for the unmet exact-match acceptance check.

Before: main d5c956c. After: 0c1aa73, based on #79 at 6766711. iPad Air 11-inch M2, iOS 27.2, full-screen landscape. Pixel 10 emulator, portrait. Apple Music references are the original supplied files. Main screenshots use main's own native builds; after screenshots use the branch's development builds and current JavaScript.

Wicked: The Soundtrack
Apple Music reference iPad main iPad after
Apple Music reference iPad main iPad after
Android main Android after
Android main Android after
Wicked (Original Broadway Cast Recording)
Apple Music reference iPad main iPad after
Apple Music reference iPad main iPad after
Android main Android after
Android main Android after
The Prince of Egypt
Apple Music reference iPad main iPad after
Apple Music reference iPad main iPad after
Android main Android after
Android main Android after
Civilization VI
Apple Music reference iPad main iPad after
Apple Music reference iPad main iPad after
Android main Android after
Android main Android after
The Ramblin' Rover
Apple Music reference iPad main iPad after
Apple Music reference iPad main iPad after
Android main Android after
Android main Android after
I Wanna Be In the Cavalry
Apple Music reference iPad main iPad after
Apple Music reference iPad main iPad after
Android main Android after
Android main Android after
City of Angels
Apple Music reference iPad main iPad after
Apple Music reference iPad main iPad after
Android main Android after
Android main Android after
We The Kings
Apple Music reference iPad main iPad after
Apple Music reference iPad main iPad after
Android main Android after
Android main Android after
Counter-Strike 2
Apple Music reference iPad main iPad after
Apple Music reference iPad main iPad after
Android main Android after
Android main Android after

Created with gpt-6.1-sol in the Codex harness through T3 Code.

The iOS artwork extractor could pick small colored details over dominant black or white regions, and the old palette rules exaggerated shadow tints. This samples a 64-pixel sRGB histogram, clusters nearby colors in Oklab, and derives the canvas from regional color, overall color, coverage, and shadow agreement. Shared lightness/chroma calibration replaces the yellow and magenta hue exceptions. Primary text and controls stay white. Reference targets are isolated in a measurement fixture that runtime code never imports; there are no album IDs or title checks in the algorithm. Depends on [#79](https://gitcoffee.dev/joshuafhiggins/otunes/pulls/79), and targets its branch. Main-to-branch screenshots include that parent work as well. Android retains its platform extractor and uses the revised shared palette derivation. **Exact matching is not achieved.** On the nine measured iOS backgrounds, RGB RMSE is 2.43 channel values, compared with 15.80 for the previous PR head. Broadway Wicked matches exactly; the remaining backgrounds differ by up to 6/255 in a channel. This measures flat canvases, not full UI equality. The exact-match comparison command correctly exits with failure. Validation: mobile TypeScript and six focused tests pass. All nine revised iPad canvases were pixel-sampled from simulator screenshots and equal the derivation output exactly. All nine albums were recaptured on Android too. Existing iOS/Android development binaries were reused because this iteration changes only TypeScript; the native sampler builds passed in the previous revision. Run `node --test apps/mobile/lib/cover-palette.test.cjs apps/mobile/lib/color-histogram.test.cjs` for focused checks. Run `node apps/mobile/lib/cover-palette.compare.cjs --exact` for the unmet exact-match acceptance check. Before: main `d5c956c`. After: `0c1aa73`, based on #79 at `6766711`. iPad Air 11-inch M2, iOS 27.2, full-screen landscape. Pixel 10 emulator, portrait. Apple Music references are the original supplied files. Main screenshots use main's own native builds; after screenshots use the branch's development builds and current JavaScript. <details> <summary>Wicked: The Soundtrack</summary> | Apple Music reference | iPad main | iPad after | | --- | --- | --- | | ![Apple Music reference](https://files.gitcoffee.dev/files/reference-wicked-soundtrack-xtjlh9cph8pnlcqo.png) | ![iPad main](https://files.gitcoffee.dev/files/ipad-main-wicked-soundtrack-xqspunv2xtz9sypf.png) | ![iPad after](https://files.gitcoffee.dev/files/ipad-after-wicked-soundtrack-mqjpdgm6ziqdmynr.png) | | Android main | Android after | | --- | --- | | ![Android main](https://files.gitcoffee.dev/files/android-main-wicked-soundtrack-pvqtn7mbuxstcdnp.png) | ![Android after](https://files.gitcoffee.dev/files/android-after-wicked-soundtrack-ozbjknxsq84rvi7s.png) | </details> <details> <summary>Wicked (Original Broadway Cast Recording)</summary> | Apple Music reference | iPad main | iPad after | | --- | --- | --- | | ![Apple Music reference](https://files.gitcoffee.dev/files/reference-wicked-broadway-povlwex8plyxieip.png) | ![iPad main](https://files.gitcoffee.dev/files/ipad-main-wicked-broadway-eqrqriqgbegeel3v.png) | ![iPad after](https://files.gitcoffee.dev/files/ipad-after-wicked-broadway-f4lxrgqo5ne6vc98.png) | | Android main | Android after | | --- | --- | | ![Android main](https://files.gitcoffee.dev/files/android-main-wicked-broadway-nghavsvnvhw3uebe.png) | ![Android after](https://files.gitcoffee.dev/files/android-after-wicked-broadway-p67e2bzsydyjfeau.png) | </details> <details> <summary>The Prince of Egypt</summary> | Apple Music reference | iPad main | iPad after | | --- | --- | --- | | ![Apple Music reference](https://files.gitcoffee.dev/files/reference-prince-of-egypt-aozmhfyle9lp8p1b.png) | ![iPad main](https://files.gitcoffee.dev/files/ipad-main-prince-of-egypt-ht2s9fspuvtzwfpl.png) | ![iPad after](https://files.gitcoffee.dev/files/ipad-after-prince-of-egypt-r3oh0gu3w4ttzoca.png) | | Android main | Android after | | --- | --- | | ![Android main](https://files.gitcoffee.dev/files/android-main-prince-of-egypt-s8aoxbjiqqad2s8t.png) | ![Android after](https://files.gitcoffee.dev/files/android-after-prince-of-egypt-3m7ujmbuqryie4ez.png) | </details> <details> <summary>Civilization VI</summary> | Apple Music reference | iPad main | iPad after | | --- | --- | --- | | ![Apple Music reference](https://files.gitcoffee.dev/files/reference-civilization-vi-l2wsokgetgcpm1qb.png) | ![iPad main](https://files.gitcoffee.dev/files/ipad-main-civilization-vi-kzr4lhg8io1qnel7.png) | ![iPad after](https://files.gitcoffee.dev/files/ipad-after-civilization-vi-dk3lipyo7z8fsjht.png) | | Android main | Android after | | --- | --- | | ![Android main](https://files.gitcoffee.dev/files/android-main-civilization-vi-jijajiebn4rh0xaz.png) | ![Android after](https://files.gitcoffee.dev/files/android-after-civilization-vi-3bfsopv7a43t4uc8.png) | </details> <details> <summary>The Ramblin' Rover</summary> | Apple Music reference | iPad main | iPad after | | --- | --- | --- | | ![Apple Music reference](https://files.gitcoffee.dev/files/reference-ramblin-rover-col38mifjrhkb1dp.png) | ![iPad main](https://files.gitcoffee.dev/files/ipad-main-ramblin-rover-9lsyabxkf3pwci8h.png) | ![iPad after](https://files.gitcoffee.dev/files/ipad-after-ramblin-rover-xoguykxvawyimlaj.png) | | Android main | Android after | | --- | --- | | ![Android main](https://files.gitcoffee.dev/files/android-main-ramblin-rover-wr7ashht3ofpxjje.png) | ![Android after](https://files.gitcoffee.dev/files/android-after-ramblin-rover-uwzmroymdf1m8bme.png) | </details> <details> <summary>I Wanna Be In the Cavalry</summary> | Apple Music reference | iPad main | iPad after | | --- | --- | --- | | ![Apple Music reference](https://files.gitcoffee.dev/files/reference-cavalry-zhwureslh2o8s2rg.png) | ![iPad main](https://files.gitcoffee.dev/files/ipad-main-cavalry-pdtaybuu2w3ipucx.png) | ![iPad after](https://files.gitcoffee.dev/files/ipad-after-cavalry-xyowbbjgwwucaixd.png) | | Android main | Android after | | --- | --- | | ![Android main](https://files.gitcoffee.dev/files/android-main-cavalry-zg7k6l6ggt846hk2.png) | ![Android after](https://files.gitcoffee.dev/files/android-after-cavalry-7nrui56fghwvkwfy.png) | </details> <details> <summary>City of Angels</summary> | Apple Music reference | iPad main | iPad after | | --- | --- | --- | | ![Apple Music reference](https://files.gitcoffee.dev/files/reference-city-of-angels-iwtbnaqnfh1xrifb.png) | ![iPad main](https://files.gitcoffee.dev/files/ipad-main-city-of-angels-juwekkqsjpyrbqid.png) | ![iPad after](https://files.gitcoffee.dev/files/ipad-after-city-of-angels-azmarvazx8clrlmf.png) | | Android main | Android after | | --- | --- | | ![Android main](https://files.gitcoffee.dev/files/android-main-city-of-angels-dxn4dx3cgshjt5ir.png) | ![Android after](https://files.gitcoffee.dev/files/android-after-city-of-angels-epysb3zu1suh8cuk.png) | </details> <details> <summary>We The Kings</summary> | Apple Music reference | iPad main | iPad after | | --- | --- | --- | | ![Apple Music reference](https://files.gitcoffee.dev/files/reference-we-the-kings-fxujfl2qumq3mhlr.png) | ![iPad main](https://files.gitcoffee.dev/files/ipad-main-we-the-kings-yx28f6eamcod6xzj.png) | ![iPad after](https://files.gitcoffee.dev/files/ipad-after-we-the-kings-xywqrgh7nvo9lssp.png) | | Android main | Android after | | --- | --- | | ![Android main](https://files.gitcoffee.dev/files/android-main-we-the-kings-irifwgegwldfzrqd.png) | ![Android after](https://files.gitcoffee.dev/files/android-after-we-the-kings-yf0nkm3mcxuo9qwf.png) | </details> <details> <summary>Counter-Strike 2</summary> | Apple Music reference | iPad main | iPad after | | --- | --- | --- | | ![Apple Music reference](https://files.gitcoffee.dev/files/reference-counter-strike-2-ecztc4s5hrvlhq49.png) | ![iPad main](https://files.gitcoffee.dev/files/ipad-main-counter-strike-2-rtqqk8kobl1dlyp5.png) | ![iPad after](https://files.gitcoffee.dev/files/ipad-after-counter-strike-2-9g8x1j24l6ysyehs.png) | | Android main | Android after | | --- | --- | | ![Android main](https://files.gitcoffee.dev/files/android-main-counter-strike-2-cd4m6zajzgeqd6bb.png) | ![Android after](https://files.gitcoffee.dev/files/android-after-counter-strike-2-dvprfgic9ssybmox.png) | </details> Created with gpt-6.1-sol in the Codex harness through T3 Code.
joshuafhiggins changed title from fix(mobile): extract artwork colors from dominant regions to fix(mobile): derive dark palettes from artwork regions 2026-11-09 13:08:56 -05:00
joshuafhiggins added 2 commits 2026-11-13 21:45:44 -05:00
joshuafhiggins force-pushed t3/match-album-color-algorithm from 0c1aa736bf to a1a1987d7c 2026-11-13 21:45:44 -05:00 Compare
joshuafhiggins added 1 commit 2026-11-13 21:50:01 -05:00
joshuafhiggins merged commit 0376a0837e into t3/ipad-sidebar-layout 2026-11-13 21:50:28 -05:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: joshuafhiggins/otunes#80