Skip to content

Instantly share code, notes, and snippets.

@amoshyc
Last active April 24, 2017 13:09
Show Gist options
  • Save amoshyc/9acb3263eeda8966e25b1b567b80e733 to your computer and use it in GitHub Desktop.
Save amoshyc/9acb3263eeda8966e25b1b567b80e733 to your computer and use it in GitHub Desktop.
import os
from sys import argv
from scipy.misc import imread, imresize, imsave
input_dir = argv[1]
output_dir = './out/'
os.makedirs(output_dir, exist_ok=True)
filenames = sorted(os.listdir(input_dir))
for fn in filenames:
img = imread(os.path.join(input_dir, fn))
img = imresize(img, 0.7)
imsave(output_dir + fn[:-4] + '.jpg', img)
print(fn)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment