图像旋转与格式转换
作者:互联网
1 from PIL import Image 2 img1 = Image.open(r'C:\Users\87823\Desktop\tree.png') 3 img1.rotate(90).show()
1 from PIL import Image 2 img1 = Image.open(r'C:\Users\87823\Desktop\tree.png') 3 # 图像旋转 4 #img1.rotate(90).show() 5 6 # 格式转换 7 img1.transpose(Image.FLIP_TOP_BOTTOM).show() # 上下滤镜 8 img1.transpose(Image.FLIP_LEFT_RIGHT).show() # 左右滤镜 9 img.transpose(Image.ROTATE_90).show()
标签:show,Image,transpose,旋转,图像,格式,img1,Desktop,90 来源: https://www.cnblogs.com/monsterhy123/p/12915680.html