Does VTK support reading LZW-compressed TIFF?

Hi everyone,

I have some TIFFs that cannot be read with vtkTIFFReader, but ImageJ and ParaView can read and display them perfectly. So I used ImageJ to open these TIFFs and saved them as TIFFs again, and now these newly saved TIFFs from ImageJ can be read by vtkTIFFReader. I noticed that the original TIFFs are LZW-compressed and those saved by ImageJ are not, so as indicated by the difference of their file size.

Is there any way in vtk to decode LZW-compressed TIFFs and properly populate the image data to vtkTIFFReader?


I suspect this has to do with using an external libtiff as our built-in one doesn’t link to any LZW library (unless it implements it internally?).

What build of ParaView is this?

Hi Ben, thanks for your reply!

It’s VS2019 x64.

If it’s using the external libtiff, how to populate libtiff's tiff to vtkTIFFReader?

There is the VTK_MODULE_USE_EXTERNAL_VTK_libtiff option to set to ON (or something like it). CMake will then need to be told how to use whatever tiff you have.

I’ve rebuilt my VTK using an external libtiff with the tag you mentioned on. Now it can read LZW-compressed tif files correctly! Thank very much for your help!