-
-
Notifications
You must be signed in to change notification settings - Fork 33k
gh-71648: Optimize PNG files #138842
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-71648: Optimize PNG files #138842
Conversation
# Conflicts: # Doc/faq/python-video-icon.png
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest not messing with the images that don't shrink by multiple KB. Shaving off several bytes, even if it's a significant percentage of the total size, will wind up increasing the size of the overall repository anyway by adding a new blob, without meaningfully shrinking the size of any particular checkout.
It might be worth adding a pre-commit check (or workflow?) to check that images are not larger than they need to be when added or changed. |
This PR now only optimizes images where the savings are over 1 kb. |
Thanks @StanFromIreland for the PR, and @gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
Sorry, @StanFromIreland and @gpshead, I could not cleanly backport this to
|
Sorry, @StanFromIreland and @gpshead, I could not cleanly backport this to
|
* Only keep > 1 kb savings (cherry picked from commit 2e8f64c) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
GH-138851 is a backport of this pull request to the 3.14 branch. |
* Only keep > 1 kb savings (cherry picked from commit 2e8f64c) Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
GH-138852 is a backport of this pull request to the 3.13 branch. |
|
OptiPNG version 7.9.1
Used command is:
find . -name '*.png' | xargs optipng -o7
Combined png size on main:
Combined png size on pr:
That's a ~10% saving (without loss of quality).
Prior art: #8032