SI_InteligentnyWozekWidlowy/imageClasification/imageResize.py
2022-05-25 08:11:49 +02:00

11 lines
263 B
Python

from PIL import Image
import os
import PIL
import glob
images = [file for file in os.listdir() if file.endswith(('jpeg', 'png', 'jpg'))]
for image in images:
img = Image.open(image)
img.thumbnail((256,256))
img.save(image, optimize=True, quality=60)