批量更改图片大小

1
2
3
4
5
from PIL import Image

img = Image.open("cat.bmp")
new_img = img.resize((40,40))
new_img.save("cat.bmp", "BMP", optimize=True)