Page 1 of 1

select only border!

Posted: 2009-06-10T10:08:05-07:00
by hawkfx
Hello friends.

I've an image like this:


[img=http://img31.imageshack.us/img31/2829/m ... adw.th.png]


I could convert with imagemagick to this:


[img=http://img31.imageshack.us/img31/5893/ok3.th.png]

Using:

Code: Select all


convert rapid.png -matte ( +clone -fuzz 8% -transparent rgb(176,108,80) ) -compose DstOut -composite info2.png
convert info2.png -normalize -threshold  100%   info.png


I want to select the border of the letters and just leave in black, the fill of the letters in transparent or white.

Hope you can help me

Re: select only border!

Posted: 2009-06-10T11:02:14-07:00
by fmw42
Sorry I don't understand what you want as the result? Is it just an outline of the letters? If so use -edge (see http://www.imagemagick.org/script/comma ... s.php#edge) after you current processing to make black and white.


convert ok3.png -background white -flatten -edge 1 -negate ok3_fw_e1n.png
Image

Re: select only border!

Posted: 2009-06-10T11:08:57-07:00
by hawkfx
I want something like this:


Image

Thanks!

Re: select only border!

Posted: 2009-06-10T11:29:24-07:00
by hawkfx
Thank you very much, I really appreciate.

Re: select only border!

Posted: 2009-06-11T18:55:55-07:00
by anthony
hawkfx wrote:

Code: Select all


convert rapid.png -matte ( +clone -fuzz 8% -transparent rgb(176,108,80) ) -compose DstOut -composite info2.png
convert info2.png -normalize -threshold  100%   info.png

This seems like a bit of a round about way of doing what seems to be background masking...

try this instead...

Code: Select all

convert rapid.png -fill white -fuzz 35% -draw 'color 0,0 replace' -fill black +opaque white info.png
or even more simply...

Code: Select all

convert rapid.png  -colorspace gray -normalize -threshold 20% info.png
If you really want to use the color (foreground) you provide then do this.

Code: Select all

convert rapid.png -fill black -fuzz 8% -opaque "rgb(176,108,80)" -fill white +opaque white info.png