Python and 16 Bit Tiff

后端 未结 4 496
遇见更好的自我
遇见更好的自我 2020-12-05 08:24

How can I convert and save a 16 bit single-channel TIF in Python?

I can load a 16 and 32 bit image without an issue, and see that the 32 bit image is mode F

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-05 09:04

    For lossless conversion from 16 bit grayscale TIFF to PNG use PythonMagick:

    from PythonMagick import Image
    Image('pinei_2002300_1525_modis_ch02.tif').write("foo.png")
    

提交回复
热议问题