是的,Python的PIL庫(Pillow庫的升級版)提供了圖片旋轉功能。你可以使用rotate()方法來旋轉圖片。示例如下:
rotate()
from PIL import Image # 打開圖片文件 image = Image.open('example.jpg') # 旋轉圖片90度 rotated_image = image.rotate(90) # 保存旋轉后的圖片 rotated_image.save('rotated_example.jpg')