Page 1 of 1

Neighborhood Maximum/Minimum in IM?

Posted: 2011-01-06T16:15:52-07:00
by foxyshadis
I looked through the documentation and the filter list and didn't see this, so I'm wondering if it's something that's in IM or that someone has implemented it in script. Many image-editing programs have a local min/max filter that uses 3x3, 5x5 etc, and it's handy in some instances. (For instance, on scans, a good way to squash dither patterns into solid colors without seriously impacting lettering is to average the local min & max together.)

Re: Neighborhood Maximum/Minimum in IM?

Posted: 2011-01-06T19:07:28-07:00
by fmw42
use -morphology dilate or erode (in non-binary mode) to do local min and max operations with various shapes and sizes: see http://www.imagemagick.org/Usage/morphology/

or see my statsfilt script at the link below. it does 3x3 min or max (as well as other filters).

Re: Neighborhood Maximum/Minimum in IM?

Posted: 2011-01-06T20:07:32-07:00
by foxyshadis
Thanks, the Hit/Miss & Pattern Matching methods on the page help solve another problem I was about to start experimenting with. Awesome!