我試圖使用 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
提交
取消