This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Optimize PNGs
Type: enhancement Stage: patch review
Components: Documentation Versions:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, scop, vstinner
Priority: normal Keywords: patch

Created on 2016-07-07 12:29 by scop, last changed 2022-04-11 14:58 by admin.

Files
File name Uploaded Description Edit
pngs.patch scop, 2016-07-26 15:23
Messages (5)
msg269929 - (view) Author: Ville Skyttä (scop) * Date: 2016-07-07 12:28
Running PNGs through zopflipng makes them smaller, with no drawbacks. This patch was done with zopflipng version 1.0.1 with the -m option, and decreases the in-tree total size size of all *.png by almost 100KiB.

$ find -name "*.png" | xargs du -bc | tail -n 1  # before
291101	total

$ find -name "*.png" | xargs du -bc | tail -n 1  # after
194639	total
msg269930 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-07-07 12:31
Hi, The idea is interesting, but IMO it would be more efficient to contribute to Sphinx, so all documentations will benefit of smallest pictures. There is a similar tool for JPEG. Victor
msg269931 - (view) Author: Ville Skyttä (scop) * Date: 2016-07-07 12:36
Sure, I plan to suggest this to sphinx as well.

One corresponding tool for JPEGs is jpegoptim and its --strip-all option, but there is only ./Mac/BuildScript/resources/background.jpg in the cpython source tree (which despite of the .jpg extension appears to be a PNG file so I don't want to touch that stuff), plus ./Lib/test/imghdrdata/python.jpg which isn't worth a patch alone :)
msg269932 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-07-07 12:38
> there is only ./Mac/BuildScript/resources/background.jpg in the cpython source tree (which despite of the .jpg extension appears to be a PNG file so I don't want to touch that stuff)

Oh funny, you're right: it's a PNG file :-)
msg271377 - (view) Author: Ville Skyttä (scop) * Date: 2016-07-26 15:23
Updated patch against tip.

Before: 289426	total
After:  194638	total
History
Date User Action Args
2022-04-11 14:58:33adminsetgithub: 71648
2018-06-16 15:37:41willingcsetstage: patch review
2016-07-26 15:25:56scopsetfiles: - pngs.patch
2016-07-26 15:25:30scopsetfiles: + pngs.patch

messages: + msg271377
2016-07-07 12:38:03vstinnersetmessages: + msg269932
2016-07-07 12:36:17scopsetmessages: + msg269931
2016-07-07 12:31:58vstinnersetnosy: + vstinner
messages: + msg269930
2016-07-07 12:29:34scopcreate