-
Notifications
You must be signed in to change notification settings - Fork 121
Squash images #201
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
Squash images #201
Conversation
There's some slight differences caused by the CSS resizing and rounding, but I think it looks okay on the whole.
The signac image didn't respond well to resizing, so I'll exclude that from the thumbnailing:
Scripts updated to exclude signac.png, and to only thumbnail images that exceed 160x80px.
|
Thanks! I was working on doing something similar, but I think your script looks neater. One thing I would like to change, however: high resolution screens can render webpages with 2 physical pixels per CSS pixel. So I'd limit the images 320 x 160 instead of 160 x 80. Obviously this doesn't save quite as much data, but it keeps the logos looking nicer on high-res screens, and it's still a substantial saving (in my test, 3.3 MB to 1.3 MB). (Presumably it's even possible to render >2 pixels per CSS pixel, but we have to draw the line somewhere) Also, it sounds like pngquant does a potentially lossy compression. Is this something you know much about? Can you compare results from pngquant and pngcrush, which appears to focus on lossless compression. |
Sure, I'll update this to use 320 x 160px. I don't know much about the differences between pngquant and pngcrush, but I'll make a second PR with pngcrush for comparison. |
With 320 x 160px:
|
Merged #203. |
For #165 and #200.
Here's a script to thumbnail and compress the images. Let's see how these look.
The PNGs in
assets/
are displayed as:So are thumbnailed to a max 160x80px with Pillow.
Then the PNGs in
assets/
andimg/
are compressed using pngquant.