use_pil_blur.py 252 B

12345678910
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. from PIL import Image, ImageFilter
  4. # 打开一个jpg图像文件,注意是当前路径:
  5. im = Image.open('test.jpg')
  6. # 应用模糊滤镜:
  7. im2 = im.filter(ImageFilter.BLUR)
  8. im2.save('blur.jpg', 'jpeg')