Page 1 of 1

imagemagick commands in perlmagick

Posted: 2011-09-03T04:42:05-07:00
by sin
hi,
Can you pleas tell me how to write these imagemagick commands in perlmagick..... i tried but i'm nt getting the required output. the output should be a silhoutte with white contour ad black background....so it should be a perfect black and white image.


convert a.png -fuzz 10% -fill white -opaque white a_f.png
convert a_f.png -transparent white a_tr.png
convert a_tr.png -alpha extract -edge 2 OUTPUT1.png

here the image a.png is
http://www.fmwconcepts.com/misc_tests/e ... ree_01.png

the result should be
http://www.fmwconcepts.com/misc_tests/e ... _edge2.png

I got this in imagemagick but im nt getting in this way in perlmagick


please guide me...!!!!!!!!!!!!!

Re: imagemagick commands in perlmagick

Posted: 2011-09-04T17:17:51-07:00
by anthony
I am not certain what the first two commands are doing, a threshold on the extracted alpha channel would probably do just as well.

As for the edge, of a binary image using morphology will probably give you much more control, and can get you the inside/outside. or both sides of the binary (or non-binary) edge.

convert a.png -alpha extract -threshold 90% \
-morphology EdgeIn Square:2 OUTPUT1.png

I known morphology is available in perl magick as Morphology() but I am not certain how 'alpha' channel operator is accessed. in the perl API.
http://imagemagick.org/script/perl-magick.php

Re: imagemagick commands in perlmagick

Posted: 2011-09-13T12:04:58-07:00
by sin
anthony wrote:I am not certain what the first two commands are doing, a threshold on the extracted alpha channel would probably do just as well.

As for the edge, of a binary image using morphology will probably give you much more control, and can get you the inside/outside. or both sides of the binary (or non-binary) edge.

convert a.png -alpha extract -threshold 90% \
-morphology EdgeIn Square:2 OUTPUT1.png

I known morphology is available in perl magick as Morphology() but I am not certain how 'alpha' channel operator is accessed. in the perl API.
http://imagemagick.org/script/perl-magick.php


this morphology command doesnt work for my logic....
can you please tell me the substitution command of "-edge" in perlmagick??

Re: imagemagick commands in perlmagick

Posted: 2011-09-13T13:26:42-07:00
by fmw42