使用枕头库对图片应用最大滤镜
在本程序中,我们将使用枕头库对图片应用最小滤镜。在最大滤镜中,图片中被选中的窗口内每个像素的值都将替换为该窗口的最大像素。filter 函数用于利用枕头库应用不同的滤镜。
原图片

算法
Step 1: Import Image from Pillow. Step 2: Open the image. Step 3: Call the filter function and specify maxfilter. Step 4: Display the output.
示例代码
from PIL import Image, ImageFilter
im = Image.open('testimage.jpg')
im1 = im.filter(ImageFilter.MaxFilter(size = 7))
im1.show()输出

广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP