def create_animation(img_files):
open_images = []<EOL>for fn in img_files:<EOL><INDENT>print(fn)<EOL>im = Image.open(fn)<EOL>open_images.append(im)<EOL><DEDENT>im = open_images[<NUM_LIT:0>]<EOL>im.save(r"<STR_LIT>", save_all=True, append_images=open_images[<NUM_LIT:1>:], duration=<NUM_LIT>, loop=<NUM_LIT:100>, optimize=True)<EOL>
See http://pillow.readthedocs.io/en/4.2.x/handbook/image-file-formats.html?highlight=append_images#saving