cwebp produce visible artifacts even with lossless compression

527 views
Skip to first unread message

m.mik...@gmail.com

unread,
Sep 1, 2013, 7:35:43 AM9/1/13
to webp-d...@webmproject.org

I would like to provide webp images for browsers which support this image format.
We have big images (533x800) and small images (240x360) of the same photo.
As a first step I was interested in a comparison of small images in jpg and webp format.
So I created two webp images in two different ways:
1) resize big image by convert utility with Lanczos filter (resized_q100.jpg) and then convert it to webp format (external_resize_q90.webp)
2) both resize and compress by means of cwebp (internal_resize_q90.webp)

Results are:
external_resize_q90.webp contains visible artifacts. It appears as white lines around man.
These artifacts exist even if lossless compression is used. I thought lossless compression has no difference with original and was rather surprised with such a difference.
I used Chromium Version 28.0.1500.71 Ubuntu 13.04 (28.0.1500.71-0ubuntu1.13.04.1) to compare quality visually.

Artifacts don't exist if internal resize is used (see internal_resize_q90.webp). But seems like internal resize is worse than Lanczos one.

I have two questions:
1. Is these artifacts is a bug or artifacts comes from design of compression format and can't be fixed? Please note that artifacts exist even with lossless compression. May be it is possible to get rid of these artifacts by using some command line options?
2. Is it possible to change resize algorithm used by cwebp with some command line option?

I'm going to create webp alternative of images for relatively big site and now I'm blocked with these issues.

Here are images:

resized_q100.jpg

external_resize_q90.webp

internal_resize_q90.webp

external_resize_lossless.webp


What steps will reproduce the problem?

wget http://static.kupivip.ru/V0/00/97/87/59/1b.jpg
convert 1b.jpg -filter Lanczos -resize 240x360 -quality 100 resized_q100.jpg
cwebp -m 6 -resize 240 360 -q 90 1b.jpg -o internal_resize_q90.webp
cwebp -m 6 -q 90 resized_q100.jpg -o external_resize_q90.webp
cwebp -lossless resized_q100.jpg -o external_resize_lossless.webp

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

I use official build libwebp-0.3.1-linux-x86-64. Operating system is Ubuntu 13.04.

Pascal Massimino

unread,
Sep 1, 2013, 12:49:52 PM9/1/13
to WebP Discussion
Hi,


thanks for the detailed report!

Seems there's a mismatch between the IDCT used by 'convert' and the one used by 'cwebp'.
The problem disappears when commenting out line 235 of examples/jpegdec.c ("dinfo.dct_method = JDCT_IFAST;").
There also no problem when using PNG format instead of JPEG (resized_q100.jpg -> resized_q100.png).

Not sure about the speed impact when not using JDCT_IFAST. Maybe that could be a cwebp option...



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

I use official build libwebp-0.3.1-linux-x86-64. Operating system is Ubuntu 13.04.

--
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.
To post to this group, send email to webp-d...@webmproject.org.
Visit this group at http://groups.google.com/a/webmproject.org/group/webp-discuss/.
For more options, visit https://groups.google.com/a/webmproject.org/groups/opt_out.

m.mik...@gmail.com

unread,
Sep 2, 2013, 4:43:43 AM9/2/13
to webp-d...@webmproject.org
Thank you very much!
It fixed all artifacts. Quality and size of images is very promising now.

I just can't wait to provide webp alternatives of images for browsers which support webp format.

Do I need to report an issue in official tracker to fix this problem in cwebp?

воскресенье, 1 сентября 2013 г., 20:49:52 UTC+4 пользователь skal написал:

Pascal Massimino

unread,
Sep 2, 2013, 4:49:43 AM9/2/13
to WebP Discussion
Hi,


On Mon, Sep 2, 2013 at 1:43 AM, <m.mik...@gmail.com> wrote:
Thank you very much!
It fixed all artifacts. Quality and size of images is very promising now.

I just can't wait to provide webp alternatives of images for browsers which support webp format.

Do I need to report an issue in official tracker to fix this problem in cwebp?

yes, can you please open an issue in the tracker? It makes the problem (and solution!)
more discoverable than in the mailing list.

I already have the patch ready here: https://gerrit.chromium.org/gerrit/#/c/67084

m.mik...@gmail.com

unread,
Sep 2, 2013, 5:26:18 AM9/2/13
to webp-d...@webmproject.org
I've created issue https://code.google.com/p/webp/issues/detail?id=169

понедельник, 2 сентября 2013 г., 12:49:43 UTC+4 пользователь skal написал:
Reply all
Reply to author
Forward
0 new messages