Python: Read and write TIFF 16 bit , three channel , colour images

后端 未结 6 2047
眼角桃花
眼角桃花 2020-12-07 14:32

Does anyone have a method for importing a 16 bit per channel, 3 channel TIFF image in Python?

I have yet to find a method which will preserve the 16 bit depth per ch

6条回答
  •  醉梦人生
    2020-12-07 15:29

    Just struggled considerably trying to read a multi-image TIFF with JPEG compression using Scikits-Image (skimage.io). Am using a Windows 10 distribution of Anaconda Python3; tifffile was installed through Anaconda Navigator or 'conda install'.

    Finally, uninstalled 'tifffile' with 'conda remove tifffile'. Next re-installed 'tifffile' with 'pip install tifffile'. This installed the latest 'tifffile' plugin - version 2020.5.5. Next installed image codecs with 'pip install imagecodecs'. And now the following code works:

    import skimage.io
    img = skimage.io.imread('picture.tiff', plugin='tifffile')
    

    Note this only works if the install of 'tifffile' and 'imagecodes' was done in the order outlined above (and the Anaconda 'tifffile' is first removed).

提交回复
热议问题