# Problem reading 16-bit TIFF File

**URL:** https://discourse.paraview.org/t/problem-reading-16-bit-tiff-file/8853
**Category:** Development
**Created:** [January 27, 2022, 7:29pm UTC](https://discourse.paraview.org/t/problem-reading-16-bit-tiff-file/8853 "2022-01-27T19:29:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![sjgallagher2](https://discourse.paraview.org/user_avatar/discourse.paraview.org/sjgallagher2/32/8481_2.png) [@sjgallagher2](https://discourse.paraview.org/u/sjgallagher2)
#### Post date: [January 27, 2022, 7:29pm UTC](https://discourse.paraview.org/t/problem-reading-16-bit-tiff-file/8853/1 "2022-01-27T19:29:35Z")

</div>

Trying to read a 16-bit grayscale TIFF image saved with OpenCV in Python, and I’m getting the error:

> ERROR: In C:\glr\builds\paraview\paraview-ci\build\superbuild\paraview\src\VTK\IO\Image\vtkTIFFReader.cxx, line 1136  
> vtkTIFFReader (0000027E675D81C0): Problem reading slice of volume in TIFF file.

The same error message appears in [this thread](https://public.kitware.com/pipermail/paraview/2014-November/032710.html) from the old mailing list. Image properties from metadata:

```auto
Exif.Image.BitsPerSample = 16 16 16
Exif.Image.Compression = LZW
Exif.Image.ImageLength = 120
Exif.Image.ImageWidth = 160
Exif.Image.Orientation = top, left
Exif.Image.PhotometricInterpretation = Black Is Zero
Exif.Image.PlanarConfiguration = 1
Exif.Image.Predictor = Horizontal differencing
Exif.Image.ResolutionUnit = inch
Exif.Image.RowsPerStrip = 25
Exif.Image.SamplesPerPixel = 1
Exif.Image.StripByteCounts = 4189 4188 4338 4119 3429
Exif.Image.StripOffsets = 8 4197 8385 12723 16842
Exif.Image.XResolutoin = 300
Exif.Image.YResolution = 300
Exif.Photo.ColorSpace = sRGB

```

Because the extension is .tif, I get the option of two readers, either GDAL Raster Reader (works for a single image but not a sequence) or TIFF Series Reader (gives error above, whether the image is alone or is actually part of a series titled `seq_0000xx.tif` for xx=0 to 40. `Read As Image Stack` is unchecked, representation can be surface or slice, coloring is set to Tiff scalars. Everything else is default.

These are plain 16-bit grayscale TIFF files, no pages or anything in them. `Information` tab shows data is read as unsigned short.

> Client Information:  
> Version: 5.10.0-RC1  
> VTK Version:  
> Qt Version: 5.15.2  
> vtkIdType size: 64bits  
> Embedded Python: On  
> Python Library Path: C:\Program Files\ParaView 5.10.0\bin\lib  
> Python Library Version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]  
> Python Numpy Support: On  
> Python Numpy Path: C:\Program Files\ParaView 5.10.0\bin\Lib\site-packages\numpy  
> Python Numpy Version: 1.21.1  
> Python Matplotlib Support: On  
> Python Matplotlib Path: C:\Program Files\ParaView 5.10.0\bin\Lib\site-packages\matplotlib  
> Python Matplotlib Version: 3.2.1  
> Python Testing: Off  
> MPI Enabled: Off  
> ParaView Build ID: superbuild 804a787c9ac8f9b0f8abc7c3001d1e61eeb15208 (!922)  
> Disable Registry: Off  
> Test Directory:  
> Data Directory:  
> SMP Backend: TBB  
> SMP Max Number of Threads: 12  
> OpenGL Vendor: Intel  
> OpenGL Version: 3.2.0 - Build 27.20.100.9664  
> OpenGL Renderer: Intel(R) UHD Graphics

> Connection Information:  
> Remote Connection: No

Here are sample images:  
[seq\_0000000.tif](https://discourse.paraview.org/uploads/short-url/ov1zABxTROEemcUnaHuDMl5SvYv.tif) (20.0 KB)  
[seq\_0000001.tif](https://discourse.paraview.org/uploads/short-url/oSnaQSZMoA9qkeNrOFPmDDUj7fj.tif) (20.0 KB)  
[seq\_0000002.tif](https://discourse.paraview.org/uploads/short-url/utmYs25YI1bSR5fI6D5iHaVXLiR.tif) (20.1 KB)  
[seq\_0000003.tif](https://discourse.paraview.org/uploads/short-url/RhAw3RgGve5NHx3MbatjOOECVX.tif) (20.0 KB)

The data originates from a thermal camera which gives raw 12-bit data, so changing the format isn’t too much of an issue but this should work.
