Reduce device image sizes by 65%
I wrote a custom script that went through all the device images and reduced their size.
Results: Optimized 7537 images 238.0 MB -> 83.1 MB Saved 154.9 MB (65.1%)
I think the savings on the bandwidth for millions of requests will definitely be worth it.
Please let me know if you would like me to retain or remove the script since it was only one-time use.
Could you explain what this script does? We already have the imgbot optimizer
I noticed a lot of 512x512 images were really heavy 300-500kB. But their only purpose is only informative about which device is connected. They don't need to be very detailed. As a result they now weigh 100kB+.
This script takes all the images and reduces their file size without decreasing their resolution. It does some quality optimization (80%).
After the images were optimized I noticed that a lot of them were 32-bit color. Now they are 8-bit colors:
This is actually pretty good. But unfortunately, I think the converted image is quite rough. In comparison, the (manual) conversion from the TinyPNG website algorithm can be much smoother (and smaller) and more "similar" to the original image. This is just my personal opinion. The decision is ultimately up to @Koenkk.
Could you show me an example of the quite rough image quality? When I glanced through the images I didn't realy noticed any visual differences.
Of course if the "roughness" is too much we can decrease the optimization from 80% to 90%
It's not really noticeable at first glance, but upon closer inspection, the difference becomes apparent, at least for me. Here I'll compare it with TinyPNG's algorithm, which is smarter at selecting replacement colors so the difference isn't visible to the human eye. I can only provide a brief example because your PR resources are very heavy to load. I can't search/compare more complex images, for example photos of the original product, etc.
Also please forgive me, perhaps I'm being too picky.
I also wrote the image source and file size in the file name.
roughness/noisier
If you look at the PR result image it looks rougher in converting the color to 8-bit, this is a comparison of TinyPNG which is smarter but larger in size.
Left is converted image, right original image, top PR image, bottom Tinypng.
darker/losing lightness
If you notice the part I marked on the original image (bottom), the PR image loses lightness (?) or becomes darker, compare it with Tinypng which retains its original appearance, while still having a small size.
Once again, I apologize if I'm being too picky.
This pull request is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 30 days