Skip to content

Conversation

@johnnygitgud
Copy link

This pull request adds documentation for the ImageMorph module
For issue #713 ("Todo: Docs for ImageMorph").

The updated documentation has:

  • Overview of morphological operations in Pillow
  • Explanation of structuring element patterns and ASCII masks
  • Usage examples for LutBuilder and MorphOp
  • Examples demonstrating pattern matching and apply()
  • Information about LUT loading, saving, and reuse
  • Guidance on required image modes

@radarhere radarhere changed the title Added documentation for Image Morph module [ci skip] Added documentation for ImageMorph module Nov 16, 2025
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for filling this gap in the docs!


Please can you check the Sphinx warnings?

https://app.readthedocs.org/projects/pillow/builds/30336202/?utm_source=pillow&utm_content=notification#294395027--277

ImageMorph.rst:13: WARNING: py:class reference target not found: LutBuilder [ref.class]
ImageMorph.rst:13: WARNING: py:class reference target not found: MorphOp [ref.class]
ImageMorph.rst:54: WARNING: py:class reference target not found: LutBuilder [ref.class]
ImageMorph.rst:59: WARNING: py:class reference target not found: LutBuilder [ref.class]
ImageMorph.rst:62: WARNING: py:class reference target not found: LutBuilder [ref.class]
ImageMorph.rst:83: WARNING: py:meth reference target not found: LutBuilder.get_lut [ref.meth]
ImageMorph.rst:83: WARNING: py:meth reference target not found: LutBuilder.load_lut [ref.meth]
ImageMorph.rst:83: WARNING: py:meth reference target not found: LutBuilder.save_lut [ref.meth]
ImageMorph.rst:87: WARNING: py:class reference target not found: MorphOp [ref.class]
ImageMorph.rst:90: WARNING: py:class reference target not found: MorphOp [ref.class]
ImageMorph.rst:90: WARNING: py:meth reference target not found: MorphOp.apply [ref.meth]
ImageMorph.rst:109: WARNING: py:meth reference target not found: MorphOp.match [ref.meth]
ImageMorph.rst:109: WARNING: py:meth reference target not found: MorphOp.get_on_pixels [ref.meth]
ImageMorph.rst:125: WARNING: py:class reference target not found: LutBuilder [ref.class]
ImageMorph.rst:145: WARNING: py:mod reference target not found: _imagingmorph [ref.mod]
ImageMorph.rst:145: WARNING: py:class reference target not found: LutBuilder [ref.class]
ImageMorph.rst:145: WARNING: py:class reference target not found: MorphOp [ref.class]

Co-authored-by: Hugo van Kemenade <[email protected]>
radarhere and others added 3 commits November 29, 2025 22:20
Co-authored-by: Hugo van Kemenade <[email protected]>
Co-authored-by: Hugo van Kemenade <[email protected]>
Comment on lines +33 to +34
For best results, use images with values restricted to 0 (black) and 255
(white), though intermediate grayscale values are also supported.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems redundant, as values in L mode images only range from 0 to 255.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants