<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"\r
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">\r
<head>\r
+ <meta http-equiv="content-type" content="text/html; charset=utf-8"/>\r
<meta name="verify-v1" content="g222frIIxcQTrvDR3NBRUSKP3AnMNoqxOkIniCEkV7U=" />\r
<link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf" />\r
- <style type="text/css" media="screen,projection"><!--\r
+ <style type="text/css" media="all">\r
@import url("../www/magick.css");\r
- --></style>\r
+ </style>\r
<link rel="shortcut icon" href="../images/wand.ico" type="images/vnd.microsoft.icon"/>
<title>ImageMagick: PerlMagick, Perl API for ImageMagick</title>
<meta http-equiv="Content-Language" content="en-US"/>
<meta name="Author" content="ImageMagick Studio LLC"/>
<meta name="Revisit-after" content="2 DAYS"/>
<meta name="Resource-type" content="document"/>
- <meta name="Copyright" content="Copyright (c) 1999-2009 ImageMagick Studio LLC"/>
+ <meta name="Copyright" content="Copyright (c) 1999-2010 ImageMagick Studio LLC"/>
<meta name="Distribution" content="Global"/>
</head>\r
\r
<div class="eastbar">\r
\r
<div class="menu">
- <a href="../index.html">About ImageMagick</a>
+ <a title="About ImageMagick" href="../index.html">About ImageMagick</a>
</div>
<div class="sep"></div>\r
<div class="menu">
- <a href="../www/command-line-tools.html">Command-line Tools</a>
+ <a title="Command-line Tools" href="../www/command-line-tools.html">Command-line Tools</a>
</div>
<div class="sub">
- <a href="../www/command-line-processing.html">Processing</a>
+ <a title="Command-line Tools: Processing" href="../www/command-line-processing.html">Processing</a>
</div>
<div class="sub">
- <a href="../www/command-line-options.html">Options</a>
+ <a title="Command-line Tools: Options" href="../www/command-line-options.html">Options</a>
</div>
<div class="sub">
- <a href="http://www.imagemagick.org/Usage/">Usage</a>
+ <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
</div>
<div class="menu">
- <a href="../www/api.html">Program Interfaces</a>
+ <a title="Program Interfaces" href="../www/api.html">Program Interfaces</a>
</div>
<div class="sub">
- <a href="../www/magick-wand.html">MagickWand</a>
+ <a title="Program Interface: MagickWand" href="../www/magick-wand.html">MagickWand</a>
</div>
<div class="sub">
- <a href="../www/magick-core.html">MagickCore</a>
+ <a title="Program Interface: MagickCore" href="../www/magick-core.html">MagickCore</a>
</div>
<div class="sub">
- <a href="../www/perl-magick.html">PerlMagick</a>
+ <a title="Program Interface: PerlMagick" href="../www/perl-magick.html">PerlMagick</a>
</div>
<div class="sub">
- <a href="../Magick++/">Magick++</a>
+ <a title="Program Interface: Magick++" href="../Magick++/">Magick++</a>
</div>
<div class="menu">
- <a href="../www/architecture.html">Architecture</a>
+ <a title="Architecture" href="../www/architecture.html">Architecture</a>
</div>
<div class="sep"></div>\r
<div class="menu">
- <a href="../www/install-source.html">Install from Source</a>
+ <a title="Install from Source" href="../www/install-source.html">Install from Source</a>
</div>
<div class="sub">
- <a href="../www/install-source.html#unix">Unix</a>
+ <a title="Install from Source: Unix" href="../www/install-source.html#unix">Unix</a>
</div>
<div class="sub">
- <a href="../www/install-source.html#windows">Windows</a>
+ <a title="Install from Source: Windows" href="../www/install-source.html#windows">Windows</a>
</div>
<div class="menu">
- <a href="../www/binary-releases.html">Binary Releases</a>
+ <a title="Binary Releases" href="../www/binary-releases.html">Binary Releases</a>
</div>
<div class="sub">
- <a href="../www/binary-releases.html#unix">Unix</a>
+ <a title="Binary Release: Unix" href="../www/binary-releases.html#unix">Unix</a>
</div>
<div class="sub">
- <a href="../www/binary-releases.html#macosx">Mac OS X</a>
+ <a title="Binary Release: MacOS X" href="../www/binary-releases.html#macosx">Mac OS X</a>
</div>
<div class="sub">
- <a href="../www/binary-releases.html#windows">Windows</a>
+ <a title="Binary Release: Windows" href="../www/binary-releases.html#windows">Windows</a>
</div>
<div class="menu">
- <a href="../www/resources.html">Resources</a>
+ <a title="Resources" href="../www/resources.html">Resources</a>
</div>
<div class="sep"></div>\r
<div class="menu">
- <a href="../www/download.html">Download</a>
+ <a title="Download" href="../www/download.html">Download</a>
</div>
<div class="sep"></div>\r
<div class="menu">
- <a href="http://www.imagemagick.org/script/search.php">Search</a>
+ <a title="Search" href="http://www.imagemagick.org/script/search.php">Search</a>
</div>
<div class="sep"></div>\r
<div class="menu">
- <a href="../www/sitemap.html">Site Map</a>
+ <a title="Site Map"href="../www/sitemap.html">Site Map</a>
</div>
<div class="sub">
- <a href="../www/links.html">Links</a>
+ <a title="Site Map: Links"href="../www/links.html">Links</a>
</div>
<div class="sep"></div>\r
<div class="menu">
- <a href="../www/sponsors.html">Sponsors:</a>
+ <a title="Sponsors" href="../www/sponsors.html">Sponsors:</a>
<div class="sponsbox">
<div class="sponsor">
- <a href="http://www.hygi.de">Reinigungsmittel</a><!-- 201002000400+ -->
+ <a title="Sponsor: Webdesign Agentur" href="http://www.ventzke-partner.de">Webdesign Agentur</a><!-- 201101010480 invendio.de-->
</div>
<div class="sponsor">
- <a href="http://www.blumenversender.com">Blumenversand</a><!-- 201005010120 -->
+ <a title="Sponsor: LVM Versicherung" href="http://www.neu-reich.de">LVM Versicherung</a><!-- 201101010480 -->
</div>
<div class="sponsor">
- <a href="http://www.online-kredit-index.de">Kredit</a><!-- 201003010120 Buchhorn -->
+ <a title="Sponsor: Deko.net" href="http://www.deko.net">Deko.net</a><!-- 201101010600 Peterssen-->
</div>
<div class="sponsor">
- <a href="http://www.print24.de/">Druckerei</a><!-- 201009010720 -->
+ <a title="Sponsor: Kredit" href="http://www.online-kredit-index.de">Kredit</a><!-- 201007010120 Buchhorn -->
</div>
<div class="sponsor">
- <a href="http://www.goyax.de">Börse</a><!-- 201001000240 Gewiese digital-finance.de -->
+ <a title="Sponsor: Druckerei" href="http://www.print24.de/">Druckerei</a><!-- 201009010720 -->
</div>
<div class="sponsor">
- <a href="http://www.allesdruck.de">Druckerei Online</a><!-- 201012001200 allesdruck.de-->
+ <a title="Sponsor: Druckerei Online" href="http://www.allesdruck.de">Druckerei Online</a><!-- 201012011200 allesdruck.de-->
</div>
<div class="sponsor">
- <a href="http://www.who-sells-it.com/">Free Catalogs</a><!-- 201002010000 -->
+ <a title="Sponsor: Webdesign" href="http://www.renehornig.com/" title="Webdesign">Webdesign</a><!-- 20110101000120 -->
</div>
</div>
</div>
<p>ImageMagick must already be installed on your system. Next, get
the <a href="../www/download.html">PerlMagick</a> distribution corresponding to the installed ImageMagick distribution
-(e.g., PerlMagick 6.57 for
-ImageMagick 6.5.7) and unpack it as shown below:</p>
+(e.g., PerlMagick 6.61 for
+ImageMagick 6.6.1) and unpack it as shown below:</p>
-<p class='crt'><span class="crtprompt"> $magick> </span><span class='crtin'>tar xvfz PerlMagick-6.57.tar.gz</span><span class='crtout'></span><span class="crtprompt"> $magick> </span><span class='crtin'>cd PerlMagick</span></p>
+<p class='crt'><span class="crtprompt"> $magick> </span><span class='crtin'>tar xvfz PerlMagick-6.61.tar.gz</span><span class='crtout'></span><span class="crtprompt"> $magick> </span><span class='crtin'>cd PerlMagick</span></p>
<p>Next, edit <kbd>Makefile.PL</kbd> and change LIBS and INC to include the appropriate path information to the required <kbd>MagickCore</kbd> library. You may need paths to JPEG, PNG, TIFF, etc. delegates if they were included with your installed version of ImageMagick. Build and install it like this:</p>
<p class='crt'><span class="crtprompt"> $magick> </span><span class='crtin'>perl Makefile.PL</span><span class='crtout'></span><span class="crtprompt"> $magick> </span><span class='crtin'>make</span><span class='crtout'></span><span class="crtprompt"> $magick> </span><span class='crtin'>make install</span></p>
close(IMAGE);
</pre>
+<p>Note, reading from or writing to a Perl filehandle may fail under Windows due to different versions of the C-runtime libraries between ImageMagick and the ActiveState Perl distributions or if one of the DLL's is linked with the /MT option. See <a href="http://msdn.microsoft.com/en-us/library/ms235460.aspx">Potential Errors Passing CRT Objects Across DLL Boundaries</a> for an explanation.</p>
+
<p>If <kbd>%0Nd, %0No, or %0Nx</kbd> 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 class="text">
<tr>
<td valign="top">Annotate</td>
- <td valign="top">text=><i>string</i>, font=><i>string</i>, family=><i>string</i>, style=>{Normal, Italic, Oblique, Any}, stretch=>{Normal, UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, SemiExpanded, Expanded, ExtraExpanded, UltraExpanded}, weight=><i>integer</i>, pointsize=><i>integer</i>, density=><i>geometry</i>, stroke=><i><a href="../www/color.html">color name</a></i>, strokewidth=><i>integer</i>, fill=><i><a href="../www/color.html">color name</a></i>, undercolor=><i><a href="../www/color.html">color name</a></i>, kerning=><i>float</i>, geometry=><i>geometry</i>, gravity=>{NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast}, antialias=>{true, false}, x=><i>integer</i>, y=><i>integer</i>, affine=><i>array of float values</i>, translate=><i>float, float</i>, scale=><i>float, float</i>, rotate=><i>float</i>. skewX=><i>float</i>, skewY=> <i>float</i>, align=>{Left, Center, Right}, encoding=>{UTF-8}, interline-spacing=><i>double</i>, interword-spacing=><i>double</i></td>
+ <td valign="top">text=><i>string</i>, font=><i>string</i>, family=><i>string</i>, style=>{Normal, Italic, Oblique, Any}, stretch=>{Normal, UltraCondensed, ExtraCondensed, Condensed, SemiCondensed, SemiExpanded, Expanded, ExtraExpanded, UltraExpanded}, weight=><i>integer</i>, pointsize=><i>integer</i>, density=><i>geometry</i>, stroke=><i><a href="../www/color.html">color name</a></i>, strokewidth=><i>integer</i>, fill=><i><a href="../www/color.html">color name</a></i>, undercolor=><i><a href="../www/color.html">color name</a></i>, kerning=><i>float</i>, geometry=><i>geometry</i>, gravity=>{NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast}, antialias=>{true, false}, x=><i>integer</i>, y=><i>integer</i>, affine=><i>array of float values</i>, translate=><i>float, float</i>, scale=><i>float, float</i>, rotate=><i>float</i>. skewX=><i>float</i>, skewY=> <i>float</i>, align=>{Left, Center, Right}, encoding=>{UTF-8}, interline-spacing=><i>double</i>, interword-spacing=><i>double</i>, direction=>{right-to-left, left-to-right}</td>
<td valign="top">annotate an image with text. See <a href="#misc">QueryFontMetrics</a> to get font metrics without rendering any text.</td>
</tr>
<tr>
<td valign="top">BlackThreshold</td>
- <td valign="top">threshold=><i>string</i></td>
+ <td valign="top">threshold=><i>string</i>, , channel=>{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}</td>
<td valign="top">force all pixels below the threshold intensity into black</td>
</tr>
<td valign="top">merge a sequence of images</td>
</tr>
+ <tr>
+ <td valign="top">Color</td>
+ <td valign="top">color=><i><a href="../www/color.html">color name</a></i></td>
+ <td valign="top">set the entire image to this color.</td>
+ </tr>
+
<tr>
<td valign="top">ColorDecisionList</td>
<td valign="top">filename=><i>string</i>,</td>
<td valign="top">colorize the image with the fill color</td>
</tr>
+ <tr>
+ <td valign="top">ColorMatrix</td>
+ <td valign="top">matrix=><i>array of float values</i></td>
+ <td valign="top">apply color correction to the image. Although you can use variable sized matrices, typically you use a 5 x 5 for an RGBA image and a 6x6 for CMYKA. A 6x6 matrix is required for offsets (populate the last column with normalized values).</td>
+ </tr>
+
<tr>
<td valign="top">Comment</td>
<td valign="top">string</td>
<tr>
<td valign="top">Convolve</td>
- <td valign="top">coefficients=><i>array of float values</i>, channel=>{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}, bias=>;<i>double</i></td>
+ <td valign="top">coefficients=><i>array of float values</i>, channel=>{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}, bias=><i>double</i></td>
<td valign="top">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 valign="top">Crop</td>
- <td valign="top">geometry=><i>geometry</i>, width=><i>integer</i>, height=><i>integer</i>, x=><i>integer</i>, y=><i>integer</i>, fuzz=><i>double</i></td>
+ <td valign="top">geometry=><i>geometry</i>, width=><i>integer</i>, height=><i>integer</i>, x=><i>integer</i>, y=><i>integer</i>, fuzz=><i>double</i>, gravity=>{NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast}</td>
<td valign="top">crop an image</td>
</tr>
<tr>
<td valign="top">Draw</td>
- <td valign="top">primitive=>{point, line, rectangle, arc, ellipse, circle, path, polyline, polygon, bezier, color, matte, text, @<i>filename</i>}, points=><i>string</i> , method=><i>{Point, Replace, Floodfill, FillToBorder, Reset}</i>, stroke=><i><a href="../www/color.html">color name</a></i>, fill=><i><a href="../www/color.html">color name</a></i>, font=><i>string</i>, pointsize=><i>integer</i>, strokewidth=><i>float</i>, antialias=>{true, false}, bordercolor=><i><a href="../www/color.html">color name</a></i>, x=><i>float</i>, y=><i>float</i>, dash-offset=><i>float</i>, dash-pattern=><i>array of float values</i>, affine=><i>array of float values</i>, translate=><i>float, float</i>, scale=><i>float, float</i>, rotate=><i>float</i>, skewX=><i>float</i>, skewY=><i>float</i>, interpolate=>{undefined, average, bicubic, bilinear, mesh, nearest-neighbor, spline}, kerning=><i>float</i>, text=><i>string</i>, vector-graphics=><i>string</i></td>
+ <td valign="top">primitive=>{point, line, rectangle, arc, ellipse, circle, path, polyline, polygon, bezier, color, matte, text, @<i>filename</i>}, points=><i>string</i> , method=><i>{Point, Replace, Floodfill, FillToBorder, Reset}</i>, stroke=><i><a href="../www/color.html">color name</a></i>, fill=><i><a href="../www/color.html">color name</a></i>, font=><i>string</i>, pointsize=><i>integer</i>, strokewidth=><i>float</i>, antialias=>{true, false}, bordercolor=><i><a href="../www/color.html">color name</a></i>, x=><i>float</i>, y=><i>float</i>, dash-offset=><i>float</i>, dash-pattern=><i>array of float values</i>, affine=><i>array of float values</i>, translate=><i>float, float</i>, scale=><i>float, float</i>, rotate=><i>float</i>, skewX=><i>float</i>, skewY=><i>float</i>, interpolate=>{undefined, average, bicubic, bilinear, mesh, nearest-neighbor, spline}, kerning=><i>float</i>, text=><i>string</i>, vector-graphics=><i>string</i>, interline-spacing=><i>double</i>, interword-spacing=><i>double</i>, direction=>{right-to-left, left-to-right}</td>
<td valign="top">annotate an image with one or more graphic primitives.</td>
</tr>
<td valign="top">apply an arithmetic, relational, or logical expression to the image</td>
</tr>
+ <tr>
+ <td valign="top">Filter</td>
+ <td valign="top">kernel=><i>string</i>, channel=>{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}, bias=><i>double</i></td>
+ <td valign="top">apply a convolution kernel to the image.</td>
+ </tr>
+
<tr>
<td valign="top">Flip</td>
<td valign="top"><br /></td>
<tr>
<td valign="top">Identify</td>
- <td valign="top">file=><i>file</i></td>
+ <td valign="top">file=><i>file</i>, features=><i>distance</i>, unique=>{True, False}</td>
<td valign="top">identify the attributes of an image</td>
</tr>
<td valign="top">vary the brightness, saturation, and hue of an image by the specified percentage</td>
</tr>
+ <tr>
+ <td valign="top">Morphology</td>
+ <td valign="top">kernel=><i>string</i>, channel=>{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}, iterations=><i>integer</i></td>
+ <td valign="top">apply a morphology method to the image.</td>
+ </tr>
+
<tr>
<td valign="top">MotionBlur</td>
<td valign="top">geometry=><i>geometry</i>, radius=><i>double</i>, sigma=><i>double</i>, angle=><i>double</i>, channel=>{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}</td>
<tr>
<td valign="top">Negate</td>
<td valign="top">gray=>{True, False}, channel=>{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}</td>
- <td valign="top">replace every pixel with its complementary color (white becomes black, yellow becomes blue, etc.)</td>
+ <td valign="top">replace each pixel with its complementary color (white becomes black, yellow becomes blue, etc.)</td>
</tr>
<tr>
<td valign="top">lighten or darken image edges to create a 3-D effect</td>
</tr>
- <tr>
- <td valign="top">Recolor</td>
- <td valign="top">matrix=><i>array of float values</i></td>
- <td valign="top">translate, scale, shear, or rotate image colors. Although you can use variable sized matrices, typically you use a 5 x 5 for an RGBA image and a 6x6 for CMYKA. Populate the last row with normalized values to translate.</td>
- </tr>
-
<tr>
<td valign="top">ReduceNoise</td>
<td valign="top">radius=><i>double</i></td>
<tr>
<td valign="top">Remap</td>
- <td valign="top">image=><i>image-handle</i>, dither-method=>{Riemersma, Floyd-Steinberg}</td>
+ <td valign="top">image=><i>image-handle</i>, dither=>{true, false}, dither-method=>{Riemersma, Floyd-Steinberg}</td>
<td valign="top">replace the colors of an image with the closest color from a reference image.</td>
</tr>
<tr>
<td valign="top">WhiteThreshold</td>
- <td valign="top">threshold=><i>string</i></td>
+ <td valign="top">threshold=><i>string</i>, , channel=>{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}</td>
<td valign="top">force all pixels above the threshold intensity into white</td>
</tr>
</tbody>
<td valign="top">image depth</td>
</tr>
+ <tr>
+ <td valign="top">direction</td>
+ <td valign="top"><i>{Undefined, right-to-left, left-to-right</i></td>
+ <td valign="top">render text right-to-left or left-to-right</td>
+ </tr>
+
<tr>
<td valign="top">disk-limit</td>
<td valign="top"><i>integer</i></td>
<p>appends all the images associated with object <kbd>$image</kbd>. By default, images are stacked left-to-right. Set <kbd>stack</kbd> to True to stack them top-to-bottom.</p>
-<p>The Average() method averages a set of images. For example,</p>
+<p>The Clone() method copies a set of images. For example,</p>
+
+<pre class="code">
+ $q = $p->Clone();
+</pre>
+
+<p>copies all the images from object <kbd>$p</kbd> to <kbd>$q</kbd>. You can use this method for single or multi-image sequences.</p>
+
+<p>The EvaluateImages() method applies an arithemtic, logical or relational expression to a set of images. For example,</p>
<pre class="code">
- $p = $image->Average();
+ $p = $image->EvaluateImages('mean');
</pre>
<p>averages all the images associated with object <kbd>$image</kbd>.</p>
-<p>The Clone() method copies a set of images. For example,</p>
+<p>The Features() method returns features for each channel in the image in each of four directions (horizontal, vertical, left and right diagonals) for the specified distance. The features include the angular second momentum, contrast, correlation, sum of squares: variance, inverse difference moment, sum average, sum varience, sum entropy, entropy, difference variance, difference entropy, information measures of correlation 1, information measures of correlation 2, and maximum correlation coefficient. Values in RGB, CMYK, RGBA, or CMYKA order (depending on the image type).</p>
<pre class="code">
- $q = $p->Clone();
+ @features = $image->Features(1);
</pre>
-<p>copies all the images from object <kbd>$p</kbd> to <kbd>$q</kbd>. You can use this method for single or multi-image sequences.</p>
+<p>Finally, the Transform() method accepts a fully-qualified geometry specification for cropping or resizing one or more images. For example,</p>
<p>The Flatten() method flattens a set of images and returns it. For example,</p>
print $1; # print the error number
</pre>
-<p>Methods which return images (Average(), Montage(), Clone()) should be checked for errors this way:</p>
+<p>Methods which return images (EvaluateSequence(), Montage(), Clone()) should be checked for errors this way:</p>
<pre class="code">
$x = $image->Montage(...);
<!-- <span id="linkbar-west"> </span> -->\r
<span id="linkbar-center">\r
<a href="http://www.imagemagick.org/discourse-server/">Discourse Server</a> •\r
- <a href="../www/mailing-list.html">Mailing Lists</a> •\r
<a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a>\r
</span>\r
<span id="linkbar-east"> </span>\r
</div>\r
<div class="footer">\r
- <span id="footer-west">© 1999-2009 ImageMagick Studio LLC</span>\r
+ <span id="footer-west">© 1999-2010 ImageMagick Studio LLC</span>\r
<span id="footer-east"> <a href="http://www.imagemagick.org/script/contact.php">Contact the Wizards</a></span>\r
</div>\r
<div style="clear: both; margin: 0; width: 100%; "></div>\r