import imageio
with imageio.get_writer('/path/to/movie.gif', mode='I') as writer:
for filename in filenames:
image = imageio.imread(filename)
writer.append_data(image)
from moviepy.editor import *
clip = (VideoFileClip("video.mp4")
.subclip((1,22.65),(1,23.2))
.resize(0.3))
clip.write_gif("video.gif")
import imageio
images = []
for filename in filenames:
images.append(imageio.imread(filename))
imageio.mimsave('/path/to/movie.gif', images)