发布于 2015-09-11 16:21:44 | 312 次阅读 | 评论: 0 | 来源: 网络整理
The ImageFilter module contains definitions for a pre-defined set of filters, which can be be used with the Image.filter() method.
from PIL import ImageFilter
im1 = im.filter(ImageFilter.BLUR)
im2 = im.filter(ImageFilter.MinFilter(3))
im3 = im.filter(ImageFilter.MinFilter) # same as MinFilter(3)
The current version of the library provides the following set of predefined image enhancement filters:
Gaussian blur filter.
参数: | radius – Blur radius. |
---|
Unsharp mask filter.
See Wikipedia’s entry on digital unsharp masking for an explanation of the parameters.
Create a convolution kernel. The current version only supports 3x3 and 5x5 integer and floating point kernels.
In the current version, kernels can only be applied to “L” and “RGB” images.
参数: |
|
---|
Create a rank filter. The rank filter sorts all pixels in a window of the given size, and returns the rank‘th value.
参数: |
|
---|
Create a median filter. Picks the median pixel value in a window with the given size.
参数: | size – The kernel size, in pixels. |
---|
Create a min filter. Picks the lowest pixel value in a window with the given size.
参数: | size – The kernel size, in pixels. |
---|
Create a max filter. Picks the largest pixel value in a window with the given size.
参数: | size – The kernel size, in pixels. |
---|
Create a mode filter. Picks the most frequent pixel value in a box with the given size. Pixel values that occur only once or twice are ignored; if no pixel value occurs more than twice, the original pixel value is preserved.
参数: | size – The kernel size, in pixels. |
---|