Files
image_shenanigans/python/image_preparing.py
T
2026-09-06 01:06:15 +02:00

10 lines
220 B
Python

from PIL import Image
def resize_image_to_resolution(image_path, size=(0, 0)):
if image_path is None or size == (0, 0):
return None
with Image.open(image_path) as image:
return image.convert("RGB").resize(size)