我试图使用PIL创建gif,如中所述: http://www.pythoninformer.com/python-libraries/pillow/creating-animated-gif/
它们显示的代码将一堆图像“名称”保存到gif中:
# Open all the frames
images = []
for n in names:
frame = Image.open(n)
images.append(frame)
# Save the frames as an animated GIF
images[0].save('anicircle.gif',
save_all=True,
append_images=images[1:],
duration=100,
loop=0)
但是,当保存gif时,它只保存一个图像,我做错了什么? 我在python2.7中使用PIL版本1.1.7
我不认为你的代码有什么问题。我会查一下你用的枕头型号。在
append_images
是在Pillow3.4.0中添加的,因此您至少需要使用该版本。在相关问题 更多 >
编程相关推荐