Last active
December 20, 2015 10:20
-
-
Save khajer/6115271 to your computer and use it in GitHub Desktop.
resize (*2) all image path for -hd. powered by python and pil
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
| import Image | |
| import os | |
| listfile = os.listdir(os.getcwd()) | |
| scale = 2 | |
| for f in listfile: | |
| if f.split('.')[1] == 'png': | |
| print f | |
| im = Image.open(f) | |
| w = im.size[0]*scale | |
| h = im.size[1]*scale | |
| nIm = im.resize((w, h), Image.ANTIALIAS) | |
| nIm.save(f.split('.')[0]+'-hd'+'.png') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment