Eerste commit voor Helvoirt Gevelreiniging
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import glob, os
|
||||
from PIL import Image, ImageOps
|
||||
src = sorted(glob.glob("input/foto's/*.jpeg"))
|
||||
os.makedirs("public/images", exist_ok=True)
|
||||
for i, p in enumerate(src, 1):
|
||||
im = ImageOps.exif_transpose(Image.open(p)).convert("RGB")
|
||||
w, h = im.size
|
||||
if w > 1600:
|
||||
im = im.resize((1600, round(h*1600/w)))
|
||||
out = f"public/images/werk-{i}.webp"
|
||||
im.save(out, "WEBP", quality=82, method=6)
|
||||
print("OK", out, im.size)
|
||||
Reference in New Issue
Block a user