ImageFilter
✖
ImageFilter
applies the function f to the range-r neighborhood of each pixel in each channel of image.
Details and Options


- ImageFilter is a generic neighborhood operator that replaces the value of each pixel by the result of applying a function to a pixel neighborhood. It can be used to implement linear or nonlinear local filters.
- ImageFilter works with 2D and 3D images with any number of channels, operating separately on each channel.
- ImageFilter[f,image,{r1,r2,…}] applies f to
blocks centered on each pixel.
- ImageFilter assumes the index coordinate system for lists and images.
- The channel values supplied to f are normally in the range 0 to 1, regardless of the underlying type used in the Image object. The function f is assumed to return channel values that are normally in the range 0 to 1.
- ImageFilter[f,image, r] returns an image of the same type as image.
- The following options can be given:
-
Interleaving False whether to supply f lists of channel values Masking All region of interest Padding "Fixed" what values to assume beyond the image - With the default setting Interleaving->False, the elements in the arrays to which f is applied are individual channel values for the pixels.
- With Interleaving->True, the elements are instead the list of all channel values for a particular pixel.
- ImageFilter by default gives an image of the same dimensions as image.
- With a setting Padding->None, ImageFilter[f,image,…] normally gives an image smaller than image.


Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Scope (4)Survey of the scope of standard use cases
Apply a local minimum filter to a binary image:

https://wolfram.com/xid/0puzjrxc0q-l61xc

Apply a median filter to a grayscale image:

https://wolfram.com/xid/0puzjrxc0q-e9jcgi

Apply a median filter to a color image:

https://wolfram.com/xid/0puzjrxc0q-46u81

Apply a local maximum filter to a 3D image:

https://wolfram.com/xid/0puzjrxc0q-ebb8tu

Options (5)Common values & functionality for each option
Interleaving (1)
Masking (1)
Applications (3)Sample problems that can be solved with this function
Properties & Relations (2)Properties of the function, and connections to other functions
Morphological dilation using ImageFilter:

https://wolfram.com/xid/0puzjrxc0q-jnxuw1

Use ImageFilter to perform a convolution:

https://wolfram.com/xid/0puzjrxc0q-rwu1ov

For images of real types, this is equivalent to ImageConvolve:

https://wolfram.com/xid/0puzjrxc0q-lgyhg3

Wolfram Research (2008), ImageFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageFilter.html (updated 2012).
Text
Wolfram Research (2008), ImageFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageFilter.html (updated 2012).
Wolfram Research (2008), ImageFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/ImageFilter.html (updated 2012).
CMS
Wolfram Language. 2008. "ImageFilter." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/ImageFilter.html.
Wolfram Language. 2008. "ImageFilter." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/ImageFilter.html.
APA
Wolfram Language. (2008). ImageFilter. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageFilter.html
Wolfram Language. (2008). ImageFilter. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ImageFilter.html
BibTeX
@misc{reference.wolfram_2025_imagefilter, author="Wolfram Research", title="{ImageFilter}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/ImageFilter.html}", note=[Accessed: 17-May-2025
]}
BibLaTeX
@online{reference.wolfram_2025_imagefilter, organization={Wolfram Research}, title={ImageFilter}, year={2012}, url={https://reference.wolfram.com/language/ref/ImageFilter.html}, note=[Accessed: 17-May-2025
]}