12 lines
383 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import imageio
images = []
for i in range(1000):
image = str(i)+'.jpg'
im = imageio.imread(image)
images.append(im)
imageio.mimsave("a.gif", images, fps=5, duration=1, loop=0)
# fps: 帧率,表示每秒显示的帧数。
# duration: 设置每一帧的持续时间(单位:秒),这里设置为 1。
# loop: 设置动图的循环次数0 表示无限循环。