from images2gif import writeGif from PIL import Image import os file_n

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
from images2gif import writeGif
from PIL import Image
import os
file_names = sorted((fn for fn in os.listdir('.') if fn.endswith('.gif'))) # Все gif файлы в текущей папке
images = [Image.open(fn) for fn in file_names]
size = (150,150)
for im in images:
im.thumbnail(size, Image.ANTIALIAS)
filename = "my_gif.GIF"
writeGif(filename, images, duration=0.2)