Skip to content

Conversation

radarhere
Copy link
Member

https://pillow.readthedocs.io/en/stable/reference/ImageMorph.html

The default is to return the current pixel value, which is returned if no other match is found.

Operations:

  • 4 - 4 way rotation
  • N - Negate
  • 1 - Dummy op for no other operation (an op must always be given)
  • M - Mirroring

When parsing pattern strings, we currently allow operations of any length, even zero.

m = re.search(r"(\w*):?\s*\((.+?)\)\s*->\s*(\d)", p.replace("\n", ""))

This PR requires the operations to have length 1 instead.

@radarhere radarhere force-pushed the imagemorph_operation branch 4 times, most recently from 38207cb to 14c0af8 Compare July 24, 2025 13:16
@radarhere radarhere force-pushed the imagemorph_operation branch from 14c0af8 to 9431b7a Compare August 16, 2025 04:00
@hugovk hugovk added this to the 12.0.0 milestone Aug 16, 2025
@radarhere radarhere merged commit c7a268e into python-pillow:main Aug 31, 2025
51 checks passed
@radarhere radarhere deleted the imagemorph_operation branch August 31, 2025 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants