Вы можете использовать python -resize-image.
Установить пакет:
pip install python-resize-image
Пример:
from PIL import Image
from resizeimage import resizeimage
#open image file
with open('image.jpg', 'r+b') as fd_img:
# create a PIL Image from file
img = Image.open(fd_img)
# resize image (contain)
img = resizeimage.resize_contain(img, [64, 64])
# covert to RBA incase it's RGBA
img = img.convert("RGB")
# save image
img.save('resized-image.jpg', img.format)