Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/304.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
Python Pizzle 2.3.0将RGB图像保存为TIF_Python_Python Imaging Library_Tiff_Pillow - Fatal编程技术网

Python Pizzle 2.3.0将RGB图像保存为TIF

Python Pizzle 2.3.0将RGB图像保存为TIF,python,python-imaging-library,tiff,pillow,Python,Python Imaging Library,Tiff,Pillow,我正在尝试将RGB图像保存为TIF。虽然我很确定TIF可以处理RGB图像,但我无法让它工作 import os from PIL import Image def main(): inFile=os.path.join("C:",os.sep,"temp","input.tif") img=Image.open(inFile) img=img.convert('RGB') img.save(os.path.join("C:",os.sep,"temp","result.tif"),'TIF

我正在尝试将RGB图像保存为TIF。虽然我很确定TIF可以处理RGB图像,但我无法让它工作

import os
from PIL import Image

def main():
inFile=os.path.join("C:",os.sep,"temp","input.tif")

img=Image.open(inFile)
img=img.convert('RGB')

img.save(os.path.join("C:",os.sep,"temp","result.tif"),'TIFF')
然而,当我运行这段代码时,我得到了以下错误

IOError: encoder error -2 when writing image file
libtiff安装在W7盒上

提前谢谢