相关疑难解决方法(0)

麻烦使用python PIL库来裁剪和保存图像

我试图裁剪一个相当高的res图像并保存结果,以确保它完成.但是,无论我如何使用save方法,我都会收到以下错误:SystemError: tile cannot extend outside image

from PIL import Image

# size is width/height
img = Image.open('0_388_image1.jpeg')
box = (2407, 804, 71, 796)
area = img.crop(box)

area.save('cropped_0_388_image1', 'jpeg')
output.close()
Run Code Online (Sandbox Code Playgroud)

python python-imaging-library

43
推荐指数
2
解决办法
5万
查看次数

标签 统计

python ×1

python-imaging-library ×1