In Progress
Status Update
Comments
ge...@gmail.com <ge...@gmail.com> #2
Actually, I take back the lossy not having a problem. They both (lossless & lossy webp) have a problem. So this might be an issue with how cwebp is reading the tiff file.
pa...@gmail.com <pa...@gmail.com> #3
The original TIFF contains sample that are non-associated (ie: not premultiplied): the TIFFTAG_EXTRASAMPLES value is 'EXTRASAMPLE_UNASSALPHA' (=2).
Is that expected? Is your TIFF viewer taking this into account?
Because if i force the WebP tiff reader to unmultiply (as if the tag was EXTRASAMPLE_ASSOCALPHA), i get an output similar to your expectation (i think. See attachment).
Could you clarify if the input samples are premultiplied or not?
thanks!
Is that expected? Is your TIFF viewer taking this into account?
Because if i force the WebP tiff reader to unmultiply (as if the tag was EXTRASAMPLE_ASSOCALPHA), i get an output similar to your expectation (i think. See attachment).
Could you clarify if the input samples are premultiplied or not?
thanks!
ge...@gmail.com <ge...@gmail.com> #4
I am not sure what is going on here and whether it is related to the ASSOCALPHA/UNASSALPHA thing.
My original test.tiff was created from scratch with GIMP.
Your image (test.tiff.unassoc.webp) does look like what I see when I open test.tiff with GIMP and what I expected the webp to look like.
I did some tests and it appears that different programs interpret test.tiff differently. If you look at side-by-side.png that I uploaded, I found that GIMP & ImageMagick display test.tiff like the left part of side-by-side.png, whereas GThumb & Eye of GNOME display it more like the right part. Also, cwebp produces a webp that looks like the right image whereas when I convert to webp using imagemagick I get the left image.
My original test.tiff was created from scratch with GIMP.
Your image (test.tiff.unassoc.webp) does look like what I see when I open test.tiff with GIMP and what I expected the webp to look like.
I did some tests and it appears that different programs interpret test.tiff differently. If you look at side-by-side.png that I uploaded, I found that GIMP & ImageMagick display test.tiff like the left part of side-by-side.png, whereas GThumb & Eye of GNOME display it more like the right part. Also, cwebp produces a webp that looks like the right image whereas when I convert to webp using imagemagick I get the left image.
pa...@gmail.com <pa...@gmail.com> #5
Thanks for the extra explanations.
First things first, i *think* there is a bug in ImageMagick.
I proposed a patch here:
https://github.com/ImageMagick/ImageMagick/pull/1349
Let's see where it leads.
First things first, i *think* there is a bug in ImageMagick.
I proposed a patch here:
Let's see where it leads.
pa...@gmail.com <pa...@gmail.com> #6
The ImageMagick patch has been accepted and merged[1].
It seems that the TIFF reader was buggy there. It should now be aligned to what WebP is doing.
Next: have a look at what GIMP is doing :)
[1]https://github.com/ImageMagick/ImageMagick/commit/93cb7fcfa30026f87fb8f0ccab9ad520a184cc6c
It seems that the TIFF reader was buggy there. It should now be aligned to what WebP is doing.
Next: have a look at what GIMP is doing :)
[1]
pa...@gmail.com <pa...@gmail.com> #7
one more data point: Eye Of Gnome is based on gdk-pixbuf for image loading.
And it seems gdk-pixbuf is not supporting alpha properly during TIFF loading.
Will try to fix that by sending a patch.
And it seems gdk-pixbuf is not supporting alpha properly during TIFF loading.
Will try to fix that by sending a patch.
wi...@gmail.com <wi...@gmail.com> #8
[Comment Deleted]
ne...@gmail.com <ne...@gmail.com> #9
Converting losslessly sample file above with 1.2.1rc2 to webp gave 236 colors instead of 1 in Irfanview, not to mention it looks different than original file
pa...@gmail.com <pa...@gmail.com> #10
could you elaborate a bit? None of the bugs above were related to libwebp, but how the tools were decoding the TIF file. What commands did you use exactly?
ne...@gmail.com <ne...@gmail.com> #11
If you asked me - "cwebp -quiet -pass 10 -alpha_method 1 -alpha_filter best -m 6 -mt -lossless "test.tiff" -o "test.webp"
And OK what viewer decodes this sample OK?
And OK what viewer decodes this sample OK?
jz...@google.com <jz...@google.com> #12
pa...@gmail.com <pa...@gmail.com> #13
#11 i think the problem is actually different.
I've found this old conversation from 2012 [1] reporting that GIMP is saving badly formatted TIFF files, and ImageMagick is also erroneous.
Still investigating... The patch [2] i proposed is probably incorrect.
[1]https://lists.osgeo.org/pipermail/gdal-dev/2012-May/032984.html
[2]https://chromium-review.googlesource.com/c/webm/libwebp/+/3093999
I've found this old conversation from 2012 [1] reporting that GIMP is saving badly formatted TIFF files, and ImageMagick is also erroneous.
Still investigating... The patch [2] i proposed is probably incorrect.
[1]
[2]
pa...@gmail.com <pa...@gmail.com> #14
pa...@gmail.com <pa...@gmail.com> #15
Which version of GIMP did you use? Did you check the "save alpha" button?
Description
cwebp -lossless test.tiff -o test.tiff.webp
then the resulting webp file will not look identical to the input file. Specifically, it appears that the two images diff in their alpha channel values. Interestingly enough, if the -lossless is removed to switch to lossy mode, the problem with the alpha channel goes away.
The cwebp version is 1.0.0.