Bash.tv → GitHub → itch.io

Make a web game download faster by shrinking its images and audio and finding unused files, without breaking it. Converts PNG/JPG to WebP (lossless for pixel art), re-encodes WAV/FLAC and oversized MP3/OGG to small MP3 (optionally OGG too), can scale down huge images, updates every reference in the HTML/JS/CSS/JSON, backs up originals, and lists files nothing uses. Use for "game loads slowly", ...

Download skill (.zip) Files on GitHub

Web asset shrinker

1. Dry run first (changes nothing)

python3 <skill>/scripts/shrink-assets.py www
python3 <skill>/scripts/shrink-assets.py www --max-size 2048     # also scale down giant images

Shows each planned conversion with before and after sizes, files it left alone and why, and files nothing in the code names (“Unused?”). Tell the user the total saving in one line, for example “I can cut the game from 38 MB to 9 MB, mostly the music.”

2. Apply

python3 <skill>/scripts/shrink-assets.py www --apply            # + --ogg to also write .ogg twins
Asset Becomes Notes
PNG/JPG with ≤256 colors (pixel art, flat UI) WebP lossless Pixel-exact
Other PNG/JPG over 8 KB WebP quality 82 (--quality) Keeps transparency
WAV / AIFF / FLAC MP3. Sounds ≤20 s: 128 kbps mono; music: 96 kbps stereo --sfx-kbps, --music-kbps
MP3 / OGG / M4A with a much higher bitrate Re-encoded to the same targets Only if it saves ≥10% (--min-saving)
Fonts over 100 KB Listed only Suggest WOFF2

WebP works in every current browser, including Safari 14+. MP3 plays everywhere, so it’s the safe default. Add --ogg when the game chooses its format in code.

3. Safety rules (built in, but say them)

4. Check

  1. Run the game in the preview and make sure every image and sound still loads (read_preview_console for 404s).
  2. Pixel art: look closely. It should be identical (lossless). Painted art at q82 should look the same. If the user sees a difference, re-run with --quality 90 from the backup.
  3. If the bash-web-game-checkup skill is installed, run it again to confirm the size warnings are gone.

Other ways to load faster

These are code changes, so suggest them and do them when asked: