imagemagick commands in perlmagick

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
sin
Posts: 46
Joined: 2011-04-23T11:06:13-07:00
Authentication code: 8675308

imagemagick commands in perlmagick

Post 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...!!!!!!!!!!!!!
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: imagemagick commands in perlmagick

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
sin
Posts: 46
Joined: 2011-04-23T11:06:13-07:00
Authentication code: 8675308

Re: imagemagick commands in perlmagick

Post 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??
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: imagemagick commands in perlmagick

Post by fmw42 »

Post Reply