4:4:4 chroma subsampling support

661 views
Skip to first unread message

vincent...@gmail.com

unread,
Sep 7, 2016, 9:27:06 AM9/7/16
to WebP Discussion
Hello,

Is there a way to force cwebp to produce a lossy webp with 4:4:4 subsampling? I think it use 4:2:0 by default when -lossless is not specified.
Thank you

Pascal Massimino

unread,
Sep 7, 2016, 11:43:53 AM9/7/16
to WebP Discussion
Hi Vincent,

On Wed, Sep 7, 2016 at 3:19 PM, <vincent...@gmail.com> wrote:
Hello,

Is there a way to force cwebp to produce a lossy webp with 4:4:4 subsampling? I think it use 4:2:0 by default when -lossless is not specified.

The lossy format only provides 4:2:0 subsampling. There's no 4:4:4 possible with VP8 format.
Switching to -lossless, you get RGB(A) format in lossless form, which isn't exactly 4:4:4.

In case where you think 4:4:4 would be useful for you, i'd recommend trying the option '-pre 4' to see if it preserves edges better.
Or to try near-lossless mode, which is a 'lossy lossless' if you wish, still in RGB(A) format. For instance, 'cwebp -near_lossless 30 input.png'.

hope it helps,
skal/

[and yes, 4:4:4 and higher bit-depth is something experimented with for potential future versions, but it's not and can't be part of the frozen WebP format as it is defined now]

 

vincent...@gmail.com

unread,
Sep 7, 2016, 11:47:00 AM9/7/16
to WebP Discussion, vincent...@gmail.com
Here's some pictures to illustrate the problem:

png source
http://www.ionet.ch/vincent/2016/webp-test/images/source.png

webp lossless
http://www.ionet.ch/vincent/2016/webp-test/images/webp-lossless.webp

webp lossy
http://www.ionet.ch/vincent/2016/webp-test/images/webp-q95-aq50-m6-af.webp

notice the "10" on the upper-right par of the dial, on the blue background, looks grey in lossy webp. The same for the thin yellow markers before and after the yellow "20" on the left part. the seconds hand is also losing in saturation.

Pascal Massimino

unread,
Sep 7, 2016, 2:06:40 PM9/7/16
to WebP Discussion, vincent...@gmail.com
Hi Vincent,

yes, these are typical cases where 'smartYUV' helps preserving the colorful edges. See the result of using 'cwebp -pre 4 -q 95 -m 6 ...' attached.

hope it helps,
skal/

(this is a good sample!)
test.webp

vincent...@gmail.com

unread,
Sep 8, 2016, 4:30:54 AM9/8/16
to WebP Discussion, vincent...@gmail.com
It's really better thanks! It's still not 4:4:4 but the result is acceptable.
So -pre is a prefilter? what is it doing exactly?

Pascal Massimino

unread,
Sep 8, 2016, 9:56:22 AM9/8/16
to WebP Discussion
Hi Vincent,

On Thu, Sep 8, 2016 at 10:30 AM, <vincent...@gmail.com> wrote:
It's really better thanks! It's still not 4:4:4 but the result is acceptable.
So -pre is a prefilter? what is it doing exactly?

it's a preprocessing used during the conversion from RGB to YUV colorspace, prior
to feeding the codec itself. It spends more time optimizing the final values of U/V
after downsampling (and also takes into account the so-called 'fancy-upsampling'
that will be used during *decoding* at display time).

As mentioned in the other discussion on this mailing-list ('smartYUV'), it's a slow-ish
preprocessing and it has some tricky corner cases. That's why it's not turned on by
default for now.

hope it helps,
skal/


Le mercredi 7 septembre 2016 20:06:40 UTC+2, skal a écrit :
Hi Vincent,

On Wed, Sep 7, 2016 at 5:46 PM, <vincent...@gmail.com> wrote:
Here's some pictures to illustrate the problem:

png source
http://www.ionet.ch/vincent/2016/webp-test/images/source.png

webp lossless
http://www.ionet.ch/vincent/2016/webp-test/images/webp-lossless.webp

webp lossy
http://www.ionet.ch/vincent/2016/webp-test/images/webp-q95-aq50-m6-af.webp

notice the "10" on the upper-right par of the dial, on the blue background, looks grey in lossy webp. The same for the thin yellow markers before and after the yellow "20" on the left part. the seconds hand is also losing in saturation.

yes, these are typical cases where 'smartYUV' helps preserving the colorful edges. See the result of using 'cwebp -pre 4 -q 95 -m 6 ...' attached.

hope it helps,
skal/

(this is a good sample!)

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

Reply all
Reply to author
Forward
0 new messages