【逃兵】【python】图片缩小
将当前文件下所有图片长宽//2from PIL import Image
import os
try:
Image.MAX_IMAGE_PIXELS = None
pathlist=
for root in pathlist:
pic = Image.open(root)
x,y = pic.size
pic = pic.resize((x//2,y//2))
pic.save('new'+root)
input('运行成功!\n请按回车键结束')
except:
input('运行失败!请联系作者。\n请按回车键结束')
{:5_108:}
页:
[1]