Created
April 25, 2018 03:00
-
-
Save kinsluck/57598fb4c5ecd992e35e23709336b656 to your computer and use it in GitHub Desktop.
A simple script to transfer all image format to GIF format.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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