import os
from PIL import Image as Img
Then we create a new directory:
os.mkdir("img/cdslittle4/")
At last we iterate through the files in a directory where there are our files to resize and we save them into another directory (that we just created in the line of code above):
for i in os.listdir("img/cdslittle/"): im = Img.open("img/cdslittle/"+i) im.thumbnail((90,180), Img.ANTIALIAS) im.save("img/cdslittle4/"+i)
These are the images we are going to use in a future program, by the way (another edition of the cards game).
See ya
Comments
Post a Comment