code: def create_animation(img_files):
      
  
      open_images = []
  
      for fn in img_files:
          print(fn)
          im = Image.open(fn)
          open_images.append(im)
  
      im = open_images[0]
      im.save(r"C:\temp\animation.gif", save_all=True, append_images=open_images[1:], duration=120, loop=100, optimize=True)
docs: See http://pillow.readthedocs.io/en/4.2.x/handbook/image-file-formats.html?highlight=append_images#saving