You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I took the liberty to apply tools that optimize the binary weight (without loss of quality) of the 14 PNG files present in the Python 3.7 source tree and then applied a pull request (bpo-2141).
Sorry for the late reply. I had to deal with stuff.
serhiy.storchaka:
What tools did you use, optipng, advpng, pngcrush, pngnq, pngquant, or other? How much space is saved?
I had half a crate of whiskey that day so I'm going to say optipng and pngcrush were used and if my recollection is good the saved space was ≈ 5 to 50 % depending on the file.
Note that some tools remove an information about palette that makes files displaying differently on different platforms and output devises.
I am aware of that. But if I understood correctly these files are rendered in documentation, and I don't think they're going to do this in a PlayStation 2. There may be complaints with Windows XP users because I remember for sure that optimized PNG files could not render very well back in those days.
haypo:
I suggest to work on Sphinx to propose to implement this optimization on the HTML rendering, maybe with optional external tools. What do you think?
Like you I'm very fond of a long-term proper solution and that is, by the way, the solution you deserve.
Unfortunately, I do not have the skills for provide that. I can only give the solution you need (which is smaller files).
Activity
tiagofilipesilva commentedon Jun 13, 2017
I took the liberty to apply tools that optimize the binary weight (without loss of quality) of the 14 PNG files present in the Python 3.7 source tree and then applied a pull request (bpo-2141).
Is there anything to be discussed? Thanks.
serhiy-storchaka commentedon Jun 14, 2017
What tools did you use, optipng, advpng, pngcrush, pngnq, pngquant, or other? How much space is saved?
Note that some tools remove an information about palette that makes files displaying differently on different platforms and output devises.
vstinner commentedon Jun 14, 2017
I suggest to work on Sphinx to propose to implement this optimization on the HTML rendering, maybe with optional external tools. What do you think?
Another attempt: bpo-27461 :-)
tiagofilipesilva commentedon Jul 14, 2017
Sorry for the late reply. I had to deal with stuff.
serhiy.storchaka:
I had half a crate of whiskey that day so I'm going to say optipng and pngcrush were used and if my recollection is good the saved space was ≈ 5 to 50 % depending on the file.
I am aware of that. But if I understood correctly these files are rendered in documentation, and I don't think they're going to do this in a PlayStation 2. There may be complaints with Windows XP users because I remember for sure that optimized PNG files could not render very well back in those days.
haypo:
Like you I'm very fond of a long-term proper solution and that is, by the way, the solution you deserve.
Unfortunately, I do not have the skills for provide that. I can only give the solution you need (which is smaller files).
methane commentedon Jun 30, 2018
It seems PR author removed his repository and the PR can't be merge via conflict.
In master branch:
02:18 $ ll **/.png
-rw-r--r-- 1 inada-n staff 3732 7 1 02:13 faq/python-video-icon.png
-rwxr-xr-x 1 inada-n staff 49648 7 1 02:09 howto/logging_flow.png
-rw-r--r-- 1 inada-n staff 24719 7 1 02:09 library/depgraph-output.png
-rw-r--r-- 1 inada-n staff 11148 7 1 02:09 library/hashlib-blake2-tree.png
-rw-r--r-- 1 inada-n staff 11280 7 1 02:09 library/pathlib-inheritance.png
-rw-r--r-- 1 inada-n staff 45021 7 1 02:09 library/tulip_coro.png
-rw-r--r-- 1 inada-n staff 39585 7 1 02:09 library/turtle-star.png
-rw-r--r-- 1 inada-n staff 48994 7 1 02:13 using/win_installer.png
In lossless_png branch:
methane commentedon Jun 30, 2018
03:19 $ find . -name '*.png' | xargs optipng -o7
03:20 $ ll **/*.png
-rw-r--r-- 1 inada-n staff 2888 7 1 03:20 faq/python-video-icon.png
-rw-r--r-- 1 inada-n staff 22058 7 1 03:20 howto/logging_flow.png
-rw-r--r-- 1 inada-n staff 11146 7 1 03:20 library/hashlib-blake2-tree.png
-rw-r--r-- 1 inada-n staff 6456 7 1 03:20 library/pathlib-inheritance.png
-rw-r--r-- 1 inada-n staff 36812 7 1 03:20 library/tulip_coro.png
-rw-r--r-- 1 inada-n staff 33808 7 1 03:20 library/turtle-star.png
-rw-r--r-- 1 inada-n staff 42117 7 1 03:20 using/win_installer.png
While this output is bigger than PR-2141, I think it's good enough.
methane commentedon Jul 1, 2018
New changeset c6cd164 by INADA Naoki in branch 'master':
bpo-30660: Doc: Optimize PNG files by optipng (GH-8032)
c6cd164