2018.09.17 09:23 "[Tiff] Black output image when saving with tile width and height at 256 and lzw compression using an specific image", by Angel_Sánchez_Morales

2018.09.17 09:23 "[Tiff] Black output image when saving with tile width and height at 256 and lzw compression using an specific image", by Angel_Sánchez_Morales

Hello folks,

when saving an image using tile width at 256, tile height 256 and lzw compression on the image I'm linking below, the output is a black image.

I have used our own C API (at my job) to generate it, and after some debugging we didn't find the cause. It happens on Windows and on macOS.

We decided to test if other applications would have the same error and we tried latest versions of Image Magick and libVips command-line applications:

Using libvips from homebrew on macOS:

$ vips tiffsave KatherineMcLean_FESP.tif KatherineMcLean_FESP_vipsout.tif --compression lzw --tile-width "256" --tile-height "256" --tile

And ImageMagick:

$ convert KatherineMcLean_FESP.tif -define tiff:tile-geometry=256x256 -compress lzw KatherineMcLean_FESP_imout.tif

Also, using this image, if we use packedbits compression, with a tile size of 512, the output image generates some skewed lines, but at least it's not black.

Funny thing is that if we open Photoshop and change the pixels of the image, for example applying a gradient, and we save the image again, when we convert the image to tiled with lzw the resulting image is correct.

Do you have any idea what's wrong? Maybe it's a bug?

Feel free to contact me for any further test, question, etc.

Regards,
Angel

PS: the link to the image: https://drive.google.com/open?id=1lz8XQczQN6w__6IjSnMPXqx3cr6D5Zuk I have zipped the image for if there's some kind of compression when uploading.