Skip to content

Perf-1: Compress background images to WebP (~97% size reduction)#11

Draft
snackman wants to merge 1 commit intomainfrom
worktree-agent-a174bb50
Draft

Perf-1: Compress background images to WebP (~97% size reduction)#11
snackman wants to merge 1 commit intomainfrom
worktree-agent-a174bb50

Conversation

@snackman
Copy link
Owner

@snackman snackman commented Mar 3, 2026

Summary

  • Converted pizza shop background from 12.7MB local PNG to ~205KB WebP served from CDN
  • Converted counter from 904KB PNG to ~13KB WebP on CDN
  • Deleted unused landscape background (2.9MB dead weight)
  • Added asset preloader with progress bar on splash screen
  • Total savings: ~15.6MB removed from git repo, ~97% size reduction

Changes

  • GameBoard.tsx — CDN bg("pizza-shop-background.webp") instead of local PNG import
  • App.tsxbg('counter.webp') instead of bg('counter.png')
  • index.html — Removed preload hint for old PNG
  • NEW: src/lib/spriteManifest.ts — PRELOAD_BACKGROUNDS array
  • NEW: src/hooks/useAssetPreloader.ts — Background preloader with loading bar
  • SplashScreen.tsx — Integrated preloader with progress bar
  • Deleted: public/pizza shop background v2.png, public/landscape version pizza chef.png

Test plan

  • Background renders correctly, no visible quality loss
  • Network tab shows <500KB background from CDN
  • Splash screen loading bar includes background
  • No 404 errors for old PNG paths
  • Counter image renders correctly

🤖 Generated with Claude Code

- Convert 12.7MB pizza shop background to 205KB WebP (98% reduction)
- Convert 904KB counter to 13KB WebP (99% reduction)
- Delete unused 2.9MB landscape image
- Serve backgrounds from CDN instead of local public/
- Add asset preloader with loading bar on splash screen
- Total: 15.6MB removed from repo

Co-Authored-By: Claude Opus 4.6 <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