perf(markdown): retro-optimize committed example PNGs (61.8MB -> 14.9MB) - #489
Merged
Merged
Conversation
61.8MB -> 14.9MB (46.9MB reclaimed), via the new `generate_markdown.py --optimize-only` retro pass (PyAutoHands#247). These pages were rendered before optimize_pngs() shipped, and that function is forward-only — it only ever sees the render in progress. This puts the already committed images through the exact same 256-colour quantize + optimized encode, so these bytes are identical to what a future re-render would emit. Dimensions unchanged; a 29-pair before/after pixel diff put the worst case at 2.69% of pixels differing by >3% intensity, i.e. quantize dithering on smooth colormap gradients. Working tree and future clone-of-tip only — the original blobs remain in git history. PyAutoHands#247 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Workspace half of PyAutoHands#247.
Scripts Changed
None. No file under
scripts/ornotebooks/is touched — this PR changes only the committed output images undermarkdown/, so no notebook regeneration applies.What
generate_markdown.py'soptimize_pngs()is forward-only: it only sees the render in progress, so pages committed before it shipped keep their original PNGs. This puts 196 already-committed images through that exact same 256-colour quantize + optimized encode, using the new--optimize-onlyretro pass.61.8 MB → 14.9 MB (46.9 MB reclaimed).
Because it reuses the same function rather than a one-off
pngquantsweep, these bytes are identical to what a future re-render of the same pages would emit.Verification
markdown/is now modeP; changed-file count matches the unoptimized count exactly.git statusconfirmed onlymarkdown/**/*.pngmodified — nothing outsidemarkdown/.Notes
This shrinks the working tree and future clone-of-tip, not
.githistory — the original blobs remain in the pack. No history rewrite is proposed.Upstream PR
PyAutoLabs/PyAutoHands#248 — adds the
--optimize-onlyflag this PR's contents were produced with. Library-first merge gate: that PR must merge before this one.🤖 Generated with Claude Code