首页
技术
登录
6mi
u
盘
搜
搜 索
技术
Python对图片进行翻转(使用PIL)
Python对图片进行翻转(使用PIL)
技术
2022-07-11
83
from
PIL
import
Image PicPath
=
"./pic.jpg"
img
=
Image
.
open
(
PicPath
)
out
=
img
.
transpose
(
Image
.
FLIP_LEFT_RIGHT
)
#水平翻转
# out = img.transpose(Image.FLIP_TOP_BOTTOM) #垂直翻转
# out = img.rotate(45) #45°顺时针翻转
newname
=
"./pic_flip.jpg"
out
.
save
(
newname
)
转载请注明原文地址:https://ipadbbs.8miu.com/read-14363.html
最新回复
(
0
)