python读取image文件_python-Image.open提供错误无法识别图像文件

您有一个多通道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将文件转

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值