Generating an animated GIF in Python
问题 I'm trying to generate an animated GIF using images2gif.py (pastebin to the most recent verson : bit.ly/XMMn5h ). I'm using this Python script: __author__ = 'Robert' from images2gif import writeGif from PIL import Image import os file_names = sorted((fn for fn in os.listdir('.') if fn.endswith('.gif'))) #['animationframa.png', 'animationframb.png', ...] " images = [Image.open(fn) for fn in file_names] size = (150,150) for im in images: im.thumbnail(size, Image.ANTIALIAS) print writeGif.__doc_