Skip to content

Backdrop: sampled-color gradient instead of stretched blurred artwork - #96

Merged
sanylax0 merged 2 commits into
mainfrom
claude/repo-review-improvements-yvk3t7-backdrop-palette
Jul 18, 2026
Merged

sanylax0 merged 2 commits into
mainfrom
claude/repo-review-improvements-yvk3t7-backdrop-palette

Conversation

@sanylax2

Copy link
Copy Markdown
Collaborator

What

Supersedes #95 (this branch contains its pager restructure commit plus the new renderer — close #95 in favor of this). Per the Apple Music / Spotify reference screenshots: those apps don't stretch a blurred image at all — they paint a smooth vertical gradient sampled from the artwork's colors. This adopts that treatment.

How

  • AlbumBackdrop renders a two-stop LinearGradient ([top, bottom] palette per artwork URL), crossfading on track change; seed-gradient fallback while sampling and for demo tracks. A light top/bottom scrim anchors the status bar and chevron labels.
  • BackdropRenderer now samples instead of rendering bitmaps: fetch the sharpest available thumbnail tier (maxresdefault → sddefault → stored hqdefault), CIAreaAverage over the top and bottom halves, then tone-map — hue preserved, saturation softened (≤ 0.55), brightness pinned (0.45 top → 0.14 bottom) so near-white or near-black art still yields a legible, colored-dark backdrop.
  • Full-bleed is structural (carried over from Higher-quality full-bleed Now Playing backdrop #95's commit): the backdrop is the Now Playing page's .background behind the insets in MainPagerView, so it covers the entire screen including the status-bar band — no image, no resolution, no bands.
  • Zero per-frame render cost is preserved (one tiny sampling pass per URL, cached) — the jetsam fix is untouched.

Testing

On device: backdrop should look like the Spotify reference — a clean dominant-color wash fading darker toward the bottom, edge-to-edge, crisp at any size, crossfading smoothly between tracks. Knobs if you want a different mood: the two brightness pins (0.45/0.14) and the saturation cap (0.55) in BackdropRenderer.toneMapped/samplePalette.

🤖 Generated with Claude Code

https://claude.ai/code/session_013TJoWkqg8bzkGdzxWhWjWP


Generated by Claude Code

claude added 2 commits July 18, 2026 18:08
Three regressions from the cached-backdrop change, fixed together:

- The blur looked blocky: 40 px nearest-tier upscale was too coarse.
  BackdropRenderer now works on a 160 px square with a real clamped
  gaussian (sigma 20), matching the old live radius-60 look — still a
  one-time render per URL, zero per-frame cost.
- The source art was soft: the renderer now tries maxresdefault and
  sddefault before falling back to the stored hqdefault thumbnail.
- The blur didn't fill the screen (black band at the top): safe-area
  piercing doesn't survive inside scroll content, so the backdrop now
  lives as the Now Playing page's BACKGROUND behind hard insets in
  MainPagerView — backgrounds cover the full padded frame, bars
  included. homeLayout no longer embeds its own backdrop.
The upscaled-image blur still read as low-res and left dark bands. Do
what Apple Music and Spotify do instead: sample the artwork's dominant
colors (CIAreaAverage over top/bottom halves of the sharpest available
thumbnail tier), tone-map them into a muted dark band where white
content always reads, and paint a smooth vertical gradient. A gradient
has no resolution, always fills the screen, and keeps the zero
per-frame render cost of the jetsam fix. Crossfades between palettes on
track change; seed-gradient fallback while sampling / for demo tracks.
@sanylax0
sanylax0 merged commit eb7b2ae into main Jul 18, 2026
1 of 4 checks passed
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.

3 participants