Issue 305 in webp: WebP is unable to preserve gradients at any compression level other than lossless

190 views
Skip to first unread message

anestl… via monorail

unread,
Aug 7, 2016, 4:21:18 PM8/7/16
to webp-d...@webmproject.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 305 by anestl...@gmail.com: WebP is unable to preserve gradients at any compression level other than lossless
https://bugs.chromium.org/p/webp/issues/detail?id=305

The attached WebP is saved using 99% quality and gradients still look awful.

JPEG2000 compresses this file by a factor of 1000 and the result looks almost perfect.

Attachments:
Untitled-1.png 871 KB
Untitled-1.webp 78.7 KB
Untitled-1.jp2 7.2 KB

--
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

pascal.m… via monorail

unread,
Aug 9, 2016, 3:21:45 AM8/9/16
to webp-d...@webmproject.org
Updates:
Owner: pascal.m...@gmail.com

Comment #1 on issue 305 by pascal.m...@gmail.com: WebP is unable to preserve gradients at any compression level other than lossless
https://bugs.chromium.org/p/webp/issues/detail?id=305#c1

yes, perfect gradient rendition is an inherent limitation of VP8 format. Namely, the quantizing step for U/V is not allowed to be '1', but limited to '4' instead.
Hopefully, 'perfect' gradient are not that common in the wild.

One possibility is to use dithering at encoding time with the option '-pre 2' in cwebp.
Not perfect, but that's a start.

Thanks for the report, that's a good sample. Will try and see what we can do to mitigate this.

anestl… via monorail

unread,
Aug 22, 2016, 2:04:44 PM8/22/16
to webp-d...@webmproject.org

Comment #2 on issue 305 by anestl...@gmail.com: WebP is unable to preserve gradients at any compression level other than lossless
https://bugs.chromium.org/p/webp/issues/detail?id=305#c2

Strangely or not but VP9 is also affected: https://www.youtube.com/watch?v=PfewNNcKRjk

The entire clip is borked.

Or maybe it's the other way around ;-)

pascal.m… via monorail

unread,
Sep 6, 2016, 5:24:14 AM9/6/16
to webp-d...@webmproject.org

Comment #3 on issue 305 by pascal.m...@gmail.com: WebP is unable to preserve gradients at any compression level other than lossless
https://bugs.chromium.org/p/webp/issues/detail?id=305#c3

Actually, this source is trickier than it looks: there's only 80 colors for luma, 12 for U and 15 for the V channel...
.. but with a lot of random dithering used to smooth the gradients.
This is what VP8 is struggling with, due to its limited quantizer step.
JPEG can reconstruct the dithering noise better (at q=100), but it takes a lot of bytes (~280k).
I'm surprised jp2 does so well in size. I guess the dithering noise is gone there too, but it's less visible.

Anyway, VP8 transform is flattening a lot these random dithering pattern, even at q=100 (quantizer = 4 or 8). I'm experimenting with forcing some positive bias here, to see if we can preserve some noise. Interesting input image.

pascal.m… via monorail

unread,
Apr 3, 2018, 6:56:48 AM4/3/18
to webp-d...@webmproject.org
Updates:
Status: WontFix

Comment #4 on issue 305 by pascal.m...@gmail.com: WebP is unable to preserve gradients at any compression level other than lossless
https://bugs.chromium.org/p/webp/issues/detail?id=305#c4

closing this issue as WAI (more or less!).

using '-pre 2' is somehow the way to proceed, albeit output is not totally correct for the gradients.
Reply all
Reply to author
Forward
0 new messages