Skip to content
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

Lossless WebP support #406

Open
CAFxX opened this issue Feb 14, 2023 · 1 comment
Open

Lossless WebP support #406

CAFxX opened this issue Feb 14, 2023 · 1 comment

Comments

@CAFxX
Copy link

CAFxX commented Feb 14, 2023

For WebP images saved in lossless mode (whether a WebP image was saved in lossless mode can be checked using the webpinfo command), ImageOptim should attempt to recompress them using cwebp -z <level>, and replace the source file if the resulting file is smaller.

This also strips the metadata attached to the image, like other lossless PNG/GIF/JPEG optimizers do.

Based on experience, many lossless WebP images in the wild are not compressed using the highest lossless compression level, so it is not surprising for lossless re-compression of losslessly-compressed WebP images to yield a 5-10% drop in file size, obviously without loss in image quality. While it's true that there's only one single WebP encoder in existence, it is also true that the highest compression level (9) is not the default (as the default is 6).

I know that WebP support has been requested before but the reasons provided for rejection do not really hold up to scrutiny, as the points made above should hopefully clarify.

While it's true that there are newer image formats that can perform better, it is also true that WebP is still going to be needed in a number of contexts for the foreseeable future (e.g. Android apps with wide Android SDK compatibility, non-modern browsers, etc.)

@kornelski
Copy link
Member

That is interesting. Given that WebP now has full browser support, I'll revisit that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants