-
-
Notifications
You must be signed in to change notification settings - Fork 76
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? #962
Comments
Yes, this is lossless
With same quality?
The same quality or less quality with imagemin-webp? |
By the way, I just realized the quality shouldn't be So I guess you're using the range between 0 and 100? Shouldn't that be consistent with the browser's canvas and set it between 0 and 1? |
I will investigate why there is a difference in speed and size |
Thanks! |
Probably I was wrong... Not exactly sure how, but I swear, the first time I tried, I measured 15% slower times with webp than with png. Now it seems to be the other way around, webp is indeed faster. Both on Ubuntu and windows. Just for the record: On windows I measured: The hardware is the same for both of these. So I guess the only remaining issue is the filesize, which is - for some reason - a lot smaller when I use Thank you for your quick feedbacks @Brooooooklyn |
The underlying webp encoder in this library is The size differences come from the |
@Brooooooklyn I'm a bit confused. 75 quality would mean it's NOT lossless, right? But then, how is it still lossless? |
First of all, I'd like to thank you for this awesome project, it solved a problem I've had for years with node-canvas: mozilla/pdf.js#17188
I know the current version is at pre-release stage, although I'd like to report something, which I think is already "checked" on the roadmap, although I don't think it's actually finished completely.
canvas.toBuffer("image/webp", 100)
is not working perfectly. First of all, it's not very obvious what should happen when I provide100
for quality. Does the image become a lossless webp format in this case? Or it's still lossy with a large filesize?Based on my tests, I've found that when I use
image/webp
, it's significantly slower than if I useimage/png
(about 18% slower), and the filesize produced by it it significantly larger - it produces around 73% larger files compared to when I use imagemin-webpCan we somehow improve these things in the future?
The text was updated successfully, but these errors were encountered: