使用枕頭庫對圖片應用最大濾鏡
在本程式中,我們將使用枕頭庫對圖片應用最小濾鏡。在最大濾鏡中,圖片中被選中的視窗內每個畫素的值都將替換為該視窗的最大畫素。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