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()
上一篇:Python添加excel图片报错:ImportError: You must install Pillow to fetch image objects


下一篇:Android实现Parcelable 直接intent传参