Skip to content

perf: compress large images (images/ 44.7 MB -> 36.6 MB) - #332

Merged
ShixiangWang merged 1 commit into
mainfrom
perf/image-compression
Oct 11, 2026
Merged

ShixiangWang merged 1 commit into
mainfrom
perf/image-compression

Conversation

@ShixiangWang

Copy link
Copy Markdown
Member

What

Lossy-compress the largest images in images/ so every deployed page ships smaller payloads. images/ goes from 44.7 MB → 36.6 MB (−8.1 MB in git blob terms, 43 files), on top of PR #331's −95 MB site-level dedup.

Method

Group Tool Result
PNGs > 200 KB (52) pngquant --quality=65-90 --speed 1 --strip 38 compressed, 13 skipped (<8% saving or below quality floor), 1 not a real PNG
JPEGs > 200 KB (7, incl. one .png that is actually JPEG) PIL re-encode quality=82, optimize, progressive 5 compressed, 2 skipped (<8%)

No file was renamed or moved — all existing QMD references stay valid. Files ≤200 KB untouched.

Validation

  • ✅ PIL verify() passes on all images under images/ (0 broken)
  • ✅ Visual fidelity proxy on the largest files (downscaled 64×64 mean-abs channel diff vs original): 0.12–0.40 / 255 — visually indistinguishable
  • ✅ Zero leftover temp files (*.pq.png, *.rej)
  • ✅ Per-file savings 9–72%; biggest: Wordcloud_plot1.png 709K→204K (−72%), AreaChart_app3.png 1181K→353K (−71%), Wordcloud_demo.png 1152K→373K (−68%)

Context

Part of #306 (repo/deploy size reduction), following #331 (zh site_libs/images dedup, −75 MB per deploy artifact).

🤖 Generated with Claude Code

Reduce the images/ tree from 44.7 MB to 36.6 MB (43 files changed,
-8.1 MB in git blob terms) with no reference or filename changes:

- PNGs >200 KB: pngquant --quality=65-90 --speed 1 --strip
  (256-color quantization; 38 of 52 candidates compressed, 13
  skipped for <8% saving or below the quality floor, 1 not a real
  PNG)
- JPEGs (including one mislabeled .png that is actually JPEG):
  PIL re-encode at quality=82, progressive, optimize (5 of 7)

Validation:
- PIL verify() passes on every image under images/ (0 broken)
- downscaled mean-abs channel diff vs originals on the largest
  files: 0.12-0.40 / 255 (visually indistinguishable)
- no filenames or paths changed, so all QMD references remain valid

Co-Authored-By: Claude Code <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ QMD Format Check

No new QMD tutorial files to check.

Automated check by the PR Review workflow.
See contribution guidance for the expected tutorial format.

@ShixiangWang
ShixiangWang merged commit 8ab408b into main Oct 11, 2026
5 checks passed
@ShixiangWang
ShixiangWang deleted the perf/image-compression branch October 11, 2026 19:12
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