Skip to content

Instantly share code, notes, and snippets.

@kinsluck
Created April 25, 2018 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kinsluck/57598fb4c5ecd992e35e23709336b656 to your computer and use it in GitHub Desktop.
Save kinsluck/57598fb4c5ecd992e35e23709336b656 to your computer and use it in GitHub Desktop.
A simple script to transfer all image format to GIF format.
import os
import glob
from PIL import Image
for infile in os.listdir('.'):
if infile in glob.glob('*.py'):
pass
else:
f, e = os.path.splitext(infile)
outfile = f + ".gif"
if infile != outfile:
Image.open(infile).save(outfile)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment