Closed custa1200 closed 3 years ago
WebP, despite its age, still doesn't have any lossless optimiser. Nobody bothered to write one. So I don't have any tool to integrate here.
WebP is nearly obsolete now. You should use AVIF instead, which is so much better, it can be half size of WebP. Check out my compressor for this: https://github.com/kornelski/cavif-rs
webp is supported by all current browsers and AVIF not, despite the fact that you can save more bandwidth and preserve better quality images with AVIF. https://w3techs.com/technologies/details/im-webp#:~:text=WebP%20is%20used%20by%201.3%25%20of%20all%20the%20websites.
There are multiple webp optimizer with the lossless option like the one on this image. http://www.romeolight.com/products/webpconv/#:~:text=WebPconv%20is%20an%20application%20that,variety%20of%20other%20file%20formats.
The tool you mention uses libwebp
, which as far as I can tell, is the only implementation of WebP in existence. This effectively makes all WebP-related tools identical. They all do the same things using the same library. Adding this library to ImageOptim wouldn't optimize WebP. It would generate the same file again using exactly the same library that has generated it in the first place. In this situation it's impossible to gain anything, you can only worsen quality and get even worse quality/filesize ratio.
Optimization is about replacing an old library with a newer one. WebP has no better implementation.
Apple as part of 11.3 have only just supported WebP at the system level which I would suggest doesn't make it obsolete. Another platform I work with being Roku has also only just recently added WebP as an option in either 9.3 or 9.4 of their OS. With the max app size of Roku being 4MB, any reductions are highly sought after on that platform. Roku only supports JPEG, PNG, GIF(not animated) and just recently WebP, it is highly unlikely they will add another anytime soon.
Another reason why it would be handy for the WebP library to be in ImageOptim would be I use it as a one stop shop with exporting items from Sketch at 100% quality and then set all the image settings I want to use within ImageOptim as the one stop shop. I also do wonder if having WebP in ImageOptim also has the latest version which I'm not sure but could potentially be more up to date that something like Sketch includes. I did a quick test online and even using a lossy WebP at 99% quality I still saw a ~50% reduction in file size for non alpha WebP's and ~20% for alpha channeled
@custa1200 what do you expect the end result would be if libwebp
was added to ImageOptim? Saving a WebP image using the same algo/library again would not improve file size and it would therefore be useless in the context of an optimizer application.
Exactly, if I added libwebp to ImageOptim, you'd get just the green X "nothing to do, 0 bytes saved" case for every WebP image, because nobody has written any other implementation of the encoder.
It could recompress lossy WebP to lower quality, but the VP8 codec is extraordinarily bad for this due to its aggressive in-loop deblocking that blurs things away every time the file is resaved. It reduces the file size, but only by losing more in quality than it should (see the generation loss example below). I consider that a crappy cheat, and I'll leave such bad ideas to other tools that call themselves optimizers, because that's not a real optimization. Recompression is dubious for JPEG too, but at least MozJPEG and Guetzli do a better job than Photoshop and libjpeg, so in such case file size savings outweigh loss in quality. In WebP, recompression loses in quality more than it saves in file size.
If someone wrote an alternative WebP encoder, I could use it, but so far it's just Google's format with Google's implementation.
The real innovation in formats is happening with AVIF and JPEG XL these days. AVIF actually has multiple implementations now, and I could create an optimizer for it!
It would be good to optimise WebP images, i.e using Lossy