Import module:from PIL import Image, ImageFilte
目的:主要对图片进行处理,如验证码图片的识别
Filter includes the following species:
Species name | BLUR | CONTOUR | DETAIL | EDGE_ENHANCE | EDGE_ENHANCE_MORE | EMBOSS | FIND_EDGES | SMOOTH | SMOOTH_MORE | SHARPEN |
filter | Fuzzy Filter | Contour filter | Details Filtering | Enhanced filtering boundary | Edge enhancement filter depth | Relief filter | Find boundary filtering (looking image boundary information | Smoothing | Depth of smoothing | Sharpen filter |
【使用方法】
from PIL import Image, ImageFilte
image_pillow DEF (file_path):
# File Open Image
Image = Image.open (file_path)
# operation of the picture, many modifications may be superimposed format
image_new = image.filter (ImageFilter.SMOOTH) .filter (ImageFilter.BLUE)
# pictures show the revised
image_new.show ()
image_new.save (file_path)
[Other Usage
The Gaussian Blur (Gaussian blur), UnsharpMask (unsharp masking filter), Kernel (convolution kernel filter), RankFilter (sorting filter), MedianFilter (minimum value filter), MinFilter (median filter), MaxFilter (the maximum value filter ), ModeFilter (filter mode)
Original link: https://blog.csdn.net/FloatDreamed/article/details/79015551