flozz / yoga-image-optimizer

A graphical tool to convert and optimize JPEG, PNG and WebP images (based on YOGA)
https://yoga.flozz.org
GNU General Public License v3.0
138 stars 11 forks source link

Ability to trade off guetzli+mozjpeg's "perfect optimization" for a faster "mozjpeg-only" live encoding mode #15

Open nekohayo opened 2 years ago

nekohayo commented 2 years ago

Bonjour, Yoga is a very interesting app, and it could almost replace Squoosh for me, were it not for the excruciatingly slow guetzli-based JPEG encoding.

I would like to have the ability to have Yoga encode purely with MozJPEG instead of needing all this fancy AI perceptual encoding stuff. I value mozjpeg's 0.5 second encoding time much more than absolute perfect quality (because if I was looking for perfection, I'd be doing JPEG XL ;) Waiting 2 minutes per HD JPEG is too much for me, especially when you are batch-encoding hundreds of them (I don't want to wait hours with my 8-cores Xeon pegged burning at 100% utilization, for what would take a minute or two with mozjpeg), or when I am encoding them one by one on a "as needed" basis (like I would do with Squoosh) when doing web integration work; in that particular case I am processing images one by one, as they come and as the website is being built, so having to wait over a minute for each image interrupts my work.

I would like to be able to set a standard preferred size to downsize to, standard preferred encoder (mozjpeg for JPEGs), drag and drop files into the app, hit convert... actually, mozjpeg is so fast to convert that you would not even need to have a convert button, you could create and live-overwrite/update the file in realtime!

flozz commented 2 years ago

I am thinking about this, but I do not know what I will do at the end... I want to keep YOGA and YOGA Image Optimizer as simple as possible, and adding options make it more complicated... I have to make choice between options vs simplicity.

nekohayo commented 2 years ago

I totally respect that "single code pathway" maintenance approach. If it is any help, my 2¢ biased opinion is that it should be mozjpeg, trading off "absolute perfection with 2-10% gains (?) that most humans can't perceive" for "150-200x the speed", but maybe that's just me :)

nekohayo commented 4 months ago

A new backwards-compatible contender intended to replace mozjpeg, from one of the authors of JPEG XL: https://opensource.googleblog.com/2024/04/introducing-jpegli-new-jpeg-coding-library.html

This might be the perfect tradeoff you're looking for... reportedly better than mozjpeg, but just as fast (so an order of magnitude faster than guetzli), if I understand correctly.

flozz commented 4 months ago

jpegli is already on my TODO list for YOGA. I have to test it to check its efficiency, I will probably have to implement Pyhon bindings for it and to add it to YOGA if everything is OK. And only then, I may be able to update YOGA Image Optimizer (the GUI) with it shipped in. :)