Morphology: replace pixel-pattern by another pattern

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Erik
Posts: 12
Joined: 2016-04-30T00:18:15-07:00
Authentication code: 1151

Morphology: replace pixel-pattern by another pattern

Post 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' \
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Morphology: replace pixel-pattern by another pattern

Post by snibgo »

You've defined a kernel of width 1. A width of 2 would seem more useful.
snibgo's IM pages: im.snibgo.com
Post Reply