Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > 8df4dad97a7cea117b07c1ea9b94db92 > files > 12

perl-Magick-5.5.4.4-7mdk.ppc.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <title>Perl API: ImageMagick - Image Processing and Display Package</title>
  <meta name="description" content="ImageMagick is a    robust collection of tools and libraries to read, write, and manipulate    an image in any of the more popular image formats including GIF, JPEG,    PNG, PDF, and Photo CD.  With ImageMagick you can create GIFs dynamically    making it suitable for Web applications.  You can also resize, rotate, sharpen, color reduce, or add special effects to an image and save your completed work in the same or differing image format.">
  <meta name="keywords" content="ImageMagick, Image Magick, Image Magic,    PerlMagick, Perl Magick, Perl Magic, CineMagick, PixelMagick, Pixel Magic,    WebMagick, Web Magic, visualization, image processing, software     development, simulation, image, software, AniMagick, Animagic,    Magick++">
   <link rel="StyleSheet" href="magick.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#0085c0" vlink="#800080" alink="#0085c0" >
<A HREF="http://promote.pair.com/direct.pl?imagemagick.org">
  <IMG SRC="promote.png" ALIGN=RIGHT WIDTH=120
    HEIGHT=60 BORDER=0></A>

<center><img src="magick_small.png" alt="" height="118" width="114">
</center>

<p><br>
 </p>
<p><a name="contents"></a>
<table border="0" width="100%">
 <tbody>
    <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
      <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Contents</font></font></font></b></td>
 </tr>

  </tbody>
</table>
  </p>
<ul>

  <li> <a href="#intr">Introduction</a></li>

  <li> <a href="#inst">Installation</a></li>

  <li> <a href="#over">Overview</a></li>

  <li> <a href="#exam">Example Script</a></li>

  <li> <a href="#read">Read or Write an Image</a></li>

  <li> <a href="#mani">Manipulate an Image</a></li>

  <li> <a href="#seta">Set an Image Attribute</a></li>

  <li> <a href="#geta">Get an Image Attribute</a></li>

  <li> <a href="#mont">Create an Image Montage</a></li>

  <li> <a href="#blobs">Working with Blobs</a></li>

  <li> <a href="#misc">Miscellaneous Methods</a></li>

  <li> <a href="#erro">Handling Errors</a></li>

  <li> <a href="#copy">Copyright</a></li>

</ul>

<dl>
<a name="intr"></a>
<table border="0" width="100%">
 <tbody>
    <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
      <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Introduction</font></font></font></b></td>
 </tr>

  </tbody>
</table>
<dd> <a href="archives.html">PerlMagick</a> is an objected-oriented
<a href="http://www.perl.com/perl/">Perl</a>
interface to <a href="../ImageMagick.html">ImageMagick</a>. Use
the module to read, manipulate, or write an image or image sequence from
within a Perl script. This makes it very suitable for Web CGI scripts. You
must have <b>ImageMagick</b> 5.4.3 or above and Perl version 5.005_02 or greater
installed on your system for either of these utilities to work.
</dd>
<p>
<dd>There are a number of useful scripts available to show you the value of <b>
PerlMagick</b>. You can do Web based image manipulation and conversion with
    <a href="archives.html">MagickStudio</a>, or use <a href="archives.html">
L-systems</a> to create images of plants using mathematical constructs, and
finally navigate through collections of thumbnail images and select the image
to view with the <a href="archives.html">WebMagick Image Navigator</a>. </dd>
    <dd>You can try <b>PerlMagick</b> from your Web browser at the <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">
ImageMagick Studio</a>. Or, you can see <a href="examples.jpg">
examples</a> of select <b>PerlMagick</b> functions.</p>
    </dl>
 <i><a href="#contents">Back to Contents</a></i> <br>
&nbsp;
    <dl>
    <a name="inst"></a>
    <table border="0" width="100%">
 <tbody>
        <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
          <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Installation</font></font></font></b></td>
 </tr>

      </tbody>
    </table>
    <dd> <b>UNIX</b></dd>
      </dl>
      <blockquote>
        <dl>
        <i>The following instructions for Unix apply only to the unbundled
PerlMagick as obtained from CPAN. PerlMagick is included as a subdirectory
(PerlMagick) of the ImageMagick source distribution, and may be configured
and built using the instructions provided in the ImageMagick distribution's
README.txt file. It is usually most convenient to install PerlMagick as part
of the ImageMagick distribution.</i>
        <p>ImageMagick must already be installed on your system. Next,
get the <a href="archives.html">PerlMagick</a> distribution corresponding
to the installed ImageMagick distribution (e.g. PerlMagick 5.39 for ImageMagick
5.3.0) and unpack it as shown below: <pre>&nbsp;&nbsp;&nbsp; gunzip -c PerlMagick-5.39.tar.gz | tar -xvf -<br>&nbsp;&nbsp;&nbsp; cd PerlMagick</pre>
 Next, edit <tt>Makefile.PL</tt> and change LIBS and INC to include the appropriate
path information to the required <tt>libMagick</tt> library. You will also
need paths to JPEG, PNG, TIFF, etc. delegates if they were included with
your installed version of <b>ImageMagick</b>. Build and install it like this:
        <pre>&nbsp;&nbsp;&nbsp; perl Makefile.PL<br>&nbsp;&nbsp;&nbsp; make<br>&nbsp;&nbsp;&nbsp; make install</pre>
 For Unix, you typically need to be <tt>root</tt> to install the software.
There are ways around this. Consult the Perl manual pages for more information.
        </p>
        <p><b>Windows XP / Windows 2000</b> </p>
        <p>ImageMagick must already be installed on your system. Also, the
ImageMagick source distribution for <a href="archives.html">Windows 2000</a>
 is required. You must also have the <tt>nmake</tt> from the Visual C++ or
J++ development environment. Copy <tt>\bin\IMagick.dll</tt> and <tt>\bin\X11.dll</tt>
 to a directory in your dynamic load path such as <tt>c:\perl\site\5.00502</tt>
. Next, type <pre>&nbsp;&nbsp;&nbsp; cd PerlMagick<br>&nbsp;&nbsp;&nbsp; copy Makefile.nt Makefile.PL<br>&nbsp;&nbsp;&nbsp; perl Makefile.PL<br>&nbsp;&nbsp;&nbsp; nmake<br>&nbsp;&nbsp;&nbsp; nmake install</pre>
<p>
See the <a href="http://www.dylanbeattie.net/magick/">PerlMagick Windows
HowTo</a> page for further installation instructions.
<p>
 <b>Running the Regression Tests</b> </p>
        <p>&nbsp;To verify a correct installation, type <pre>&nbsp;&nbsp;&nbsp; make test</pre>
 Use <tt>nmake test</tt> under Windows. There are a few demonstration scripts
available to exercise many of the functions <b>PerlMagick</b> can perform.
Type <pre>&nbsp;&nbsp;&nbsp; cd demo<br>&nbsp;&nbsp;&nbsp; make</pre>
 You are now ready to utilize the <b>PerlMagick</b> methods from within your
Perl scripts.</p>
        </dl>
        </blockquote>
 <i><a href="#contents">Back to Contents</a></i> <br>
&nbsp;
        <dl>
        <a name="over"></a>
        <table border="0" width="100%">
 <tbody>
            <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
              <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Overview</font></font></font></b></td>
 </tr>

          </tbody>
        </table>
        <dd> Any script that wants to use <b>PerlMagick</b> methods must
first define the methods within its namespace and instantiate an image object.
Do this with:</dd>
          </dl>
          <blockquote>
            <dl>
            <pre>&nbsp;&nbsp;&nbsp; use Image::Magick;<br><br>&nbsp;&nbsp;&nbsp; $image=Image::Magick-&gt;new;</pre>
The new() method takes the same parameters as <a href="#seta">SetAttribute</a>
. For example, <pre>&nbsp;&nbsp;&nbsp; $image=Image::Magick-&gt;new(size=&gt;'384x256');</pre>
Next you will want to read an image or image sequence, manipulate it, and
then display or write it. The input and output methods for <b>PerlMagick</b>
are defined in <a href="#read">Read or Write an Image</a>. See <a href="#seta">
Set an Image Attribute</a> for methods that affect the way an image is read
or written. Refer to <a href="#mani">Manipulate an Image</a> for a list of
methods to transform an image. <a href="#geta">Get an Image Attribute</a>
 describes how to retrieve an attribute for an image. Refer to <a href="#mont">
Create an Image Montage</a> for details about tiling your images as thumbnails
on a background. Finally, some methods do not neatly fit into any of the categories
just mentioned. Review <a href="#misc">Miscellaneous Methods</a> for a list
of these methods.
            <p>Once you are finished with a <b>PerlMagick</b> object you
should consider destroying it. Each image in an image sequence is stored
in virtual memory. This can potentially add up to mega-bytes of memory. Upon
destroying a <b>PerlMagick</b> object, the memory is returned for use by
other Perl methods. The recommended way to destroy an object is with <tt>
undef</tt>: <pre>&nbsp;&nbsp;&nbsp; undef $image;</pre>
 To delete all the images but retain the <tt>Image::Magick</tt> object use
            <pre>&nbsp;&nbsp;&nbsp; @$image = ();</pre>
 and finally, to delete a single image from a multi-image sequence, use <pre>&nbsp;&nbsp;&nbsp; undef $image-&gt;[x];</pre>
 The next section illustrates how to use various <b>PerlMagick</b> methods
to manipulate an image sequence.</p>
            </dl>
Some of the <b>PerlMagick</b> methods require external programs such as <i>
Ghostscript</i>. This may require an explicit path in your PATH environment
variable to work properly. For example, <pre>&nbsp;&nbsp;&nbsp; $ENV{PATH}='/bin:/usr/bin:/usr/local/bin';</pre>
            <br>
            </blockquote>
            <dl>
            <p> </p>
            </dl>
 <i><a href="#contents">Back to Contents</a></i> <br>
&nbsp; &nbsp;
            <dl>
            <a name="exam"></a>
            <table border="0" width="100%">
 <tbody>
                <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
                  <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Example Script</font></font></font></b></td>
 </tr>

              </tbody>
            </table>
            <dd> Here is an example script to get you started:</dd>
              </dl>
              <blockquote>
                <dl>
                <pre>&nbsp;&nbsp;&nbsp; #!/usr/local/bin/perl<br>&nbsp;&nbsp;&nbsp; use Image::Magick;<br><br>&nbsp;&nbsp;&nbsp; my($image, $x);<br><br>&nbsp;&nbsp;&nbsp; $image = Image::Magick-&gt;new;<br>&nbsp;&nbsp;&nbsp; $x = $image-&gt;Read('girl.png', 'logo.png', 'rose.png');<br>&nbsp;&nbsp;&nbsp; warn "$x" if "$x";<br><br>&nbsp;&nbsp;&nbsp; $x = $image-&gt;Crop(geometry=&gt;'100x100"+1"00"+1"00');<br>&nbsp;&nbsp;&nbsp; warn "$x" if "$x";<br><br>&nbsp;&nbsp;&nbsp; $x = $image-&gt;Write('x.png');<br>&nbsp;&nbsp;&nbsp; warn "$x" if "$x";</pre>
The script reads three images, crops them, and writes a single image as a
GIF animation sequence. In many cases you may want to access individual images
of a sequence. The next example illustrates how this is done: <pre>&nbsp;&nbsp;&nbsp; #!/usr/local/bin/perl<br>&nbsp;&nbsp;&nbsp; use Image::Magick;<br><br>&nbsp;&nbsp;&nbsp; my($image, $p, $q);<br><br>&nbsp;&nbsp;&nbsp; $image = new Image::Magick;<br>&nbsp;&nbsp;&nbsp; $image-&gt;Read('x1.png');<br>&nbsp;&nbsp;&nbsp; $image-&gt;Read('j*.jpg');<br>&nbsp;&nbsp;&nbsp; $image-&gt;Read('k.miff[1, 5, 3]');<br>&nbsp;&nbsp;&nbsp; $image-&gt;Contrast();<br>&nbsp;&nbsp;&nbsp; for ($x = 0; $image-&gt;[x]; $x++)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $image-&gt;[x]-&gt;Frame('100x200') if $image-&gt;[x]-&gt;Get('magick') eq 'GIF';<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; undef $image-&gt;[x] if $image-&gt;[x]-&gt;Get('columns') &lt; 100;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; $p = $image-&gt;[1];<br>&nbsp;&nbsp;&nbsp; $p-&gt;Draw(stroke=&gt;'red', primitive=&gt;'rectangle', points=&gt;20,20 100,100');<br>&nbsp;&nbsp;&nbsp; $q = $p-&gt;Montage();<br>&nbsp;&nbsp;&nbsp; undef $image;<br>&nbsp;&nbsp;&nbsp; $q-&gt;Write('x.miff');</pre>
Suppose you want to start out with a 100 by 100 pixel white canvas with a
red pixel in the center. Try <pre>&nbsp;&nbsp;&nbsp; $image = Image::Magick-&gt;new;<br>&nbsp;&nbsp;&nbsp; $image-&gt;Set(size=&gt;'100x100');<br>&nbsp;&nbsp;&nbsp; $image-&gt;ReadImage('xc:white');<br>&nbsp;&nbsp;&nbsp; $image-&gt;Set('pixel[49,49]'=&gt;'red');</pre>
Or suppose you want to convert your color image to grayscale: <pre>&nbsp;&nbsp;&nbsp; $image-&gt;Quantize(colorspace=&gt;'gray');</pre>
Here we annotate an image with a Taipai TrueType font: <pre>&nbsp;&nbsp;&nbsp; $text = 'Works like magick!';<br>&nbsp;&nbsp;&nbsp; $image-&gt;Annotate(font=&gt;'kai.ttf', pointsize=&gt;40, fill=&gt;'green', text=&gt;$text);</pre>
Other clever things you can do with a <b>PerlMagick</b> objects include <pre>&nbsp;&nbsp;&nbsp; $i = $#$p"+1";&nbsp;&nbsp; # return the number of images associated with object p<br>&nbsp;&nbsp;&nbsp; push(@$q, @$p);&nbsp; # push the images from object p onto object q<br>&nbsp;&nbsp;&nbsp; @$p = ();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # delete the images but not the object p<br>&nbsp;&nbsp;&nbsp; $p-&gt;Convolve([1, 2, 1, 2, 4, 2, 1, 2, 1]);&nbsp;&nbsp; # 3x3 Gaussian kernel</pre>
                </dl>
                </blockquote>
 <i><a href="#contents">Back to Contents</a></i> <br>
&nbsp; &nbsp;
                <dl>
                <a name="read"></a>
                <table border="0" width="100%">
 <tbody>
                    <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
                      <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Read or Write an Image</font></font></font></b></td>
 </tr>

                  </tbody>
                </table>
                <dd> Use the methods listed below to either read, write,
or display an image or image sequence.</dd>
                  </dl>
                  <blockquote>
                    <dl>
                    <table border="1">
 <caption>Read or Write Methods</caption>  <tbody>
                        <tr>
 <th>Method</th>
  <th>Parameters</th>
  <th>Return Value</th>
  <th>Description</th>
 </tr>
  <tr>
 <td>Read</td>
  <td>one or more filenames</td>
  <td>the number of images read&nbsp;</td>
  <td>read an image or image sequence</td>
 </tr>
  <tr>
 <td>Write</td>
  <td>filename</td>
  <td>the number of images written&nbsp;</td>
  <td>write an image or image sequence</td>
 </tr>
  <tr>
 <td>Display</td>
  <td>server name</td>
  <td>the number of images displayed&nbsp;</td>
  <td>display the image or image sequence to an X server</td>
 </tr>
  <tr>
 <td>Animate</td>
  <td>server name</td>
  <td>the number of images animated&nbsp;</td>
  <td>animate image sequence to an X server</td>
 </tr>

                      </tbody>
                    </table>
                    <p>For convenience, methods Write(), Display(), and Animate()
can take any parameter that <a href="#seta">SetAttribute</a> knows about.
For example, <pre>&nbsp;&nbsp;&nbsp; $image-&gt;Write(filename=&gt;'image.png', compression=&gt;'None');</pre>
 Use <tt>-</tt> as the filename to method Read() to read from standard in
or to method Write() to write to standard out: <pre>&nbsp;&nbsp;&nbsp; binmode STDOUT;<br>&nbsp;&nbsp;&nbsp; $image-&gt;Write('png:-');</pre>
 To read an image in the GIF format from a PERL filehandle, use: <pre>&nbsp;&nbsp;&nbsp; $image = Image::Magick-&gt;new;<br>&nbsp;&nbsp;&nbsp; open(IMAGE, 'image.gif');<br>&nbsp;&nbsp;&nbsp; $image-&gt;Read(file=&gt;\*IMAGE);<br>&nbsp;&nbsp;&nbsp; close(IMAGE);</pre>
 To write an image in the PNG format to a PERL filehandle, use: <pre>&nbsp;&nbsp;&nbsp; $filename = "image.png";<br>&nbsp;&nbsp;&nbsp; open(IMAGE, "&gt;$filename");<br>&nbsp;&nbsp;&nbsp; $image-&gt;Write(file=&gt;\*IMAGE, filename=&gt;$filename);<br>&nbsp;&nbsp;&nbsp; close(IMAGE);</pre>
If <tt>%0Nd, %0No, or %0Nx</tt> appears in the filename, it is interpreted
as a printf format specification and the specification is replaced with the
specified decimal, octal, or hexadecimal encoding of the scene number. For
example,</p>
<pre>
    image%03d.miff
</pre>
<p>
converts files image000.miff, image001.miff, etc.
</p>
                    <p>You can optionally add <i>Image</i> to any method
name. For example, ReadImage() is an alias for method Read().</p>
                    </dl>
                    </blockquote>
 <i><a href="#contents">Back to Contents</a></i> &nbsp; <br>
&nbsp;
                    <dl>
                    <a name="mani"></a>
                    <table border="0" width="100%">
 <tbody>
                        <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
                          <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Manipulate an Image</font></font></font></b></td>
 </tr>

                      </tbody>
                    </table>
                    <dd> Once you create an image with, for example, method
ReadImage() you may want to operate on it. Below is a list of all the image
manipulations methods available to you with <b>PerlMagick</b>. There are
                      <a href="examples.jpg">examples</a> of select
                      <b>PerlMagick</b> methods. Here is an example call
to an image manipulation method:</dd>
                      </dl>
                      <blockquote>
                        <dl>
                        <pre>&nbsp;&nbsp;&nbsp; $image-&gt;Crop(geometry=&gt;'100x100"+1"0+20');<br>&nbsp;&nbsp;&nbsp; $image-&gt;[x]-&gt;Frame("100x200");</pre>
And here is a list of other image manipulation methods you can call:<br>
                        <br>

                        <table border="1">
 <caption>Image Manipulation Methods</caption>  <tbody>
                            <tr>
 <th>Method</th>
  <th>Parameters</th>
  <th>Description</th>
 </tr>
  <tr>
 <td>AdaptiveThreshold</td>
  <td>geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>, height=&gt;<i>
integer</i>, offset=&gt;<i>integer</i></td>
  <td>local adaptive thresholding.</td>
 </tr>
  <tr>
 <td>AddNoise</td>
  <td>noise=&gt;{Uniform, Gaussian, Multiplicative, Impulse, Laplacian, Poisson}</td>
  <td>add noise to an image</td>
 </tr>
 <td>AffineTransform</td>
  <td>affine=&gt;<i>array of float values</i>,
	  translate=&gt;<i>float, float</i>, scale=&gt;<i> float, float</i>,
    rotate=&gt;<i>float</i>, skewX=&gt;<i>float</i>, skewY=&gt;<i>float</i></td>
  <td>affine transform image</td>
 </tr>
  <tr>
 <td>Annotate</td>
  <td>text=&gt;<i>string</i>, font=&gt;<i>string</i>, family=&gt;<i>string</i>,
  style=&gt;{Normal, Italic, Oblique, Any},
  stretch=&gt;{Normal, UltraCondensed, ExtraCondensed, Condensed,
    SemiCondensed, SemiExpanded, Expanded, ExtraExpanded, UltraExpanded},
  weight=&gt;<i>integer</i>, pointsize=&gt;<i>integer</i>,
  density=&gt;<i>geometry</i>, stroke=&gt;<i>
  <a href="color.html">color name</a></i>, strokewidth=&gt;<i>integer</i>,
  fill=&gt;<i><a href="color.html">color name</a></i>,
  undercolor=&gt;<i><a href="color.html">color name</a></i>,
  geometry=&gt;<i>geometry</i>,
  gravity=&gt;{NorthWest, North, NorthEast, West, Center, East, SouthWest,
    South, SouthEast},
  antialias=&gt;{true, false}, x=&gt;<i>integer</i>, y=&gt;<i>integer</i>,
	affine=&gt;<i>array of float values</i>,
  translate=&gt;<i>float, float</i>, scale=&gt;<i>float, float</i>,
  rotate=&gt;<i>float</i>. skewX=&gt;<i>float</i>, skewY=&gt;<i> float</i>,
	align=&gt;{Left, Center, Right},
	encoding=&gt;{UTF-8} </td>
  <td>annotate an image with text. See <a href="#misc">QueryFontMetrics</a>
 to get font metrics without rendering any text.</td>
 </tr>
  <tr>
 <td>Blur</td>
  <td>geometry=&gt;<i>geometry</i>, radius=&gt;<i>double</i>, sigma=&gt;<i>
double</i></td>
  <td>blur the image with a Gaussian operator of the given radius and standard
deviation (sigma).</td>
 </tr>
  <tr>
 <td>Border</td>
  <td>geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>, height=&gt;<i>
integer</i>, fill=&gt;<i><a href="color.html">color name</a></i></td>
  <td>surround the image with a border of color</td>
 </tr>
  <tr>
 <td>Channel</td>
  <td>channel=>{Red, Cyan, Green, Magenta, Blue, Yellow, Opacity, Black}</td>
  <td>extract a channel from the image</td>
 </tr>
  <tr>
 <td>Charcoal</td>
  <td>order=&gt;<i>integer</i></td>
  <td>simulate a charcoal drawing</td>
 </tr>
  <tr>
 <td>Chop</td>
  <td>geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>, height=&gt;<i>
integer</i>, x=&gt;<i>integer</i>, y=&gt;<i>integer</i></td>
  <td>chop an image</td>
 </tr>
  <tr>
 <td>Coalesce</td>
  <td><br>
                              </td>
  <td>merge a sequence of images</td>
 </tr>
  <tr>
 <td>Clip</td>
  <td><br>
                              </td>
  <td>apply any clipping path information as an image clip mask.</td>
 </tr>
  <tr>
 <td>ColorFloodfill</td>
  <td>geometry=&gt;<i>geometry</i>, x=&gt;<i>integer</i>, y=&gt;<i>integer</i>
, fill=&gt;<i><a href="color.html">color name</a></i>, bordercolor=&gt;<i><a href="color.html">
color name</a></i></td>
  <td>changes the color value of any pixel that matches the color of the target
pixel and is a neighbor. If you specify a border color, the color value is
changed for any neighbor pixel that is not that color.</td>
 </tr>
  <tr>
 <td>Colorize</td>
  <td>fill=&gt;<i><a href="color.html">color name</a></i>,
	  opacity=&gt;<i>string</a></i></td>
  <td>colorize the image with the fill color</td>
 </tr>
  <tr>
 <td>Comment</td>
  <td>string</td>
  <td>add a comment to your image</td>
 </tr>
  <tr>
 <td>Compare</td>
  <td>image=&gt;<i>image-handle</i></td>
  <td>compare image to a reference image</td>
 </tr>
  <tr>
 <td>Composite</td>
  <td> image=&gt;<i>image-handle</i>,
  compose=&gt;{Over, In, Out, Atop, Xor, Plus, Minus, Add, Subtract,
    Difference, Multiply, Bumpmap, Copy, CopyRed, CopyGreen, CopyBlue,
    CopyMatte, Dissolve, Clear, Displace, Modulate, Threshold},
    mask=&gt;<i>image-handle</i>, geometry=&gt;<i>geometry</i>,
    x=&gt;<i>integer</i>, y=&gt;<i>integer</i>,
    gravity=&gt;{NorthWest, North, NorthEast, West, Center, East, SouthWest,
    South, SouthEast}</i>, opacity=&gt;<i>integer</i>, tile=&gt;{True, False},
    rotate=&gt;<i>double</i>, color=&gt;<i><a href="color.html">color name</a>
   </i>

</td>
  <td>composite one image onto another</td>
 </tr>
  <tr>
 <td>Contrast</td>
  <td>sharpen=&gt;{True, False}</td>
  <td>enhance or reduce the image contrast</td>
 </tr>
  <tr>
 <td>Convolve</td>
  <td>coefficients=&gt;<i>array of float values</i></td>
  <td>apply a convolution kernel to the image. Given a kernel <i>order</i>
, you would supply <i>order*order</i> float values (e.g. 3x3 implies 9 values).</td>
 </tr>
  <tr>
 <td>Crop</td>
  <td>geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>, height=&gt;<i>
integer</i>, x=&gt;<i>integer</i>, y=&gt;<i>integer</i></td>
  <td>crop an image</td>
 </tr>
  <tr>
 <td>CycleColormap</td>
  <td>amount=&gt;<i>integer</i></td>
  <td>displace image colormap by amount</td>
 </tr>
  <tr>
 <td>Deconstruct</td>
  <td><br>
                              </td>
  <td>break down an image sequence into constituent parts</td>
 </tr>
  <tr>
 <td>Despeckle</td>
  <td><br>
                              </td>
  <td>reduce the speckles within an image</td>
 </tr>
  <tr>
 <td>Draw</td>
  <td>primitive=&gt;{point, line, rectangle, arc, ellipse, circle, path,
    polyline, polygon, bezier, color, matte, text, @<i>filename</i>},
    points=&gt;<i>string</i> , method=&gt;<i>{Point, Replace, Floodfill,
    FillToBorder, Reset}</i>, stroke=&gt;<i><a href="color.html">
color name</a></i>, fill=&gt;<i><a href="color.html">color name</a></i>,
tile=&gt;<i>image-handle</i>, strokewidth=&gt;<i>float</i>, antialias=&gt;{true,
false}, bordercolor=&gt;<i><a href="color.html">color name</a></i>, x=&gt;<i>
float</i>, y=&gt;<i>float</i>, affine=&gt;<i>array of float values</i>,
translate=&gt;<i>float, float</i>, scale=&gt;<i>
float, float</i>, rotate=&gt;<i>float</i>. skewX=&gt;<i>float</i>, skewY=&gt;<i>
float</i></td>
  <td>annotate an image with one or more graphic primitives</td>
 </tr>
  <tr>
 <td>Edge</td>
  <td>radius=&gt;<i>double</i></td>
  <td>enhance edges within the image with a convolution filter of the given
radius.</td>
 </tr>
  <tr>
 <td>Emboss</td>
  <td>geometry=&gt;<i>geometry</i>, radius=&gt;<i>double</i>, sigma=&gt;<i>
double</i></td>
  <td>emboss the image with a convolution filter of the given radius and standard
deviation (sigma).</td>
 </tr>
  <tr>
 <td>Enhance</td>
  <td><br>
                              </td>
  <td>apply a digital filter to enhance a noisy image</td>
 </tr>
  <tr>
 <td>Equalize</td>
  <td><br>
                              </td>
  <td>perform histogram equalization to the image</td>
 </tr>
  <tr>
 <td>Flatten</td>
  <td><br>
                              </td>
  <td>flatten a sequence of images</td>
 </tr>
  <tr>
 <td>Flip</td>
  <td><br>
                              </td>
  <td>create a <i>mirror image</i> by reflecting the image scanlines in the
vertical direction</td>
 </tr>
  <tr>
 <td>Flop</td>
  <td><br>
                              </td>
  <td>create a <i>mirror image</i> by reflecting the image scanlines in the
horizontal direction</td>
 </tr>
  <tr>
 <td>Frame</td>
  <td>geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>, height=&gt;<i>
integer</i>, inner=&gt;<i>integer</i>, outer=&gt;<i>integer</i>, fill=&gt;<i><a href="color.html">
color name</a></i></td>
  <td>surround the image with an ornamental border</td>
 </tr>
  <tr>
 <td>Gamma</td>
  <td>gamma=&gt;<i>string</i>, red=&gt;<i>double</i>, green=&gt;<i>double</i>
, blue=&gt;<i>double</i></td>
  <td>gamma correct the image</td>
 </tr>
  <tr>
 <td>Implode</td>
  <td>amount=&gt;<i>double</i></td>
  <td>implode image pixels about the center</td>
 </tr>
  <tr>
 <td>Label</td>
  <td>string</td>
  <td>assign a label to an image</td>
 </tr>
  <tr>
 <td>Level</td>
  <td>level=&gt;<i>string</i>, 'black-point'=&gt;<i>double</i>,
    'gamma'=&gt;<i>double</i>, 'white-point'=&gt;<i>double</i></td>
  <td>adjust the level of image contrast</td>
 </tr>
  <tr>
 <td>Magnify</td>
  <td><br>
                              </td>
  <td>double the size of an image</td>
 </tr>
  <tr>
 <td>Map</td>
  <td>image=&gt;<i>image-handle</i>, dither=&gt;{True, False}</td>
  <td>choose a particular set of colors from this image</td>
 </tr>
  <tr>
 <td>MatteFloodfill</td>
  <td>geometry=&gt;<i>geometry</i>, x=&gt;<i>integer</i>, y=&gt;<i>integer</i>
, matte=&gt;<i>integer</i>, bordercolor=&gt;<i><a href="color.html">color name</a></i></td>
  <td>changes the matte value of any pixel that matches the color of the target
pixel and is a neighbor. If you specify a border color, the matte value is
changed for any neighbor pixel that is not that color.</td>
 </tr>
  <tr>
 <td>MedianFilter</td>
  <td>radius=&gt;<i>double</i></td>
  <td>replace each pixel with the median intensity pixel of a neighborhood.&nbsp;</td>
 </tr>
  <tr>
 <td>Minify</td>
  <td><br>
                              </td>
  <td>half the size of an image</td>
 </tr>
  <tr>
 <td>Modulate</td>
  <td>brightness=&gt;<i>double</i>, saturation=&gt;<i>double</i>, hue=&gt;<i>
double</i></td>
  <td>vary the brightness, saturation, and hue of an image by the specified
percentage</td>
 </tr>
  <tr>
 <td>MotionBlur</td>
  <td>geometry=&gt;<i>geometry</i>, radius=&gt;<i>double</i>, sigma=&gt;<i>
double</i>,   angle=&gt;<i>double</i></td>
  <td>blur the image with a Gaussian operator of the given radius and standard
deviation (sigma) at the given angle to simulate the effect of motion</td>
 </tr>
                            <tr>
 <td>Negate</td>
  <td>gray=&gt;{True, False}</td>
  <td>replace every pixel with its complementary color (white becomes black,
yellow becomes blue, etc.)</td>
 </tr>
  <tr>
 <td>Normalize</td>
  <td><br>
                              </td>
  <td>transform image to span the full range of color values</td>
 </tr>
  <tr>
 <td>OilPaint</td>
  <td>radius=&gt;<i>integer</i></td>
  <td>simulate an oil painting</td>
 </tr>
  <tr>
 <td>Opaque</td>
  <td>color=&gt;<i><a href="color.html">color name</a></i>, fill=&gt;<i><a href="color.html">
color name</a></i></td>
  <td>change this color to the fill color within the image</td>
 </tr>
  <tr>
 <td>Quantize</td>
  <td>colors=&gt;<i>integer</i>, colorspace=&gt;{RGB, Gray, Transparent,
OHTA, XYZ, YCbCr, YIQ, YPbPr, YUV, CMYK}, treedepth=&gt; <i>integer</i>,
dither=&gt;{True, False}, measure_error=&gt;{True, False}, global_colormap=&gt;{True,
False}</td>
  <td>preferred number of colors in the image</td>
 </tr>
  <tr>
 <td>Profile</td>
  <td>name=&gt;{ICM, IPTC}, profile=&gt;<i>blob</td>
  <td>add or remove ICC or IPTC image profile</td>
 </tr>
  <tr>
 <td>Raise</td>
  <td>geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>, height=&gt;<i>
integer</i>, x=&gt;<i>integer</i>, y=&gt;<i>integer</i>, raise=&gt;{True,
False}</td>
  <td>lighten or darken image edges to create a 3-D effect</td>
 </tr>
  <tr>
 <td>ReduceNoise</td>
  <td>radius=&gt;<i>double</i></td>
  <td>reduce noise in the image with a noise peak elimination filter&nbsp;</td>
 </tr>
  <tr>
 <td>Resize</td>
  <td>geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>, height=&gt;<i>
integer</i>, filter=&gt;{Point, Box, Triangle, Hermite, Hanning, Hamming,
Blackman, Gaussian, Quadratic, Cubic, Catrom, Mitchell, Lanczos, Bessel,
Sinc}, blur=&gt;<i>double</i></td>
  <td>scale image to desired size. Specify <tt>blur</tt> &gt; 1 for blurry
or &lt; 1 for sharp</td>
 </tr>
  <tr>
 <td>Roll</td>
  <td>geometry=&gt;<i>geometry</i>, x=&gt;<i>integer</i>, y=&gt;<i>integer</i></td>
  <td>roll an image vertically or horizontally</td>
 </tr>
  <tr>
 <td>Rotate</td>
  <td>degrees=&gt;<i>double</i>,
    color=&gt;<i><a href="color.html">color name</a></i> </td>
  <td>rotate an image</td>
 </tr>
  <tr>
 <td>Sample</td>
  <td>geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>, height=&gt;<i>
integer</i></td>
  <td>scale image with pixel sampling</td>
 </tr>
  <tr>
 <td>Scale</td>
  <td>geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>, height=&gt;<i>
integer</i></td>
  <td>scale image to desired size</td>
 </tr>
  <tr>
 <td>Segment</td>
  <td>colorspace=&gt;{RGB, Gray, Transparent, OHTA, XYZ, YCbCr, YCC, YIQ,
YPbPr, YUV, CMYK}, verbose={True, False}, cluster=&gt;<i>double</i>, smooth=<i>
double</i></td>
  <td>segment an image by analyzing the histograms of the color components
and identifying units that are homogeneous</td>
 </tr>
  <tr>
 <td>Shade</td>
  <td>geometry=&gt;<i>geometry</i>, azimuth=&gt;<i>double</i>, elevation=&gt;<i>
double</i>, gray=&gt;{true, false}&nbsp;</td>
  <td>shade the image using a distant light source</td>
 </tr>
  <tr>
 <td>Sharpen</td>
  <td>geometry=&gt;<i>geometry</i>, radius=&gt;<i>double</i>, sigma=&gt;<i>
double</i></td>
  <td>sharpen the image with a Gaussian operator of the given radius and standard
deviation (sigma).</td>
 </tr>
  <tr>
 <td>Shave</td>
  <td>geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>,   height=&gt;<i>
integer</i> </td>
  <td>shave pixels from the image edges</td>
 </tr>
  <tr>
 <td>Shear</td>
  <td>geometry=&gt;<i>geometry</i>, x=&gt;<i>double</i>, y=&gt;<i>double</i>
    color=&gt;<i><a href="color.html">color name</a></i> </td>
  <td>shear the image along the X or Y axis by a positive or negative shear
angle</td>
 </tr>
  <tr>
 <td>Signature</td>
  <td><br>
                              </td>
  <td>generate an SHA-256 message digest for the image pixel stream</td>
 </tr>
  <tr>
 <td>Solarize</td>
  <td>threshold=&gt;<i>integer</i></td>
  <td>negate all pixels above the threshold level</td>
 </tr>
  <tr>
 <td>Spread</td>
  <td>amount=&gt;<i>integer</i></td>
  <td>displace image pixels by a random amount</td>
 </tr>
  <tr>
 <td>Stereo</td>
  <td>image=&gt;<i>image-handle</i></td>
  <td>composites two images and produces a single image that is the composite
of a left and right image of a stereo pair</td>
 </tr>
  <tr>
 <td>Stegano</td>
  <td>image=&gt;<i>image-handle</i>, offset=&gt;<i>integer</i></td>
  <td>hide a digital watermark within the image</td>
 </tr>
  <tr>
 <td>Swirl</td>
  <td>degrees=&gt;<i>double</i></td>
  <td>swirl image pixels about the center</td>
 </tr>
  <tr>
 <td>Texture</td>
  <td>texture=&gt;<i>image-handle</i></td>
  <td>name of texture to tile onto the image background</td>
 </tr>
  <tr>
 <td>Threshold</td>
  <td>threshold=&gt;<i>string</i></td>
 <td>threshold the image</td>
 </tr>
  <tr>
 <td>Transparent</td>
  <td>color=&gt;<i><a href="color.html">color name</a></i></td>
  <td>make this color transparent within the image</td>
 </tr>
  <tr>
 <td>Trim</td>
  <td><br>
                              </td>
  <td>remove edges that are the background color from the image</td>
 </tr>
  <tr>
 <td>UnsharpMask</td>
  <td>geometry=&gt;<i>geometry</i>, radius=&gt;<i>double</i>, sigma=&gt;<i>
double</i>, amount=&gt;<i>double</i>, threshold=&gt;<i>double</i></td>
  <td>sharpen the image with the unsharp mask algorithm.</td>
 </tr>
  <tr>
 <td>Wave</td>
  <td>geometry=&gt;<i>geometry</i>, amplitude=&gt;<i>double</i>, wavelength=&gt;<i>
double</i></td>
  <td>alter an image along a sine wave</td>
 </tr>

                          </tbody>
                        </table>
                        <p>Note, that the <tt>geometry</tt> parameter is
a short cut for the <tt>width</tt> and <tt>height</tt> parameters (e.g. <tt>
geometry=&gt;'106x80'</tt> is equivalent to <tt>width=&gt;106, height=&gt;80</tt>
). </p>
                        <p>You can specify <tt>@filename</tt> in both Annotate()
and Draw(). This reads the text or graphic primitive instructions from a
file on disk. For example, <pre>&nbsp;&nbsp; $image-&gt;Draw(fill=&gt;'red', primitive=&gt;'rectangle',&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp; points=&gt;'20,20 100,100&nbsp; 40,40 200,200&nbsp; 60,60 300,300');</pre>
 Is equivalent to <pre>&nbsp;&nbsp; $image-&gt;Draw(fill=&gt;'red', primitive=&gt;'@draw.txt');</pre>
 Where <tt>draw.txt</tt> is a file on disk that contains this: <pre>&nbsp; rectangle 20, 20 100, 100<br>&nbsp; rectangle 40, 40 200, 200<br>&nbsp; rectangle 60, 60 300, 300</pre>
 The <i>text</i> parameter for methods, Annotate(), Comment(), Draw(), and
Label() can include the image filename, type, width, height, or other image
attribute by embedding these special format characters: <pre>&nbsp;&nbsp;&nbsp; %b&nbsp;&nbsp; file size<br>&nbsp;&nbsp;&nbsp; %d&nbsp;&nbsp; comment<br>&nbsp;&nbsp;&nbsp; %d&nbsp;&nbsp; directory<br>&nbsp;&nbsp;&nbsp; %e&nbsp;&nbsp; filename extension<br>&nbsp;&nbsp;&nbsp; %f&nbsp;&nbsp; filename<br>&nbsp;&nbsp;&nbsp; %h&nbsp;&nbsp; height<br>&nbsp;&nbsp;&nbsp; %m&nbsp;&nbsp; magick<br>&nbsp;&nbsp;&nbsp; %p&nbsp;&nbsp; page number<br>&nbsp;&nbsp;&nbsp; %s&nbsp;&nbsp; scene number<br>&nbsp;&nbsp;&nbsp; %t&nbsp;&nbsp; top of filename<br>&nbsp;&nbsp;&nbsp; %w&nbsp;&nbsp; width<br>&nbsp;&nbsp;&nbsp; %x&nbsp;&nbsp; x resolution<br>&nbsp;&nbsp;&nbsp; %y&nbsp;&nbsp; y resolution<br>&nbsp;&nbsp;&nbsp; \n&nbsp;&nbsp; newline<br>&nbsp;&nbsp;&nbsp; \r&nbsp;&nbsp; carriage return</pre>
 For example, <pre>&nbsp; text=&gt;"%m:%f %wx%h"</pre>
  </p>
                        </dl>
 produces an annotation of <b>MIFF:bird.miff 512x480</b> for an image titled
                        <b>bird.miff</b> and whose width is 512 and height
is 480.
                        <dl>
                        <p>You can optionally add <i>Image</i> to any method
name. For example, TrimImage() is an alias for method Trim(). </p>
                        <p>Most of the attributes listed above have an analog
in <a href="convert.html">convert</a>. See the documentation for a more detailed
description of these attributes.</p>
                        </dl>
                        </blockquote>
 <i><a href="#contents">Back to Contents</a></i> <br>
&nbsp; &nbsp;
                        <dl>
                        <a name="seta"></a>
                        <table border="0" width="100%">
 <tbody>
                            <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
                              <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Set an Image Attribute</font></font></font></b></td>
 </tr>

                          </tbody>
                        </table>
                        <dd> Use method Set() to set an image attribute.
For example,</dd>
                          </dl>
                          <blockquote>
                            <dl>
                            <pre>&nbsp;&nbsp;&nbsp; $image-&gt;Set(dither=&gt;'True');<br>&nbsp;&nbsp;&nbsp; $image-&gt;[$x]-&gt;Set(delay=&gt;3);</pre>
And here is a list of all the image attributes you can set:<br>
                            <br>

                            <table border="1">
 <caption>Image Attributes</caption>  <tbody>
                                <tr>
 <th>Attribute</th>
  <th>Values</th>
  <th>Description</th>
 </tr>
  <tr>
 <td>adjoin</td>
  <td>{True, False}</td>
  <td>join images into a single multi-image file</td>
 </tr>
  <tr>
 <td>antialias</td>
  <td>{True, False}</td>
  <td>remove pixel aliasing</td>
 </tr>
 <td>authenticate</td>
  <td><i>string</i></td>
  <td>decrypt image with this password.</td>
 </tr>
  <tr>
 <td>background</td>
  <td><i><a href="color.html">color name</a></i></td>
  <td>image background color</td>
 </tr>
  <tr>
 <td>blue-primary</td>
  <td><i>x-value</i>, <i>y-value</i></td>
  <td>chromaticity blue primary point (e.g. 0.15, 0.06)</td>
 </tr>
  <tr>
 <td>bordercolor</td>
  <td><i><a href="color.html">color name</a></i></td>
  <td>set the image border color</td>
 </tr>
  <tr>
 <td>clip-mask</td>
  <td><i>image</i></td>
  <td>Associate a clip mask with the image.</td>
 </tr>
  <tr>
 <td>colormap[<i>i</i>]</td>
  <td><i><a href="color.html">color name</a></i></td>
  <td>color name (e.g. red) or hex value (e.g. #ccc) at position <i>i</i></td>
 </tr>
  <tr>
 <td>colorspace</td>
  <td>{RGB, CMYK}</td>
  <td>type of colorspace</td>
 </tr>
 <td>comment</td>
  <td><i>string</i></td>
  <td>Append to the image comment.</td>
 </tr>
  <tr>
 <td>compression</td>
  <td>{None, BZip, Fax, Group4, JPEG, LosslessJPEG, LZW, RLE, Zip}</td>
  <td>type of image compression</td>
 </tr>
  <tr>
 <td>debug</td>
  <td><i>{No, Configure, Annotate, Render, Locale, Coder, X11, Cache, Blob, All}</i></td>
  <td>display copious debugging information</td>
 </tr>
  <tr>
 <td>delay</td>
  <td><i>integer</i></td>
  <td>this many 1/100ths of a second\fP must expire before displaying the
next image in a sequence</td>
 </tr>
  <tr>
 <td>density</td>
  <td><i>geometry</i></td>
  <td>vertical and horizontal resolution in pixels of the image</td>
 </tr>
  <tr>
 <td>disk-limit</td>
  <td><i>integer</i></td>
  <td>set disk resource limit in megabytes</td>
 </tr>
  <tr>
 <td>dispose</td>
  <td><i>{Undefined, None, Background, Previous}</i></td>
  <td>GIF disposal method</td>
 </tr>
  <tr>
 <td>dither</td>
  <td>{True, False}</td>
  <td>apply error diffusion to the image</td>
 </tr>
  <tr>
 <td>display</td>
  <td><i>string</i></td>
  <td>specifies the X server to contact</td>
 </tr>
  <tr>
 <td>file</td>
  <td><i>filehandle</i></td>
  <td>set the image filehandle</td>
 </tr>
  <tr>
 <td>filename</td>
  <td><i>string</i></td>
  <td>set the image filename</td>
 </tr>
  <tr>
 <td>fill</td>
  <td><i>color</i></td>
  <td>The fill color paints any areas inside the outline of drawn shape.</td>
 </tr>
  <tr>
 <td>font</td>
  <td><i>string</i></td>
  <td>use this font when annotating the image with text</td>
 </tr>
  <tr>
 <td>fuzz</td>
  <td><i>integer</i></td>
  <td>colors within this distance are considered equal</td>
 </tr>
  <tr>
 <td>gamma</td>
  <td><i>double</i></td>
  <td>gamma level of the image</td>
 </tr>
  <tr>
 <td>Gravity</td>
  <td>{Forget, NorthWest, North, NorthEast, West, Center, East,
    SouthWest, South, SouthEast}</td>
  <td>type of image gravity</td>
 </tr>
  <tr>
 <td>green-primary</td>
  <td><i>x-value</i>, <i>y-value</i></td>
  <td>chromaticity green primary point (e.g. 0.3, 0.6)</td>
 </tr>
  <tr>
 <td>index[<i>x</i>, <i>y</i>]</td>
  <td><i>string</i></td>
  <td>colormap index at position (<i>x</i>, <i>y</i>)</td>
 </tr>
  <tr>
 <td>interlace</td>
  <td>{None, Line, Plane, Partition}</td>
  <td>the type of interlacing scheme</td>
 </tr>
  <tr>
 <td>iterations</td>
  <td><i>integer</i></td>
  <td>add Netscape loop extension to your GIF animation</td>
 </tr>
 <td>label</td>
  <td><i>string</i></td>
  <td>Append to the image label.</td>
 </tr>
  <tr>
 <td>loop</td>
  <td><i>integer</i></td>
  <td>add Netscape loop extension to your GIF animation</td>
 </tr>
  <tr>
 <td>magick</td>
  <td><i>string</i></td>
  <td>set the image format</td>
 </tr>
  <tr>
 <td>matte</td>
  <td>{True, False}</td>
  <td>True if the image has transparency</td>
 </tr>
  <tr>
 <td>mattecolor</td>
  <td><i><a href="color.html">color name</a></i></td>
  <td>set the image matte color</td>
 </tr>
  <tr>
 <td>map-limit</td>
  <td><i>integer</i></td>
  <td>set map resource limit in megabytes</td>
 </tr>
  <tr>
 <td>memory-limit</td>
  <td><i>integer</i></td>
  <td>set memory resource limit in megabytes</td>
 </tr>
  <tr>
 <td>monochrome</td>
  <td>{True, False}</td>
  <td>transform the image to black and white</td>
 </tr>
  <tr>
 <td>page</td>
  <td>{ Letter, Tabloid, Ledger, Legal, Statement, Executive, A3, A4, A5,
B4, B5, Folio, Quarto, 10x14} or <i>geometry</i></td>
  <td>preferred size and location of an image canvas</td>
 </tr>
  <tr>
 <td>pixel[<i>x</i>, <i>y</i>]</td>
  <td><i>string</i></td>
  <td>hex value (e.g. #ccc) at position (<i>x</i>, <i>y</i>)</td>
 </tr>
  <tr>
 <td>pointsize</td>
  <td><i>integer</i></td>
  <td>pointsize of the Postscript or TrueType font</td>
 </tr>
  <tr>
 <td>preview</td>
  <td>{ Rotate, Shear, Roll, Hue, Saturation, Brightness, Gamma, Spiff, Dull,
Grayscale, Quantize, Despeckle, ReduceNoise, AddNoise, Sharpen, Blur, Threshold,
EdgeDetect, Spread, Solarize, Shade, Raise, Segment, Swirl, Implode, Wave,
OilPaint, CharcoalDrawing, JPEG}&nbsp;</td>
  <td>type of preview for the Preview image format</td>
 </tr>
  <tr>
 <td>quality</td>
  <td><i>integer</i></td>
  <td>JPEG/MIFF/PNG compression level</td>
 </tr>
  <tr>
 <td>red-primary</td>
  <td><i>x-value</i>, <i>y-value</i></td>
  <td>chromaticity red primary point (e.g. 0.64, 0.33)</td>
 </tr>
  <tr>
 <td>rendering-intent</td>
  <td>{Undefined, Saturation, Perceptual, Absolute, Relative}</td>
  <td>the type of rendering intent</td>
 </tr>
  <tr>
 <td>sampling-factor</td>
  <td><i>geometry</i></td>
  <td>horizontal and vertical sampling factor</td>
 </tr>
  <tr>
 <td>scene</td>
  <td><i>integer</i></td>
  <td>image scene number</td>
 </tr>
  <tr>
 <td>subimage</td>
  <td><i>integer</i></td>
  <td>subimage of an image sequence</td>
 </tr>
  <tr>
 <td>subrange</td>
  <td><i>integer</i></td>
  <td>number of images relative to the base image</td>
 </tr>
  <tr>
 <td>server</td>
  <td><i>string</i></td>
  <td>specifies the X server to contact</td>
 </tr>
  <tr>
 <td>size</td>
  <td><i>string</i></td>
  <td>width and height of a raw image</td>
 </tr>
  <tr>
 <td>stroke</td>
  <td><i>color</i></td>
  <td>The stroke color paints along the outline of a shape.</td>
 </tr>
  <tr>
 <td>tile</td>
  <td><i>string</i></td>
  <td>tile name</td>
 </tr>
  <tr>
 <td>texture</td>
  <td><i>string</i></td>
  <td>name of texture to tile onto the image background</td>
 </tr>
  <tr>
 <td>type</td>
  <td>{Bilevel, Grayscale, GrayscaleMatte, Palette, PaletteMatte, TrueColor,
TrueColorMatte, ColorSeparation, ColorSeparationMatte, Optimize }</td>
  <td>image type</td>
 </tr>
  <tr>
 <td>units</td>
  <td>{ Undefined, PixelsPerInch, PixelsPerCentimeters}</td>
  <td>units of image resolution</td>
 </tr>
  <tr>
 <td>verbose</td>
  <td>{True, False}</td>
  <td>print detailed information about the image</td>
 </tr>
  <tr>
 <td>virtual-pixel</td>
  <td>{Constant, Edge, Mirror, Tile}</td>
  <td>the virtual pixel method</td>
 </tr>
  <tr>
 <td>white-point</td>
  <td><i>x-value</i>, <i>y-value</i></td>
  <td>chromaticity white point (e.g. 0.3127, 0.329)</td>
 </tr>

                              </tbody>
                            </table>
                            <p>Note, that the <tt>geometry</tt> parameter
is a short cut for the <tt>width</tt> and <tt>height</tt> parameters (e.g.
                            <tt>geometry=&gt;'106x80'</tt> is equivalent to
                            <tt>width=&gt;106, height=&gt;80</tt>). </p>
                            <p>SetAttribute() is an alias for method Set().
                            </p>
                            <p>Most of the attributes listed above have an
analog in <a href="convert.html">convert</a>. See the documentation for a
more detailed description of these attributes.</p>
                            </dl>
                            </blockquote>
 <a href="#contents">Back to Contents</a> <br>
&nbsp; &nbsp;
                            <dl>
                            <a name="geta"></a>
                            <table border="0" width="100%">
 <tbody>
                                <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
                                  <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Get an Image Attribute</font></font></font></b></td>
 </tr>

                              </tbody>
                            </table>
                            <dd> Use method Get() to get an image attribute.
For example,</dd>
                              </dl>
                              <blockquote>
                                <dl>
                                <pre>&nbsp;&nbsp;&nbsp; ($a, $b, $c) = $image-&gt;Get('colorspace', 'magick', 'adjoin');<br>&nbsp;&nbsp;&nbsp; $width = $image-&gt;[3]-&gt;Get('columns');</pre>
In addition to all the attributes listed in <a href="#seta">Set an Image Attribute</a>
, you can get these additional attributes:<br>
                                <br>

                                <table border="1">
 <caption>Image Attributes</caption>  <tbody>
                                    <tr>
 <th>Attribute</th>
  <th>Values</th>
  <th>Description</th>
 </tr>
  <tr>
 <td>base-columns</td>
  <td><i>integer</i></td>
  <td>base image width (before transformations)</td>
 </tr>
  <tr>
 <td>base-filename</td>
  <td><i>string</i></td>
  <td>base image filename (before transformations)</td>
 </tr>
  <tr>
 <td>base-rows</td>
  <td><i>integer</i></td>
  <td>base image height (before transformations)</td>
 </tr>
  <tr>
 <td>class</td>
  <td>{Direct, Pseudo}</td>
  <td>image class</td>
 </tr>
  <tr>
 <td>colors</td>
  <td><i>integer</i></td>
  <td>number of unique colors in the image</td>
 </tr>
  <tr>
 <td>comment</td>
  <td><i>string</i></td>
  <td>image comment</td>
 </tr>
  <tr>
 <td>columns</td>
  <td><i>integer</i></td>
  <td>image width</td>
 </tr>
  <tr>
 <td>depth</td>
  <td><i>integer</i></td>
  <td>image depth</td>
 </tr>
  <tr>
 <td>directory</td>
  <td><i>string</i></td>
  <td>tile names from within an image montage</td>
 </tr>
  <tr>
 <td>error</td>
  <td><i>double</i></td>
  <td>the mean error per pixel computed with methods Compare()
     or Quantize()</td>
 </tr>
  <tr>
 <td>filesize</td>
  <td><i>integer</i></td>
  <td>number of bytes of the image on disk</td>
 </tr>
  <tr>
 <td>format</td>
  <td><i>string</i></td>
  <td>get the descriptive image format</td>
 </tr>
  <tr>
 <td>geometry</td>
  <td><i>string</i></td>
  <td>image geometry</td>
 </tr>
  <tr>
 <td>height</td>
  <td><i>integer</i></td>
  <td>the number of rows or height of an image</td>
 </tr>
  <tr>
 <td>id</td>
  <td><i>integer</i></td>
  <td>ImageMagick registry id</td>
 </tr>
  <tr>
 <td>label</td>
  <td><i>string</i></td>
  <td>image label</td>
 </tr>
  <tr>
 <td>maximum-error</td>
  <td><i>double</i></td>
  <td>the normalized max error per pixel computed with methods Compare()
     or Quantize()</td>
 </tr>
  <tr>
 <td>mean-error</td>
  <td><i>double</i></td>
  <td>the normalized mean error per pixel computed with methods Compare()
     or Quantize()</td>
 </tr>
  <tr>
 <td>montage</td>
  <td><i>geometry</i></td>
  <td>tile size and offset within an image montage</td>
 </tr>
  <tr>
 <td>rows</td>
  <td><i>integer</i></td>
  <td>the number of rows or height of an image</td>
 </tr>
  <tr>
 <td>signature</td>
  <td><i>string</i></td>
  <td>SHA-256 message digest associated with the image pixel stream</td>
 </tr>
  <tr>
 <td>taint</td>
  <td>{True, False}</td>
  <td>True if the image has been modified</td>
 </tr>
  <tr>
 <td>width</td>
  <td><i>integer</i></td>
  <td>the number of columns or width of an image</td>
 </tr>
  <tr>
 <td>x-resolution</td>
  <td><i>integer</i></td>
  <td>x resolution of the image</td>
 </tr>
  <tr>
 <td>y-resolution</td>
  <td><i>integer</i></td>
  <td>y resolution of the image</td>
 </tr>

                                  </tbody>
                                </table>
                                <p>GetAttribute() is an alias for method
Get(). </p>
                                <p>Most of the attributes listed above have
an analog in <a href="convert.html">convert</a>. See the documentation for
a more detailed description of these attributes.</p>
                                </dl>
                                </blockquote>
 <a href="#contents">Back to Contents</a> <br>
&nbsp; &nbsp;
                                <dl>
                                <a name="mont"></a>
                                <table border="0" width="100%">
 <tbody>
                                    <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
                                      <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Create an Image Montage</font></font></font></b></td>
 </tr>

                                  </tbody>
                                </table>
                                <dd> Use method Montage() to create a composite
image by combining several separate images. The images are tiled on the composite
image with the name of the image optionally appearing just below the individual
tile. For example,</dd>
                                  </dl>
                                  <blockquote>
                                    <dl>
                                    <pre>&nbsp;&nbsp;&nbsp; $image-&gt;Montage(geometry=&gt;'160x160', tile=&gt;'2x2', texture=&gt;'granite:');</pre>
And here is a list of Montage() parameters you can set:<br>
                                    <br>

                                    <table border="1">
 <caption>Montage Parameters</caption>  <tbody>
                                        <tr>
 <th>Parameter</th>
  <th>Values</th>
  <th>Description</th>
 </tr>
  <tr>
 <td>background</td>
  <td><i><a href="color.html">color name</a></i></td>
  <td>background color name</td>
 </tr>
  <tr>
 <td>borderwidth</td>
  <td><i>integer</i></td>
  <td>image border width</td>
 </tr>
  <tr>
 <td>compose</td>
  <td>{Over, In, Out, Atop, Xor, Plus, Minus, Add, Subtract, Difference, Bumpmap,
Copy, Mask, Dissolve, Clear, Displace}</td>
  <td>composite operator</td>
 </tr>
  <tr>
 <td>filename</td>
  <td><i>string</i></td>
  <td>name of montage image</td>
 </tr>
  <tr>
 <td>fill</td>
  <td><a href="color.html">color name</a></td>
  <td>fill color for annotations</td>
 </tr>
  <tr>
 <td>font</td>
  <td><i>string</i></td>
  <td>X11 font name</td>
 </tr>
  <tr>
 <td>frame</td>
  <td><i>geometry</i></td>
  <td>surround the image with an ornamental border</td>
 </tr>
  <tr>
 <td>geometry</td>
  <td><i>geometry</i></td>
  <td>preferred tile and border size of each tile of the composite image</td>
 </tr>
  <tr>
 <td>gravity</td>
  <td>{NorthWest, North, NorthEast, West, Center, East, SouthWest, South,
SouthEast}</td>
  <td>direction image gravitates to within a tile</td>
 </tr>
  <tr>
 <td>ICM</td>
  <td><i>blob</i></td>
  <td>color information profile</td>
 </tr>
  <tr>
 <td>IPTC</td>
  <td><i>blob</i></td>
  <td>newswire information profile</td>
 </tr>
  <tr>
 <td>label</td>
  <td><i>string</i></td>
  <td>assign a label to an image</td>
 </tr>
  <tr>
 <td>mode</td>
  <td>{Frame, Unframe, Concatenate}</td>
  <td>thumbnail framing options</td>
 </tr>
  <tr>
 <td>pointsize</td>
  <td><i>integer</i></td>
  <td>pointsize of the Postscript or TrueType font</td>
 </tr>
  <tr>
 <td>shadow</td>
  <td>{True, False}</td>
  <td>add a shadow beneath a tile to simulate depth</td>
 </tr>
  <tr>
 <td>stroke</td>
  <td><a href="color.html">color name</a></td>
  <td>stroke color for annotations</td>
 </tr>
  <tr>
 <td>texture</td>
  <td><i>string</i></td>
  <td>name of texture to tile onto the image background</td>
 </tr>
  <tr>
 <td>tile</td>
  <td><i>geometry</i></td>
  <td>number of tiles per row and column</td>
 </tr>
  <tr>
 <td>title</td>
  <td>string</td>
  <td>assign a title to the image montage</td>
 </tr>
  <tr>
 <td>transparent</td>
  <td><i>string</i></td>
  <td>make this color transparent within the image</td>
 </tr>

                                      </tbody>
                                    </table>
                                    <p>Note, that the <tt>geometry</tt> parameter
is a short cut for the <tt>width</tt> and <tt>height</tt> parameters (e.g.
                                    <tt>geometry=&gt;'106x80'</tt> is equivalent
to <tt>width=&gt;106, height=&gt;80</tt>). </p>
                                    <p>MontageImage() is an alias for method
Montage(). </p>
                                    <p>Most of the attributes listed above
have an analog in <a href="montage.html">montage</a>. See the documentation
for a more detailed description of these attributes.</p>
                                    </dl>
                                    </blockquote>
 <i><a href="#contents">Back to Contents</a></i> &nbsp;<br>
&nbsp;
                                    <dl>
                                    <a name="blobs"></a>
                                    <table border="0" width="100%">
 <tbody>
                                        <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
                                          <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Working with Blobs</font></font></font></b></td>
 </tr>

                                      </tbody>
                                    </table>
                                    <dd> A blob contains data that directly
represent a particular image format in memory instead of on disk. <b>PerlMagick</b>
 supports blobs in any of these image <a href="formats.html">formats</a>
and provides methods to convert a blob to or from a particular image format.</dd>
                                      </dl>
                                      <blockquote>
                                        <dl>
                                        <table border="1">
 <caption>Blob Methods</caption>  <tbody>
                                            <tr>
 <th>Method</th>
  <th>Parameters</th>
  <th>Return Value</th>
  <th>Description</th>
 </tr>
  <tr>
 <td>ImageToBlob</td>
  <td>any image <a href="#seta">attribute</a></td>
  <td>an array of image data in the respective image format</td>
  <td>convert an image or image sequence to an array of blobs</td>
 </tr>
  <tr>
 <td>BlobToImage</td>
  <td>one or more blobs</td>
  <td>the number of blobs converted to an image</td>
  <td>convert one or more blobs to an image</td>
 </tr>

                                          </tbody>
                                        </table>
                                        </dl>
ImageToBlob() returns the image data in their respective formats. You can
then print it, save it to an ODBC database, write it to a file, or pipe it
to a display program: <pre>&nbsp;&nbsp;&nbsp; @blobs = $image-&gt;ImageToBlob();<br>&nbsp;&nbsp;&nbsp; open(DISPLAY,"| display -") || die;<br>&nbsp;&nbsp;&nbsp; binmode DISPLAY;<br>&nbsp;&nbsp;&nbsp; print DISPLAY $blobs[0];<br>&nbsp;&nbsp;&nbsp; close DISPLAY;</pre>
 Method BlobToImage() returns an image or image sequence converted from the
supplied blob: <pre>&nbsp;&nbsp;&nbsp; @blob=$db-&gt;GetImage();<br>&nbsp;&nbsp;&nbsp; $image=Image::Magick-&gt;new(magick=&gt;'jpg');<br>&nbsp;&nbsp;&nbsp; $image-&gt;BlobToImage(@blob);</pre>
                                        <br>
                                        </blockquote>
                                        <dl>
                                        <p> </p>
                                        </dl>
 <a href="#contents">Back to Contents</a> <br>
&nbsp; &nbsp;
                                        <dl>
                                        <a name="misc"></a>
                                        <table border="0" width="100%">
 <tbody>
                                            <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
                                              <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Miscellaneous Methods</font></font></font></b></td>
 </tr>

                                          </tbody>
                                        </table>
                                        <dd> The Append() method append a
set of images. For example,</dd>
                                          </dl>
                                          <blockquote>
                                            <dl>
                                            <pre>&nbsp;&nbsp;&nbsp; $p = $image-&gt;Append(stack=&gt;{true,false});</pre>
appends all the images associated with object <tt>$image</tt>.
By default, images are stacked left-to-right.  Set <tt>stack</tt> to
True to stack them top-to-bottom.
                                            <p>The Average() method averages
a set of images. For example, <pre>&nbsp;&nbsp;&nbsp; $p = $image-&gt;Average();</pre>
 averages all the images associated with object <tt>$image</tt>. </p>
                                            <p>The Clone() method copies
a set of images. For example, <pre>&nbsp;&nbsp;&nbsp; $p = $image-&gt;Clone();</pre>
 copies all the images from object <tt>$q</tt> to <tt>$p</tt>. You can use
this method for single or multi-image sequences. </p>
                                            <p>The Morph() method morphs
a set of images. Both the image pixels and size are linearly interpolated
to give the appearance of a meta-morphosis from one image to the next: <pre>&nbsp;&nbsp;&nbsp; $p = $image-&gt;Morph(frames=&gt;<i>integer</i>);</pre>
 where <i>frames</i> is the number of in-between images to generate. The default
is 1. </p>
                                            <p>Mosaic() creates an mosaic
from an image sequence. </p>
                                            <p>Method Mogrify() is a single
entry point for the image manipulation methods (<a href="#mani">Manipulate
an Image</a>). The parameters are the name of a method followed by any parameters
the method may require. For example, these calls are equivalent: <pre>&nbsp;&nbsp;&nbsp; $image-&gt;Crop('340x256+0+0');<br>&nbsp;&nbsp;&nbsp; $image-&gt;Mogrify('crop', '340x256+0+0');</pre>
 Method MogrifyRegion() applies a transform to a region of the image. It
is similar to Mogrify() but begins with the region geometry. For example,
suppose you want to brighten a 100x100 region of your image at location (40,
50): <pre>&nbsp;&nbsp;&nbsp; $image-&gt;MogrifyRegion('100x100+40+50', 'modulate', brightness=&gt;50);</pre>
  </p>
Ping() is a convenience method that returns information about an
image without having to read the image into memory.  It returns the
width, height, file size in bytes, and the file format of the image.
You can specify more than one filename but only one filehandle:

<pre>&nbsp;&nbsp;&nbsp;
  ($width, $height, $size, $format) = $image-&gt;Ping('logo.png');
  ($width, $height, $size, $format) = $image-&gt;Ping(file=&gt;\*IMAGE);
  ($width, $height, $size, $format) = $image-&gt;Ping(blob=&gt;$blob);
</pre>
This is a more efficient and less memory intensive way to query if an image
exists and what its characteristics are.
                                              <p>To have full control over
text positioning you need font metric information. Use <pre>&nbsp;&nbsp;&nbsp; ($x_ppem, $y_ppem, $ascender, $descender, $width, $height, $max_advance) =<br>&nbsp;&nbsp;&nbsp;&nbsp; $image-&gt;QueryFontMetrics(<i>parameters</i>);</pre>
 Where <i>parameters</i> is any parameter of the <a href="#mani">Annotate</a>
 method. The return values are </p>
                                              <p> </p>
                                              <ul>

                                                <li> character width</li>

                                                <li> character height</li>

                                                <li> ascender</li>

                                                <li> descender</li>

                                                <li> text width</li>

                                                <li> text height</li>

                                                <li> maximum horizontal advance</li>

                                              </ul>
                                              <p> </p>
                                              </dl>
 Call QueryColor() with no parameters to return a list of known colors names
or specify one or more color names to get these attributes: red, green, blue,
and opacity value. <br>
                                              <dl>
                                              <p> <pre>&nbsp;&nbsp;&nbsp; @colors = $image-&gt;QueryColor();<br>&nbsp;&nbsp;&nbsp; ($red, $green, $blue, $opacity) = $image-&gt;QueryColor('cyan');<br>&nbsp;&nbsp;&nbsp; ($red, $green, $blue, $opacity) = $image-&gt;QueryColor('#716bae');<br></pre>
  </p>
                                              </dl>
 QueryColorname() accepts a color value and returns its respective name or
hex value;<br>
                                              <dl>
                                              <pre>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $name = $image-&gt;QueryColorname('rgba(80,60,0,0)');</pre>
                                              <p> </p>
                                              </dl>
 Call QueryFont() with no parameters to return a list of known fonts or specify
one or more font names to get these attributes: font name, description,
family, style, stretch, weight, encoding, foundry, format, metrics,
and glyphs values.<br>
                                              <dl>
                                              <p> <pre>&nbsp;&nbsp;&nbsp; @fonts = $image-&gt;QueryFont();<br>&nbsp;&nbsp;&nbsp; $weight = ($image-&gt;QueryFont('Helvetica'))[5];<br></pre>
  </p>
                                              <p> </p>
                                              </dl>
 Call QueryFormat() with no parameters to return a list of known image formats
or specify one or more format names to get these attributes: adjoin, blob
support, raw, decoder, encoder, description, and module. <br>
                                              <dl>
                                              <p> <pre>&nbsp;&nbsp;&nbsp; @formats = $image-&gt;QueryFormat();<br>&nbsp;&nbsp;&nbsp; ($adjoin, $blob_support, $raw, $decoder, $encoder, $description, $module) = $image-&gt;QueryFormat('gif');<br></pre>
  </p>
                                              <p> Use RemoteCommand() to
send a command to an already running <a href="display.html">display</a> or
                                              <a href="animate.html">animate</a>
 application. The only parameter is the name of the image file to display
or animate. </p>
                                              <p>Finally, the Transform()
method accepts a fully-qualified geometry specification for cropping or resizing
one or more images. For example, <pre>&nbsp;&nbsp;&nbsp; $p = $image-&gt;Transform(crop=&gt;'100x100');</pre>
 You can optionally add <i>Image</i> to any method name above. For example,
PingImage() is an alias for method Ping().</p>
                                              </dl>
                                              </blockquote>
 <a href="#contents">Back to Contents</a> <br>
&nbsp; &nbsp;
                                              <dl>
                                              <a name="erro"></a>
                                              <table border="0" width="100%">
 <tbody>
                                                  <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
                                                    <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Handling Errors</font></font></font></b></td>
 </tr>

                                                </tbody>
                                              </table>
                                              <dd> All <b>PerlMagick</b>
methods return an undefined string context upon success. If any problems
occur, the error is returned as a string with an embedded numeric status
code. A status code less than 400 is a warning. This means that the operation
did not complete but was recoverable to some degree. A numeric code greater
or equal to 400 is an error and indicates the operation failed completely.
Here is how errors are returned for the different methods:</dd>
                                                </dl>
                                                <dl>
                                                <ul>

                                                  <ul>
                                                      <li> Methods which
return a number (e.g. Read(), Write()):</li>
  <pre>&nbsp;&nbsp;&nbsp; $x = $image-&gt;Read(...);<br>&nbsp;&nbsp;&nbsp; warn "$x" if "$x";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # print the error message<br>&nbsp;&nbsp;&nbsp; $x =~ /(\d+)/;<br>&nbsp;&nbsp;&nbsp; print $1;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # print the error number&nbsp;<br>&nbsp;&nbsp;&nbsp; print 0+$x;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # print the number of images read</pre>

                                                      <li> Methods which
operate on an image (e.g. Resize(), Crop()):</li>
  <pre>&nbsp;&nbsp;&nbsp; $x = $image-&gt;Crop(...);<br>&nbsp;&nbsp;&nbsp; warn "$x" if "$x";&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # print the error message<br>&nbsp;&nbsp;&nbsp; $x =~ /(\d+)/;<br>&nbsp;&nbsp;&nbsp; print $1;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # print the error number</pre>

                                                      <li> Methods which
return images (Average(), Montage(), Clone()) should be checked for errors
this way:</li>
  <pre>&nbsp;&nbsp;&nbsp; $x = $image-&gt;Montage(...);<br>&nbsp;&nbsp;&nbsp; warn "$x" if !ref($x);&nbsp; # print the error message<br>&nbsp;&nbsp;&nbsp; $x =~ /(\d+)/;<br>&nbsp;&nbsp;&nbsp; print $1;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # print the error number</pre>

                                                  </ul>
                                                </ul>
                                                </dl>
                                                <blockquote>
                                                  <dl>
Here is an example error message: <pre>&nbsp;&nbsp;&nbsp; Error 400: Memory allocation failed</pre>
Below is a list of error and warning codes:
<p>
                                                  <table border="1">
 <caption>Error and Warning Codes</caption>  <tbody>
                                                      <tr>
 <th>Code</th>
  <th>Mnemonic</th>
  <th>Description</th>
 </tr>
  <tr>
 <td>0</td>
  <td>Success</td>
  <td>method completed without an error or warning</td>
 </tr>
  <tr>
 <td>300</td>
  <td>ResourceLimitWarning</td>
  <td>a program resource is exhausted (e.g. not enough memory)</td>
 </tr>
  <tr>
 <td>305</td>
  <td>TypeWarning</td>
  <td>A font is unavailable; a substitution may have occurred</td>
 </tr>
  <tr>
 <td>310</td>
  <td>OptionWarning</td>
  <td>a command-line option was malformed</td>
 </tr>
  <tr>
 <td>315</td>
  <td>DelegateWarning</td>
  <td>an ImageMagick <i>delegate</i> returned a warning</td>
 </tr>
  <tr>
 <td>320</td>
  <td>MissingDelegateWarning</td>
  <td>the image type can not be read or written because the appropriate <i>
Delegate</i> is missing</td>
 </tr>
  <tr>
 <td>325</td>
  <td>CorruptImageWarning</td>
  <td>the image file may be corrupt</td>
 </tr>
  <tr>
 <td>330</td>
  <td>FileOpenWarning</td>
  <td>the image file could not be opened</td>
 </tr>
  <tr>
 <td>335</td>
  <td>BlobWarning</td>
  <td>a binary large object could not be allocated</td>
 </tr>
  <tr>
 <td>340</td>
  <td>StreamWarning</td>
  <td>there was a problem reading or writing from a stream</td>
 </tr>
  <tr>
 <td>345</td>
  <td>CacheWarning</td>
  <td>pixels could not be saved to the pixel cache</td>
 </tr>
  <tr>
 <td>350</td>
  <td>CoderWarning</td>
  <td>there was a problem with an image coder</td>
 </tr>
  <tr>
 <td>355</td>
  <td>ModuleWarning</td>
  <td>there was a problem with an image module</td>
 </tr>
  <tr>
 <td>360</td>
  <td>DrawWarning</td>
  <td>a drawing operation failed</td>
 </tr>
  <tr>
 <td>365</td>
  <td>ImageWarning</td>
  <td>the operation could not complete due to an incompatible image</td>
 </tr>
  <tr>
 <td>380</td>
  <td>XServerWarning</td>
  <td>an X resource is unavailable</td>
 </tr>
  <tr>
 <td>385</td>
  <td>MonitorWarning</td>
  <td>there was a problem with prgress monitor</td>
 </tr>
  <tr>
 <td>390</td>
  <td>RegistryWarning</td>
  <td>there was a problem getting or setting the registry</td>
 </tr>
  <tr>
 <td>395</td>
  <td>ConfigureWarning</td>
  <td>there was a problem getting a configuration file</td>
 </tr>
  <tr>
 <td>400</td>
  <td>ResourceLimitError</td>
  <td>a program resource is exhausted (e.g. not enough memory)</td>
 </tr>
  <tr>
 <td>405</td>
  <td>TypeError</td>
  <td>A font is unavailable; a substitution may have occurred</td>
 </tr>
  <tr>
 <td>410</td>
  <td>OptionError</td>
  <td>a command-line option was malformed</td>
 </tr>
  <tr>
 <td>415</td>
  <td>DelegateError</td>
  <td>an ImageMagick <i>delegate</i> returned a warning</td>
 </tr>
  <tr>
 <td>420</td>
  <td>MissingDelegateError</td>
  <td>the image type can not be read or written because the appropriate <i>
Delegate</i> is missing</td>
 </tr>
  <tr>
 <td>425</td>
  <td>CorruptImageError</td>
  <td>the image file may be corrupt</td>
 </tr>
  <tr>
 <td>430</td>
  <td>FileOpenError</td>
  <td>the image file could not be opened</td>
 </tr>
  <tr>
 <td>435</td>
  <td>BlobError</td>
  <td>a binary large object could not be allocated</td>
 </tr>
  <tr>
 <td>440</td>
  <td>StreamError</td>
  <td>there was a problem reading or writing from a stream</td>
 </tr>
  <tr>
 <td>445</td>
  <td>CacheError</td>
  <td>pixels could not be saved to the pixel cache</td>
 </tr>
  <tr>
 <td>450</td>
  <td>CoderError</td>
  <td>there was a problem with an image coder</td>
 </tr>
  <tr>
 <td>455</td>
  <td>ModuleError</td>
  <td>there was a problem with an image module</td>
 </tr>
  <tr>
 <td>460</td>
  <td>DrawError</td>
  <td>a drawing operation failed</td>
 </tr>
  <tr>
 <td>465</td>
  <td>ImageError</td>
  <td>the operation could not complete due to an incompatible image</td>
 </tr>
  <tr>
 <td>480</td>
  <td>XServerError</td>
  <td>an X resource is unavailable</td>
 </tr>
  <tr>
 <td>480</td>
  <td>MonitorError</td>
  <td>there was a progress monitor error</td>
 </tr>
  <tr>
 <td>490</td>
  <td>RegistryError</td>
  <td>there was a problem getting or setting the registry</td>
 </tr>
  <tr>
 <td>495</td>
  <td>ConfigureError</td>
  <td>there was a problem getting a configuration file</td>
 </tr>

                                                    </tbody>
                                                  </table>
                                                  </dl>
The following illustrates how you can use a numeric status code: <pre>&nbsp;&nbsp;&nbsp; $x = $image-&gt;Read('rose.png');<br>&nbsp;&nbsp;&nbsp; $x =~ /(\d+)/;<br>&nbsp;&nbsp;&nbsp; die "unable to continue" if ($1 == ResourceLimitError);</pre>
                                                  <br>
                                                  </blockquote>
                                                  <dl>
                                                  <p> </p>
                                                  </dl>
 <a href="#contents">Back to Contents</a> <br>
&nbsp; &nbsp;
                                                  <dl>
                                                  <a name="copy"></a>
                                                  <table border="0" width="100%">
 <tbody>
                                                      <tr>
 <td align="Left" bgcolor="#52799e"><img src="right_triangle.png" alt="&gt;" border="0" height="14" width="15">
                                                        <b><font face="Helvetica, Arial"><font color="#ffffff"><font size="+1">
Copyright</font></font></font></b></td>
 </tr>

                                                    </tbody>
                                                  </table>
                                                  <dd> <b>Copyright (C) 2002
ImageMagick Studio</b></dd>
                                                    <p> </p>
                                                    <dd> <b>Permission is
hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files ("PerlMagick"), to deal in PerlMagick
without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of PerlMagick,
and to permit persons to whom the PerlMagick is furnished to do so, subject
to the following conditions:</b></dd>
                                                      <p> </p>
                                                      <dd> <b>The above copyright
notice and this permission notice shall be included in all copies or substantial
portions of PerlMagick.</b></dd>
                                                        <p> </p>
                                                        <dd> <b>The software
is provided "as is", without warranty of any kind, express or implied, including
but not limited to the warranties of merchantability, fitness for a particular
purpose and noninfringement.In no event shall ImageMagick Studio be liable
for any claim, damages or other liability, whether in an action of contract,
tort or otherwise, arising from, out of or in connection with PerlMagick
or the use or other dealings in PerlMagick.</b></dd>
                                                          <p> </p>
                                                          <dd> <b>Except
as contained in this notice, the name of the ImageMagick Studio LLC
shall not be used in advertising or otherwise to promote the sale,
use or other dealings in PerlMagick without prior written authorization from
the ImageMagick Studio.</b></dd>
                                                            </dl>
 <a href="#contents">Back to Contents</a>
                                                            <hr>
<p><a href="../ImageMagick.html"><img SRC="home.png"
ALT="ImageMagick Home Page" BORDER=0 height=40 width=40
align=MIDDLE></a><a 
href="mailto:webmaster@imagemagick.org"><img SRC="mail.png"
ALT="ImageMagick Home Page" BORDER=0 height=40 width=40
align=MIDDLE></a><font size="-2">
Image manipulation software that works like magic.</font>
</body>
</html>