实用imageio库制作gif

1
2
3
4
5
6
7
8
9
10
11
import imageio

image_list = [r'D:\\23423423.jpg', r'D:\\34234234234.jpg']
gif_name = r'D:\\gif.gif'

frames = []
for image_name in image_list:
frames.append(imageio.imread(image_name))

# gif图的切换秒数duration参数为2
imageio.mimsave(gif_name, frames, 'GIF', duration=2)