#  -*- coding:UTF-8 -*-

from PIL import Image

# # 打开一个jpg图像文件，注意是当前路径
# im = Image.open('test.jpg')
# # 获得图像尺寸
# w, h = im.size
# print('Original image size: %sx%s' % (w, h))
# # 缩放到50%:
# im.thumbnail((w//2, h//2))
# print('Resize image to: %sX%s' % (w//2, h//2))
# # 把缩放后的图像用jpeg格式保存
# im.save('thumbnail.jpg', 'jpeg')

from PIL import ImageFilter

# 打开一个jpg图像文件,注意是当前路径
im = Image.open('test.jpg')
# 应用模糊滤镜:
im2 = im.filter(ImageFilter.BLUR)
im2.save('blur.jpg', 'jpeg')