Pillow中怎么旋转图像

  • Pillow中怎么旋转图像

    在Pillow中旋转图像可以使用rotate()方法。示例代码:from PIL import Image# 打开图像文件image = Image.open('example.jpg')# 旋转图像,顺时针旋转90度rotated_image = image.rotate(90)# 保存旋转后的图像rotated_image.save('rotated_e

    2024-05-22
    0