# Does VTK support reading LZW-compressed TIFF?

**URL:** https://discourse.vtk.org/t/does-vtk-support-reading-lzw-compressed-tiff/8750
**Category:** Support
**Created:** [June 16, 2022, 6:32pm UTC](https://discourse.vtk.org/t/does-vtk-support-reading-lzw-compressed-tiff/8750 "2022-06-16T18:32:07Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![MKRangers](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mkrangers/32/5341_2.png) [@MKRangers](https://discourse.vtk.org/u/MKRangers)
#### Post date: [June 16, 2022, 6:32pm UTC](https://discourse.vtk.org/t/does-vtk-support-reading-lzw-compressed-tiff/8750/1 "2022-06-16T18:32:07Z")

</div>

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?

Thanks!

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 16, 2022, 6:37pm UTC](https://discourse.vtk.org/t/does-vtk-support-reading-lzw-compressed-tiff/8750/2 "2022-06-16T18:37:24Z")

</div>

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?).

> [@MKRangers](#):
>
> ParaView can read and display them perfectly

What build of ParaView is this?

---

<div class="post-metadata">

### Author: ![MKRangers](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mkrangers/32/5341_2.png) [@MKRangers](https://discourse.vtk.org/u/MKRangers)
#### Post date: [June 16, 2022, 7:23pm UTC](https://discourse.vtk.org/t/does-vtk-support-reading-lzw-compressed-tiff/8750/3 "2022-06-16T19:23:05Z")

</div>

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

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [June 16, 2022, 7:53pm UTC](https://discourse.vtk.org/t/does-vtk-support-reading-lzw-compressed-tiff/8750/4 "2022-06-16T19:53:43Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![MKRangers](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mkrangers/32/5341_2.png) [@MKRangers](https://discourse.vtk.org/u/MKRangers)
#### Post date: [June 21, 2022, 6:41pm UTC](https://discourse.vtk.org/t/does-vtk-support-reading-lzw-compressed-tiff/8750/5 "2022-06-21T18:41:26Z")

</div>

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!
