Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有一个 python 模块可以让我读取 HDR 图像的尺寸?标准 python PIL 库无法读取 HDR 图像。HDR 参考高动态范围图像。Photoshop 可以读取这种文件格式,但我一直无法找到任何可以读取这种文件格式的 python 模块。
更新:PIL Image.open 返回“IOError:无法识别图像文件”
读取 HDR 图像文件格式时,imghdr 返回 None。
有一个名为 smc.freeimage 的 python 模块可以读取 HDR 图像。效果很好,但诀窍是成功安装模块。确保先安装 cython 模块...然后尝试 easy_install 而不是 pip install。
import smc.freeimage as fi filename = "myimage.hdr" img = fi.Image(filename) print "width =",img.width print "height =",img.height