Created
January 13, 2013 16:18
-
-
Save alaiacano/4524896 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/python | |
""" | |
python resize_files.py folder_of_input_images output_file.gif | |
""" | |
import os, sys, re | |
RESIZE_PERCENT = 12 | |
QUALITY = 40 | |
folder = sys.argv[1] | |
output = sys.argv[2] | |
for filename in os.listdir(folder): | |
if filename=='.DS_Store' or 'resized' in filename: | |
continue | |
print "resizing %s" % file | |
os.system('convert %s -resize %s%% -quality %s %s/resized_%s' % (os.path.join(folder, filename), RESIZE_PERCENT, QUALITY, folder, filename)) | |
print "animating" | |
command = 'convert -delay 12 -layers optimizeplus -depth 8 -colors 64 %s/resized_*.JPG %s' % (folder, output) | |
os.system(command) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment