我试图使用 PIL 创建一个 gif,如下所述:http : //www.pythoninformer.com/python-libraries/pillow/creating-animated-gif/以及他们显示的将一堆图像“名称”保存到 gif 中的代码:# Open all the framesimages = []for n in names: frame = Image.open(n) images.append(frame)# Save the frames as an animated GIFimages[0].save('anicircle.gif', save_all=True, append_images=images[1:], duration=100, loop=0)但是,保存 gif 时它只保存一张图像,我做错了什么?我在 python 2.7 中使用 PIL 版本 1.1.7
1 回答
慕慕森
TA贡献1856条经验 获得超17个赞
我不认为你的代码有什么问题。我会检查您使用的枕头版本。
from PIL import Image
Image.PILLOW_VERSION
append_images 是在 Pillow 3.4.0 中添加的,因此您至少需要使用该版本。
添加回答
举报
0/150
提交
取消