您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

Python PIL For Loop与多图像TIFF一起使用

Python PIL For Loop与多图像TIFF一起使用

您可以使用PIL图像的“搜索方法来访问tif的不同页面(或动画gif的帧)。

from PIL import Image

img = Image.open('multipage.tif')

for i in range(4):
    try:
        img.seek(i)
        print img.getpixel( (0, 0))
    except EOFError:
        # Not enough frames in img
        break
python 2022/1/1 18:51:17 有367人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶