Python PIL create gif失败

2024-05-13 18:27:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图使用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


Tags: the图像comhttpframespilsavewww