https://pythonprogramming.altervista.org/png-to-gif/
python通过多张图片制作gif图
使用PIL库即可,frames记录每一帧图片,duration为延迟,越大表示间隔时间越长
from PIL import Image
import glob
frames = []
imgs = glob.glob("*.png")
for i in imgs:
new_frame = Image.open(i)
frames.append(new_frame)
frames[0].save('png_to_gif.gif', format='GIF',
append_images=frames[1:],
save_all=True,
duration=300, loop=0)