WebP does not seem to produce lossless image when converting a PNG with alpha channel

154 views
Skip to first unread message

钱尚书

unread,
Sep 9, 2016, 12:10:31 AM9/9/16
to WebP Discussion
I'm using cwebp.exe provided by Google to convert my PNG images to WebP, in order to same some space on my disk. However, when I was converting a PNG with alpha channel, the encoder seems to modify the contents under the full transparent area. I'm wondering whether this is a bug or a feature of the encoder, or maybe I'm using wrong encoder options?

Here is my encoder options: -q 100 -alpha_q 100 -lossless -m 6 -alpha_filter best -alpha_method 1 -v

I use Photoshop to drop the alpha channel of the image. My step is Layer- Layer Mask - From Transparency to get the mask, then delete the mask and finally save to PNG via photoshop.

The 'Original.png' is the original image, then converted to 'Original.webp' by cwebp.exe, then saved to 'Original_WebP.png' via XnView.

The two images whose file name ends with 'NoAlpha' are images that dropped their alpha channel via Photoshop.

I really need help on this issue, thanks.

Original.png
Original.webp
Original_NoAlpha.png
Original_WebP.png
Original_WebP_NoAlpha.png

Vincent Rabaud

unread,
Sep 9, 2016, 4:15:33 AM9/9/16
to webp-d...@webmproject.org
Hi, this is actually a feature: by default the RGB values under the fully transparent areas can be changed for optimization.

If you want to keep those values, use the "-exact" flag in cwebp.

Also, in Photoshop, you should not remove the alpha channel but blend it with RGB to get a visually similar image.

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