Quality with lossless webp compression

69 views
Skip to first unread message

Matt Sarett

unread,
May 12, 2017, 5:14:48 PM5/12/17
to WebP Discussion
Does the "quality" config affect lossless webp compression?  Or is it solely used for lossy compression?

Similarly, does the "method" config affect both lossless and lossy compression?

Thanks!
Matt

Vladyslav Grynko

unread,
May 12, 2017, 5:26:24 PM5/12/17
to webp-d...@webmproject.org
Regarding quality - certainly no. Lossless compression means you always get the same image as original, pixel-to-pixel.

--
You received this message because you are subscribed to the Google Groups "WebP Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss+unsubscribe@webmproject.org.
To post to this group, send email to webp-d...@webmproject.org.
Visit this group at https://groups.google.com/a/webmproject.org/group/webp-discuss/.
For more options, visit https://groups.google.com/a/webmproject.org/d/optout.

Vincent Rabaud

unread,
May 12, 2017, 7:05:29 PM5/12/17
to webp-d...@webmproject.org
For lossless, the quality parameter (up to 100) influences how "hard" the compression method is executed. So the higher, the better the compression usually.

Now the method: for both lossy and lossless, the method level (up to 6) influences how many techniques are used. So the higher, the better too. But the CPU usage usually significantly increases from one method number to the next.

That's why -q 100 -m 6 is the way to go if you want the smallest file ever.

Jyrki Alakuijala

unread,
May 12, 2017, 8:13:29 PM5/12/17
to webp-d...@webmproject.org
There are many options. One can use the -near_lossless 40 (or -near_lossless 60) modes when one doesn't mind a tiny amount of degradation and wants to get ~40 % size savings from true lossless.

Matt Sarett

unread,
May 15, 2017, 9:04:05 AM5/15/17
to WebP Discussion
I had thought that -q 0 -m 6 would result in the smallest file ever?


On Friday, May 12, 2017 at 7:05:29 PM UTC-4, vincent.rabaud wrote:
For lossless, the quality parameter (up to 100) influences how "hard" the compression method is executed. So the higher, the better the compression usually.

Now the method: for both lossy and lossless, the method level (up to 6) influences how many techniques are used. So the higher, the better too. But the CPU usage usually significantly increases from one method number to the next.

That's why -q 100 -m 6 is the way to go if you want the smallest file ever.
On Fri, May 12, 2017 at 11:26 PM, Vladyslav Grynko <vladysla...@gmail.com> wrote:
Regarding quality - certainly no. Lossless compression means you always get the same image as original, pixel-to-pixel.
2017-05-13 0:14 GMT+03:00 'Matt Sarett' via WebP Discussion <webp-d...@webmproject.org>:
Does the "quality" config affect lossless webp compression?  Or is it solely used for lossy compression?

Similarly, does the "method" config affect both lossless and lossy compression?

Thanks!
Matt

--
You received this message because you are subscribed to the Google Groups "WebP Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss...@webmproject.org.

--
You received this message because you are subscribed to the Google Groups "WebP Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss...@webmproject.org.

Matt Sarett

unread,
May 15, 2017, 9:21:18 AM5/15/17
to WebP Discussion
Actually, in practice, I'm seeing what you suggested.  Higher "quality" results in smaller lossless encodes (which doesn't seem to match the documentation I linked).  Does the documentation need to be updated?

Higher quality also seems to result in larger lossy encodes.  Does this seem confusing?

Saurabh Khanduja

unread,
May 15, 2017, 10:46:04 AM5/15/17
to webp-d...@webmproject.org
This was quite an issue when I worked on how to achieve higher compression with near lossless quality a few months back. The results are often quite degraded and use of -m 6 not only reduces the size but also affects quality drastically. Documentation can be made clearer on these options.

I used  `-metadata icc -m 6`  flags.

To unsubscribe from this group and stop receiving emails from it, send an email to webp-discuss+unsubscribe@webmproject.org.



--
Thanks & Regards,
Saurabh Khanduja
Miles of Smiles

Jyrki Alakuijala

unread,
May 15, 2017, 11:53:13 AM5/15/17
to webp-d...@webmproject.org
-q and -m flags should not impact the -near_lossless compression image quality drastically.

The only thing that should affect the image quality with -near_lossless is the number (usually 40, 60, or 80) after the -near_lossless parameter.

Would you be able to share the image that the effect happens with?

James Zern

unread,
May 16, 2017, 8:50:51 AM5/16/17
to WebP Discussion


On Monday, May 15, 2017 at 3:21:18 PM UTC+2, Matt Sarett wrote:
Actually, in practice, I'm seeing what you suggested.  Higher "quality" results in smaller lossless encodes (which doesn't seem to match the documentation I linked).  Does the documentation need to be updated?


An update was pushed for the api [1] which is a bit closer to cwebp [2] which calls out lossy and lossless explicitly. Thanks for the comments.
 
Higher quality also seems to result in larger lossy encodes.  Does this seem confusing?


The quality scale for lossy was meant to be similar to jpeg, etc., the addition of lossless did confuse things a bit. -z attempted to offer something closer to other lossless compression, but lossless had already been tied to quality so we're left to make sure it's documented properly.

Reply all
Reply to author
Forward
0 new messages