Dilation
✖
Dilation
Details and Options

- Dilation is also known as Minkowski addition.
- Dilation works with arbitrary 2D and 3D images, operating separately on each channel, as well as data arrays of any rank.
- The structuring element ker is a matrix containing
s and
s.
- Dilation[image,r] is equivalent to Dilation[image,BoxMatrix[r]].
- The structuring element is automatically padded with zeros to have odd dimensions. »
- Dilation takes a Padding option that specifies the values to assume for pixels outside the image.
- By default, Padding0 is used for images, corresponding to pixel value 0 for all channels.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Scope (13)Survey of the scope of standard use cases
Data (7)
Dilation of a 2D binary array:

https://wolfram.com/xid/0j439g3u-0o41u8


https://wolfram.com/xid/0j439g3u-cjhv08


https://wolfram.com/xid/0j439g3u-dx28gs


https://wolfram.com/xid/0j439g3u-om08hy

https://wolfram.com/xid/0j439g3u-6i5x1p

Dilation of a grayscale image:

https://wolfram.com/xid/0j439g3u-daz3f6


https://wolfram.com/xid/0j439g3u-9nvbmk

Dilation on a symbolic array of data:

https://wolfram.com/xid/0j439g3u-ioqpw6

Parameters (6)

https://wolfram.com/xid/0j439g3u-clylnb


https://wolfram.com/xid/0j439g3u-peee

Dilate with radius , equivalent to BoxMatrix[r]:

https://wolfram.com/xid/0j439g3u-sdyn1w

Dilate with a diagonal structuring element:

https://wolfram.com/xid/0j439g3u-brpwj8

Structuring elements with even dimensions are right-padded with zeros:

https://wolfram.com/xid/0j439g3u-mxexwk

Dilate a 3D volume using a 3D kernel:

https://wolfram.com/xid/0j439g3u-yrg1gy

Options (2)Common values & functionality for each option
Padding (2)
By default, the smallest possible number is used for padding when applying dilation to arrays:

https://wolfram.com/xid/0j439g3u-wifq5d


https://wolfram.com/xid/0j439g3u-1lxavm

By default, Padding->0 is used for images:

https://wolfram.com/xid/0j439g3u-m3hb9l

https://wolfram.com/xid/0j439g3u-rzmg3t


https://wolfram.com/xid/0j439g3u-vm3kbp

Applications (2)Sample problems that can be solved with this function
Dilation increases the amount of white space in the image, therefore removing smaller, dark features:

https://wolfram.com/xid/0j439g3u-fp261r

Compute external morphological gradient as a difference between dilated and original image:

https://wolfram.com/xid/0j439g3u-fd8j67

Properties & Relations (2)Properties of the function, and connections to other functions
Binary dilation is extensive if the center of the structuring element is 1:

https://wolfram.com/xid/0j439g3u-d7vgl7

https://wolfram.com/xid/0j439g3u-5tg1pq

Extensivity means that all elements of f are included in the Dilation[f,ker]:

https://wolfram.com/xid/0j439g3u-pqq2qk

Dilation with a box structuring element is the same as MaxFilter:

https://wolfram.com/xid/0j439g3u-jm6ubz

Possible Issues (1)Common pitfalls and unexpected behavior
Wolfram Research (2008), Dilation, Wolfram Language function, https://reference.wolfram.com/language/ref/Dilation.html (updated 2012).
Text
Wolfram Research (2008), Dilation, Wolfram Language function, https://reference.wolfram.com/language/ref/Dilation.html (updated 2012).
Wolfram Research (2008), Dilation, Wolfram Language function, https://reference.wolfram.com/language/ref/Dilation.html (updated 2012).
CMS
Wolfram Language. 2008. "Dilation." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/Dilation.html.
Wolfram Language. 2008. "Dilation." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2012. https://reference.wolfram.com/language/ref/Dilation.html.
APA
Wolfram Language. (2008). Dilation. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Dilation.html
Wolfram Language. (2008). Dilation. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Dilation.html
BibTeX
@misc{reference.wolfram_2025_dilation, author="Wolfram Research", title="{Dilation}", year="2012", howpublished="\url{https://reference.wolfram.com/language/ref/Dilation.html}", note=[Accessed: 06-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_dilation, organization={Wolfram Research}, title={Dilation}, year={2012}, url={https://reference.wolfram.com/language/ref/Dilation.html}, note=[Accessed: 06-June-2025
]}