Skip to content

Latest commit

 

History

History
93 lines (61 loc) · 2 KB

ImageFilter.rst

File metadata and controls

93 lines (61 loc) · 2 KB

:py~PIL.ImageFilter Module

The :py~PIL.ImageFilter module contains definitions for a pre-defined set of filters, which can be be used with the :pyImage.filter() <PIL.Image.Image.filter> method.

Example: Filter an image

from PIL import ImageFilter

im1 = im.filter(ImageFilter.BLUR)

im2 = im.filter(ImageFilter.MinFilter(3))
im3 = im.filter(ImageFilter.MinFilter)  # same as MinFilter(3)

Filters

Pillow provides the following set of predefined image enhancement filters:

  • BLUR
  • CONTOUR
  • DETAIL
  • EDGE_ENHANCE
  • EDGE_ENHANCE_MORE
  • EMBOSS
  • FIND_EDGES
  • SHARPEN
  • SMOOTH
  • SMOOTH_MORE

PIL.ImageFilter.Color3DLUT

PIL.ImageFilter.BoxBlur

PIL.ImageFilter.GaussianBlur

PIL.ImageFilter.UnsharpMask

PIL.ImageFilter.Kernel

PIL.ImageFilter.RankFilter

PIL.ImageFilter.MedianFilter

PIL.ImageFilter.MinFilter

PIL.ImageFilter.MaxFilter

PIL.ImageFilter.ModeFilter

An abstract mixin used for filtering images (for use with :py~PIL.Image.Image.filter).

Implementors must provide the following method:

filter(self, image)

Applies a filter to a single-band image, or a single band of an image.

returns

A filtered copy of the image.

An abstract mixin used for filtering multi-band images (for use with :py~PIL.Image.Image.filter).

Implementors must provide the following method:

filter(self, image)

Applies a filter to a multi-band image.

returns

A filtered copy of the image.