python批量resize图片

from PIL import Image
import os

root = "./test"
for file in os.listdir(root):
    print(file)
    image = Image.open(os.path.join(root,file))

    new_image = image.resize((1080,700))

    new_image.save(os.path.join(root,file))

你可能感兴趣的:(python脚本,python,开发语言)