Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/image-processing/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在PIL-Python 2.7中使用平铺、金字塔tiff图像_Python_Python Imaging Library_Tiff_Pillow - Fatal编程技术网

在PIL-Python 2.7中使用平铺、金字塔tiff图像

在PIL-Python 2.7中使用平铺、金字塔tiff图像,python,python-imaging-library,tiff,pillow,Python,Python Imaging Library,Tiff,Pillow,我有一些tiff图像,在7-8级之间。这些都是使用VIP生成的。我已经尝试了在中列出的迭代。我也试过: im = Image.open("E:\\tiled_pyr.tif") for i in range(7): try: im.seek(i) print im.size[0] print im.size[1] except EOFError: # Not enough frames in im b

我有一些tiff图像,在7-8级之间。这些都是使用VIP生成的。我已经尝试了在中列出的迭代。我也试过:

im = Image.open("E:\\tiled_pyr.tif")
for i in range(7):
    try:
        im.seek(i)
        print im.size[0]
        print im.size[1]
    except EOFError:
        # Not enough frames in im
        break
但是,当我开始遍历时,会出现以下错误:

IOError: decoder tiff_adobe_deflate not available
我要做的是将ptif裁剪成最高分辨率或最高级别,然后对裁剪进行一些分析


这在PIL中是可能的吗?我还需要别的吗?谢谢

libvips Python绑定pyvips现在可以在Windows上工作,因此您可以执行以下操作:

import pyvips

# this will open the highest resolution layer
image = pyvips.Image.new_from_file("somefile.tif")

# crop out an area
area = image.crop(x, y, w, h)

# ... do what you like
print('average pixel value of crop is', area.avg())