其他分享
首页 > 其他分享> > pillow

pillow

作者:互联网

from PIL import Image
from PIL import ImageFilter
img = Image.open("E:/image/1.png")
print(img.format,img.mode)
# #图片逆时针翻转90°
# newImg = img.rotate(90,expand=True)
# newImg.show()
# #图片上下翻转
# newImg = img.transpose(Image.FLIP_TOP_BOTTOM)
# newImg.show()
# #图片左右翻转
# newImg = img.transpose(Image.FLIP_LEFT_RIGHT)
# newImg.show()
#图片模糊效果
newImg = img.filter(ImageFilter.BLUR)
newImg.show()
#图片轮廓效果
newImg = img.filter(ImageFilter.CONTOUR)
newImg.show()
#图片边缘增强
newImg = img.filter(ImageFilter.EDGE_ENHANCE)
newImg.show()
#图片浮雕
newImg = img.filter(ImageFilter.EMBOSS)
newImg.show()
#图片平滑
newImg = img.filter(ImageFilter.SMOOTH)
newImg.show()
#图片锐化
newImg = img.filter(ImageFilter.SHARPEN)
newImg.show()

标签:img,show,newImg,ImageFilter,filter,pillow,图片
来源: https://www.cnblogs.com/fanlulin/p/15078793.html