Chi semina…
7 months ago
Chi semina raccoglie,
chi raccoglie si china,
e da là a prenderla nel Cxxx è un attimo!
Batch Picture Scaler with Python
9 months ago
Below you can find a nice Python script to scale all the JPG pictures in the current directory by a resizeFactor.
Enjoy!
import Image
import glob
import os, sys
from os.path import join
if not os.path.isdir(“resized”):
os.mkdir(“resized“)
resizeFactor = 0.529
for i in glob.glob(“*.JPG”):
print i
im = Image.open(i)
width, height = im.size
imout = im.resize((int(widthresizeFactor),int(heightresizeFactor)), Image.ANTIALIAS)
imout.save(join(os.curdir, “resized”, i))
