使用 Pillow 库旋转图像
在该程序中,我们将使用 Pillow 库旋转图像。Image 类中的 rotate() 函数接受旋转角度。
原图

算法
Step1: Import Image class from Pillow. Step 2: Open the image. Step 3: Rotate the image. Step 4: Display the output.
示例代码
from PIL import Image
im = Image.open('testimage.jpg')
im.rotate(45).show()输出

广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP