On Wed, 2 Sep 2009 10:21:04 +0200
Jens Augustenborg <[email protected]> wrote:

| Hi,
| 
| I am new to IM (PerlMagick) but I can handle simple things. On
| http://www.imagemagick.org/Usage/thumbnails/#torn the example is
| 
| convert thumbnail.gif \
|           \( +clone -threshold -1 -virtual-pixel black \
|              -spread 10 -blur 0x3 -threshold 50% -spread 1 -blur 0x.7 \) \
|           +matte -compose Copy_Opacity -composite torn_paper.png
| 
| 
| how does that look in PerlMagick??
| 
| My bonus question is: Even though the example page is good, where do I find
| a comprehensive tutorial in order to go from IM command line options to Perl
| syntax?
| 
A comprehensive tutorial?  Well now, no one has really stepped up for
that.  At least none I know of.

I have seen a guide for using MagickWand in C though it is more in the
form of examples.

You may however get a better response from the IM Discussion Forums,
especially the PerlMagic Forum.


First thing to remember is that PerlMagick does not delete images new
images that a operator creates to replace the older image.  Also it
may not apply a specific operation to a whole list of images requiring
you to loop though the image sequence itself.  Of course you can have
multiple images sequences too so that can make it easier.

Also as you have the image in memory you can easilly extract the size
of the existing image, meaning you can just create new canvases without
needing to clone and clear an existing image as you do on the command
line.

Next you go though the operations in the same sequence, checking errors
after each operation.

The hard part is mapping a command line operation to a PerlMagick
function call, and that can be tricky.  If you are up for it get the
source code of IM and look at "wand/mogrify.c" now search for the
specific command line option you are having trouble with.

For example for -threshold  search for  "threshold"  complete with the
quotes.  Their will be two matches, one for a quick syntax parse to make
sure all the options are found, and the second with the actual internal
calls for that option.  Here you will find the name of the library
function used, and that will usally directly map to the Perl function.
In this case...  BilevelImageChannel()

Further help for specific functions can be seen in the PerlMagick
Example scripts, which is both in the source, and generally installed in
the documentation area of PerlMagick.  On my system that was in
   /usr/share/doc/ImageMagick-perl-6.5.5/demo/





  Anthony Thyssen ( System Programmer )    <[email protected]>
 -----------------------------------------------------------------------------
    `` WARNING: Keyboard device not present. Press <F1> to continue... ''
                                        --- "American Megatrends" PC Bios
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to