您有一个多通道32位TIFF图像,并且Pillow尚不支持该格式.查看issue #1888:
Pillow (and PIL) is currently able to open 8 bit per channel multi-channel images (such as RGB) but is able to open higher bit depth images (e.g. I16, I32, or Float32 images) if they are single channel (e.g., grayscale).
[…]
Requirements
We should be able to support common GIS formats as well as high bit depth RGB(A) images.
At least 4 channels, but potentially more (see #1839)
Different pixel formats, including I16, I32, and Float.
我是通过直接使用TIFF插件图像读取器并启用调试模式来确定的:
from PIL import TiffImagePlugin
TiffImagePlugin.DEBUG = True
with open(image_path, 'rb') as f:
TiffImagePlugin.TiffImageFile(f)
其中包括输出:
tag: BitsPerSample (258) - type: short (3) Tag Location: 46 - Data Location: 218 - value: (32, 32, 32)
(下面的完整调试输出)
您可以使用Python GDAL bindings读取此格式.您也可以使用gdal_translate command line utility将文件转