我正在尝试将 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-box 上。
提前致谢