Page 1 of 1

Morphology: replace pixel-pattern by another pattern

Posted: 2016-06-05T08:06:56-07:00
by Erik
Version: ImageMagick 6.9.4-1 Q16 x86_64 2016-05-17 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules OpenMP
Delegates (built-in): bzlib freetype jng jp2 jpeg lcms ltdl lzma png tiff webp wmf xml zlib
I'd like to use morphology to this replace BW-pattern:

Code: Select all

10
11
11
11
10
... with this pattern:

Code: Select all

10
10
10
10
10
The parameter below wouldn't work in my case, because I always need to check for black-pixel-neighbours on the left side, as given in the example above. The parameter cited below would also change this pattern, which is not what I want:

Code: Select all

00
11
11
11
00

Code: Select all

-morphology thinning '1x5>:0,1,1,1,0' \

Re: Morphology: replace pixel-pattern by another pattern

Posted: 2016-06-05T21:56:07-07:00
by snibgo
You've defined a kernel of width 1. A width of 2 would seem more useful.