finds the skeletons of foreground regions in image by applying morphological thinning until convergence.


performs n iterations of morphological thinning.


treats values above t as foreground.

Details and Options

  • Thinning[image,] yields a binary image in which pixels representing the morphological skeleton have value 1 and others have value 0.
  • Thinning[image] is equivalent to Thinning[image,Infinity].
  • Thinning works with binary, grayscale, and arbitrary multichannel images, as well as real matrices.
  • Thinning takes a Padding option that specifies the values to assume for pixels outside the image. The default setting is Padding->0.
  • Thinning supports a Method option which specifies what thinning algorithm to be used. Possible settings include:
  • "Morphological"morphological thinning (default)
    "MedialAxis"approximate medial axis


open allclose all

Basic Examples  (1)

Morphological thinning of an image:

Scope  (2)

Applying the morphological thinning to a label matrix:

Thinning a grayscale image using a specific foreground threshold:

Options  (3)

Method  (1)

Find the approximate medial axis:

Padding  (2)

The padding value affects objects adjacent to the boundary:

Pad with the foreground value:

Applications  (2)

Simplify features in a fingerprint image:

Use the image skeleton to construct a graph:

Neat Examples  (2)

Extract possible paths through a maze:

Find the approximate Voronoi diagram of the foreground objects:

Wolfram Research (2010), Thinning, Wolfram Language function,


Wolfram Research (2010), Thinning, Wolfram Language function,


Wolfram Language. 2010. "Thinning." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2010). Thinning. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2021_thinning, author="Wolfram Research", title="{Thinning}", year="2010", howpublished="\url{}", note=[Accessed: 26-January-2022 ]}


@online{reference.wolfram_2021_thinning, organization={Wolfram Research}, title={Thinning}, year={2010}, url={}, note=[Accessed: 26-January-2022 ]}