This issue is with libwebp-1.3.0. I've taken note that 32-bit RGBA WebP files will create corrupted RGB channels when loaded through the SDK. I had seen that in my own custom importer and thought that it was something I was doing incorrectly. The alpha channel itself may be correct.
However, I was able to replicate it easily with the dwebp.exe test app:
dwebp.exe 1_webp_a.webp -bmp -o 1_webp_a.bmp
The 1_webp_a.webp file is attached to this posting and can also be downloaded from the link on this page:
How was 1_webp_a.bmp created? If I use the binaries from the 1.3.0 release (both wic and non-wic) I can only reproduce that rendering in Photos App or Paint. Opening them in Chrome applies the alpha channel correctly.
The output from the release binaries match the output on Linux, but the md5 for the attached bitmap doesn't match and shows the RGB values burned in with an opaque alpha. I don't think this is an issue with the decoder, but there may be limitations in the Windows applications for applying the alpha or it may have something to do with how webp is writing them.
jz… via monorail
unread,
Mar 13, 2023, 5:59:18 PM3/13/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
For reference, the attached bitmap was made using the libwebp release binaries. Comparing this file and the one attached in the initial report, it looks like the first one is missing alpha information from BITMAPV3INFOHEADER [1][2]. The Photos and Paint applications may not support this. I haven't looked to see if there is another way to convey this information.
> I used ' libwebp-1.3.0-windows-x64.zip'. > > dwebp.exe 1_webp_a.webp -bmp -o 1_webp_a.bmp
That binary should have produced the same image as the one I attached to comment #2. It appears to be lacking the RGBA mask information; did you happen to open it in an editor and save it?
> The same visual issues in the RGB channels can also be seen in my own custom > importer and not just in the dwebp output into BMP format.
The issue comes from how applications are interpreting the alpha channel. libwebp may modify pixels in areas with fully transparent alpha to improve compression. What you're seeing is what the image looks like with an opaque alpha channel, rather than a transparent one.
To remove the question of the bmp file, you can try -ppm and -pam, using something like ImageMagick's display application to view the images. The ppm file will look like the bmp file you originally uploaded. The pam file will hide the pixels, much like the png output will. The same goes for the bmp I uploaded when rendered in Chrome.
GTA Photo Items
unread,
Mar 14, 2023, 3:40:36 PM3/14/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to WebP Discussion, jz… via monorail, no_r...@monorail-prod.appspotmail.com
>The issue comes from how applications are interpreting the alpha channel. >libwebp may modify pixels in areas with fully transparent alpha to improve >compression. What you're seeing is what the image looks like with an opaque >alpha channel, rather than a transparent one.
Please excuse my short delay in responding as otherwise I was planning to pen this response last night.
In retrospect I now understand that this all comes down to my own perspective on what I was seeing and what viewing methods I was using to display the converted files. Indeed your explanation is bang on and makes complete sense. I went back, with this new perspective, and confirmed that the alpha channels were correct on the various files + when using my WebP importer API. As you say, some of the RGB channels had become messed up during some prior conversion process but the alpha channel was correct.
Thanks again for your swift response and for providing this proper perspective on what I was seeing.
jz… via monorail
unread,
Mar 14, 2023, 10:12:09 PM3/14/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
Please excuse my short delay in responding as otherwise I was planning to pen this response last night.
In retrospect I now understand that this all comes down to my own perspective on what I was seeing and what viewing methods I was using to display the converted files. Indeed your explanation is bang on and makes complete sense. I went back, with this new perspective, and confirmed that the alpha channels were correct on the various files + when using my WebP importer API. As you say, some of the RGB channels had become messed up during some prior conversion process but the alpha channel was correct.
Thanks again for your swift response and for providing this proper perspective on what I was seeing.
jz… via monorail
unread,
Mar 14, 2023, 10:13:44 PM3/14/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
Thanks for the update. I'm glad that things are a little clearer. It's good to know that some Windows applications don't apply the alpha channel when rendering. I'm not sure if there's a good forum for reporting bugs / features requests on those.