Issue 626 in webp: When using the -quality 100 parameter to process webp images, the output result size is too large and does not meet expectations.

553 views
Skip to first unread message

lingy… via monorail

unread,
Nov 29, 2023, 10:07:50 PM11/29/23
to webp-d...@webmproject.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 626 by lingy...@gmail.com: When using the -quality 100 parameter to process webp images, the output result size is too large and does not meet expectations.
https://bugs.chromium.org/p/webp/issues/detail?id=626

What steps will reproduce the problem?
1. use libwebp to process a webp image
2. convert input.webp -quality 97 output97.webp
3. convert input.webp -quality 98 output98.webp
4. convert input.webp -quality 99 output99.webp
5. convert input.webp -quality 100 output100.webp

What is the expected output? What do you see instead?
expected output: output100.webp's size is a little bit larger than output100.webp

actual:
➜ Downloads ls -lh | grep output
-rw-r--r--@ 1 640K 11 30 10:31 output100.webp
-rw-r--r--@ 1 214K 11 30 11:02 output97.webp
-rw-r--r--@ 1 223K 11 30 11:02 output98.webp
-rw-r--r--@ 1 235K 11 30 10:30 output99.webp


What version of the product are you using? On what operating system?

➜ Downloads cwebp -version
1.3.2
libsharpyuv: 0.2.1

Please provide any additional information below.
origin img:
-rw-r--r--@ 1 236K 11 29 19:24 input.webp

--
You received this message because:
1. The project was configured to send all issue notifications to this address

You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settings

ygu… via monorail

unread,
Nov 30, 2023, 3:49:05 AM11/30/23
to webp-d...@webmproject.org

Comment #1 on issue 626 by ygu...@google.com: When using the -quality 100 parameter to process webp images, the output result size is too large and does not meet expectations.
https://bugs.chromium.org/p/webp/issues/detail?id=626#c1

Thank you for the report.
Could you provide the source image for reproduction please?

lingy… via monorail

unread,
Dec 4, 2023, 8:13:12 AM12/4/23
to webp-d...@webmproject.org

Comment #2 on issue 626 by lingy...@gmail.com: When using the -quality 100 parameter to process webp images, the output result size is too large and does not meet expectations.
https://bugs.chromium.org/p/webp/issues/detail?id=626#c2

https://www.gstatic.com/webp/gallery/1.webp
@ygu...@google.com this image can repro

ygu… via monorail

unread,
Dec 4, 2023, 8:46:22 AM12/4/23
to webp-d...@webmproject.org
Updates:
Status: Invalid

Comment #3 on issue 626 by ygu...@google.com: When using the -quality 100 parameter to process webp images, the output result size is too large and does not meet expectations.
https://bugs.chromium.org/p/webp/issues/detail?id=626#c3

I could not reproduce the issue with libwebp. Using libwebp at commit 89c5b91:

cwebp 1.webp -q 99 -o 1_q99.webp
cwebp 1.webp -q 100 -o 1_q100.webp
ls -l
54844 1_q100.webp
54388 1_q99.webp
30320 1.webp

However I was able to reproduce the issue with ImageMagick convert tool:
196656 output100.webp
59688 output99.webp

WebP is not mentioned at https://imagemagick.org/script/command-line-options.php#quality
but one can read "The default quality value 100, a request for non-lossy compression."
So my guess is that ImageMagick considers 100 to be lossless, not highest-quality lossy,
and the figures above make sense. Either stick to the lossy [0-99] range with ImageMagick
or switch to using the cwebp binary directly for more settings on the WebP compression.

jz… via monorail

unread,
Dec 4, 2023, 2:27:44 PM12/4/23
to webp-d...@webmproject.org

Comment #4 on issue 626 by jz...@google.com: When using the -quality 100 parameter to process webp images, the output result size is too large and does not meet expectations.
https://bugs.chromium.org/p/webp/issues/detail?id=626#c4

Thanks for looking into this Yannis. Your analysis is correct, ImageMagick will use lossless with a quality >= 100:

https://github.com/ImageMagick/ImageMagick/blob/9e4f5fcb54cd103f1ae497140533ee5a9f4d714d/coders/webp.c#L1135
Reply all
Reply to author
Forward
0 new messages