ainsleyclark / squidge

🖼️ A FREE Wordpress Plugin to compress and convert images using cwebp, jpegoptim and optipng.
GNU General Public License v3.0
42 stars 7 forks source link

feature: Keep only the smallest files #4

Open homlett opened 2 years ago

homlett commented 2 years ago

Hi,

Thanks a lot for this, finally an image optimization plugin that doesn't offend common sense! This is indeed the only right way to do the job, imo. I use a very similar approach, of course with the same underlying tools but entirely via the CLI, mainly when generating static websites, but it also works with live WP. It is essentially based on this great blog post: https://vincent.bernat.ch/en/blog/2021-webp-avif-nginx

So a possible improvement to Squidge might be to keep only the smallest files, as described in the linked blog post. I confirm that some images can surprisingly be smaller in JPEG than in WebP, or smaller in WebP than in AVIF. Also, the 10% delta mentioned is also an interesting idea I think.

Anyway, having this in a WP plugin is awesome.

ainsleyclark commented 2 years ago

Hey @homlett

Thank you very much for your kind words!

I think this is a great improvement. I will add this as a TODO to add in the next release.

Please spread the word about Squidge!

All the best.

ainsleyclark commented 2 years ago

Note: Add setting to Plug-in, to keep smallest files converted.

homlett commented 2 years ago

Thanks for considering this feature! This plugin is gonna to be great. You're right, adding an option in the settings is probably a good idea since some people won't necessarily want to use the smaller files but force a particular format when possible. Also, being able to set the delta (as a percentage) might be interesting for "advanced users". Keep up the good work!