#encoding=utf-8
fromPILimportImage,ImageFilter
im = Image.open("meinv.jpg")
#显示图片
#im.show()
#缩放图片尺寸
w,h = im.size
im.thumbnail((w//2,h//2))
im.save('thumbnail.jpg','jpeg')
#滤镜效果
im2 = Image.open('thumbnail.jpg')
imBlur = im2.filter(ImageFilter.BLUR)
imBlur.save('blur.jpg','jpeg')
#细节增强滤波
im3 = Image.open('thumbnail.jpg')
imDetail = im3.filter(ImageFilter.DETAIL)
imDetail.save('detail.jpg','jpeg')
网友评论