]> granicus.if.org Git - imagemagick/blobdiff - www/perl-magick.html
(no commit message)
[imagemagick] / www / perl-magick.html
index 1e50f91bc8b9a5b3e920927b22eadf7dbe0c326a..44c25fcac2b9c7f72cbf03ba24101d168f7137e1 100644 (file)
@@ -1,6 +1,10 @@
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" \r
   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr">\r
+<html version="-//W3C//DTD XHTML 1.1//EN"\r
+      xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"\r
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
+      xsi:schemaLocation="http://www.w3.org/1999/xhtml\r
+                          http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">\r
 <head>\r
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\r
   <meta name="verify-v1" content="g222frIIxcQTrvDR3NBRUSKP3AnMNoqxOkIniCEkV7U="/>\r
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
   <meta http-equiv="Reply-to" content="magick-users@imagemagick.org"/>
   <meta name="Application-name" content="ImageMagick"/>
-  <meta name="Description" content="ImageMagick is a software suite to create, edit, compose, or convert bitmap images in a variety of formats. Use ImageMagick to scale, rotate, shear, distort and transform images."/>
+  <meta name="Description" content="Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats.  In addition resize, rotate, shear, distort and transform images automagically."/>
   <meta name="Application-url" content="http://www.imagemagick.org"/>
   <meta name="Generator" content="PHP"/>
-  <meta name="Keywords" content="perlmagick, perl, api, for, imagemagick, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand, ImageMagickObject, Swiss, Army, Knife, Image, Processing"/>
+  <meta name="Keywords" content="perlmagick, perl, api, for, imagemagick, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand, ImageMagickObject, Image, Processing, Automagically"/>
   <meta name="Rating" content="GENERAL"/>
   <meta name="Robots" content="INDEX, FOLLOW"/>
   <meta name="Generator" content="ImageMagick Studio LLC"/>
 \r
 <body id="www-imagemagick-org">\r
 <div class="titlebar">\r
-<a href="../index.html">\r
-  <img src="../images/script.png" alt="[ImageMagick]"\r
-  style="width: 350px; height: 60px; margin: 28px auto; float: left;" /></a>\r
-<a href="http://www.networkredux.com">\r
-  <img src="../images/networkredux.png" alt="[sponsor]"\r
-  style="margin-top: 42px; border: 0px; float: left;" /></a>\r
+<div style="margin: 17px auto; float: left;">\r
+  <script type="text/javascript">\r
+  <!--\r
+    google_ad_client = "pub-3129977114552745";\r
+    google_ad_slot = "5439289906";\r
+    google_ad_width = 728;\r
+    google_ad_height = 90;\r
+  //-->\r
+  </script>\r
+  <script type="text/javascript"\r
+    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
+  </script>\r
+</div>\r
 <a href="http://www.imagemagick.org/discourse-server/">\r
-  <img src="../images/logo.jpg" alt=""\r
+  <img src="../images/logo.jpg"\r
+  alt="ImageMagick Logo"\r
   style="width: 123px; height: 118px; border: 0px; float: right;" /></a>\r
 <a href="../index.html">\r
-  <img src="../images/sprite.jpg" alt=""\r
+  <img src="../images/sprite.jpg"\r
+  alt="ImageMagick Sprite"\r
   style="width: 114px; height: 118px; border: 0px; float: right;" /></a>\r
 </div>\r
 \r
@@ -74,6 +87,9 @@
 <div class="sub">
     <a title="Binary Release: MacOS X" href="../www/binary-releases.html#macosx">Mac OS X</a>
 </div>
+<div class="sub">
+    <a title="Binary Release: iOS" href="../www/binary-releases.html#iOS">iOS</a>
+</div>
 <div class="sub">
     <a title="Binary Release: Windows" href="../www/binary-releases.html#windows">Windows</a>
 </div>
 </div>
 <div class="sep"></div>\r
 <div  class="menu">
-  <a title="Sponsors" href="../www/sponsors.html">Sponsors:</a>
+  <a rel="follow" title="Sponsors" href="../www/sponsors.html">Sponsors:</a>
 
+<a href="http://www.networkredux.com">
+  <img src="../images/networkredux.png" alt="[sponsor]"
+  style="margin-top: 4px; margin-left: 4px; border: 0px; float: left;" /></a>
 <div class="sponsbox">
 <div  class="sponsor">
-  <a title="Sponsor: Druckerei" href="http://www.allesdruck.de">Druckerei</a><!-- 201106010240 -->
+  <a rel="follow" title="Sponsor: Web Hosting" href="http://www.micfo.com">Web Hosting</a><!-- 209901010090s golestan -->
+</div>
+<div  class="sponsor">
+  <a rel="follow" title="Sponsor: Search engine optimisation" href="http://www.seomoves.com.au">Search engine optimisation</a><!-- 201110010090s jen@seo lowprofilelinks -->
+</div>
+<div  class="sponsor">
+  <a rel="follow" title="Sponsor: Druckerei" href="http://print24.com/de/">Druckerei</a><!-- 201110010720 -->
+</div>
+<div  class="sponsor">
+  <a rel="follow" title="Sponsor: Web Hosting Deals" href="http://www.webhostingdeals.org">Web Hosting Deals</a><!-- 201111010270 chee.hoa darin -->
+</div>
+<div  class="sponsor">
+  <a rel="follow" title="Sponsor: Web Hosting Reviews" href="http://www.webhostingsecretrevealed.com">Web Hosting Secret Revealed</a><!-- 201204010540 iamchee jerry -->
+</div>
+<div  class="sponsor">
+  <a rel="follow" title="Sponsor: Web Hosting Break" href="http://www.webhostingbreak.com">Web Hosting Break</a><!-- 201109010090 ian@ian-m... -->
+</div>
+<div  class="sponsor">
+  <a rel="follow" title="Sponsor: Druckerei" href="http://www.allesdruck.de">Druckerei</a><!-- 201303011500 r.leo -->
+</div>
+<div  class="sponsor">
+  <a rel="follow" title="Sponsor: Website Hosting" href="http://www.hostreviewgeeks.com">Website Hosting</a><!-- 201110010090 alexanian media -->
+</div>
+<div  class="sponsor">
+  <a rel="follow" title="Sponsor: Hotel München" href="http://www.messehotel-erb-muenchen.de">Hotel München</a><!-- 201111010450 cerb -->
 </div>
-<div class="sponsor">
-  <a title="Sponsor: Web Hosting" href="http://www.bodhost.com/hosting.shtml">Web Hosting</a><!-- 201104010090 -->
+<div  class="sponsor">
+  <a rel="follow" title="Sponsor: Best Web Hosting" href="http://webhostinggeeks.com">Best Web Hosting</a><!-- 201110010720 -->
 </div>
 <div  class="sponsor">
-  <a title="Sponsor: Image Converter" href="http://www.batchphoto.com">Image Converter</a><!-- 201103010900 Bits Coffee-->
+  <a rel="follow" title="Sponsor: Flyer drucken" href="http://www.online-druck.biz">Flyer drucken</a><!-- 201109010900 Floeter-->
 </div>
 <div  class="sponsor">
-  <a title="Sponsor: Flyer drucken" href="http://www.online-druck.biz">Flyer drucken</a><!-- 201109010900 Floeter-->
+  <a rel="follow" title="Sponsor: Web Hosting Reviews" href="http://www.webhostingmasters.com">Web Hosting Reviews</a><!-- 201107011500 affliatelabel -->
 </div>
 <div  class="sponsor">
-  <a title="Sponsor: Druckerei" href="http://print24.com/de/">Druckerei</a><!-- 201110010720 -->
+  <a rel="follow" title="Sponsor: Web Hosting Ratings" href="http://webhostingrating.com">Web Hosting Ratings</a><!-- 201110010720 -->
 </div>
 <div  class="sponsor">
-   <a title="Sponsor: Webdesign" href="http://www.renehornig.com/">Webdesign</a><!-- 20111001000240 -->
+   <a rel="follow" title="Sponsor: Free Catalogs" href="http://www.who-sells-it.com/">Free Catalogs</a><!-- 20120801000600 -->
 </div>
 </div>
 </div>
 </div>\r
 \r
 <div class="eastbar">\r
-  <script type="text/javascript">\r
-  <!--\r
-    google_ad_client = "pub-3129977114552745";\r
-    google_ad_slot = "0574824969";\r
-    google_ad_width = 160;\r
-    google_ad_height = 600;\r
-  //-->\r
-  </script>\r
-  <script type="text/javascript"\r
-    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
-  </script>\r
+\r
 </div>\r
 \r
 <div class="main">\r
 \r
 \r
-<h1>ImageMagick PerlMagick API</h1>
+<h1>PerlMagick API</h1>
 <p class="navigation-index">[<a href="#installation">Installation</a> &bull; <a href="#overview">Overview</a> &bull; <a href="#example">Example Script</a> &bull; <a href="#read">Read or Write an Image</a> &bull; <a href="#manipulate">Manipulate an Image</a> &bull; <a href="#set-attribute">Set an Image Attribute</a> &bull; <a href="#get-attribute">Get an Image Attribute</a> &bull; <a href="#compare">Compare an Image to its Reconstruction</a> &bull; <a href="#montage">Create an Image Montage</a> &bull; <a href="#blobs">Working with Blobs</a> &bull; <a href="#direct-access">Direct-access to Image Pixels</a> &bull; <a href="#miscellaneous">Miscellaneous Methods</a> &bull; <a href="#exceptions">Handling Exceptions</a>&bull; <a href="#constants">Constant</a> ]</p>
 
 <div class="doc-section">
 
 <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.67 for
-ImageMagick 6.6.7) and unpack it as shown below:</p>
+(e.g., PerlMagick 6.70 for
+ImageMagick 6.7.0) and unpack it as shown below:</p>
 
-<p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>tar xvfz PerlMagick-6.67.tar.gz</span><span class='crtout'></span><span class="crtprompt"> $magick&gt; </span><span class='crtin'>cd PerlMagick</span></p>
+<p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>tar xvfz PerlMagick-6.70.tar.gz</span><span class='crtout'></span><span class="crtprompt"> $magick&gt; </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&gt; </span><span class='crtin'>perl Makefile.PL</span><span class='crtout'></span><span class="crtprompt"> $magick&gt; </span><span class='crtin'>make</span><span class='crtout'></span><span class="crtprompt"> $magick&gt; </span><span class='crtin'>make install</span></p>
@@ -319,7 +352,7 @@ ImageMagick 6.6.7) and unpack it as shown below:</p>
 <pre class="code">
   $image = Image::Magick-&gt;new;
   $image-&gt;Set(size=&gt;'100x100');
-  $image-&gt;ReadImage('xc:white');
+  $image-&gt;ReadImage('canvas:white');
   $image-&gt;Set('pixel[49,49]'=&gt;'red');
 </pre>
 
@@ -716,7 +749,7 @@ ImageMagick 6.6.7) and unpack it as shown below:</p>
 
   <tr>
     <td valign="top">Distort</td>
-    <td valign="top">points=&gt;<i>array of float values</i>, method=&gt;{Affine, AffineProjection, Bilinear, Perspective, ScaleRotateTranslate}, virtual-pixel=&gt;{Background Black Constant Dither Edge Gray Mirror Random Tile Transparent White}, best-fit=&gt;{True, False}</td>
+    <td valign="top">points=&gt;<i>array of float values</i>, method=&gt;{Affine, AffineProjection, Bilinear, Perspective, Resize, ScaleRotateTranslate}, virtual-pixel=&gt;{Background Black Constant Dither Edge Gray Mirror Random Tile Transparent White}, best-fit=&gt;{True, False}</td>
     <td valign="top">distort image</td>
   </tr>
 
@@ -914,7 +947,7 @@ ImageMagick 6.6.7) and unpack it as shown below:</p>
 
   <tr>
     <td valign="top">MedianFilter</td>
-    <td valign="top">radius=&gt;<i>double</i></td>
+    <td valign="top">geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>, height=&gt;<i>integer</i>, channel=&gt;{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}</td>
     <td valign="top">replace each pixel with the median intensity pixel of a neighborhood.</td>
   </tr>
 
@@ -924,9 +957,15 @@ ImageMagick 6.6.7) and unpack it as shown below:</p>
     <td valign="top">half the size of an image</td>
   </tr>
 
+  <tr>
+    <td valign="top">Mode</td>
+    <td valign="top">geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>, height=&gt;<i>integer</i>, channel=&gt;{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}</td>
+    <td valign="top">make each pixel the <em>predominate color</em> of the neighborhood.</td>
+  </tr>
+
   <tr>
     <td valign="top">Modulate</td>
-    <td valign="top">brightness=&gt;<i>double</i>, saturation=&gt;<i>double</i>, hue=&gt;<i>double</i>, lightness=&gt;<i>double</i>, whiteness=&gt;<i>double</i>, blackness=&gt;<i>double</i> </td>
+    <td valign="top">factor=&gt;<i>geometry</i>, brightness=&gt;<i>double</i>, saturation=&gt;<i>double</i>, hue=&gt;<i>double</i>, lightness=&gt;<i>double</i>, whiteness=&gt;<i>double</i>, blackness=&gt;<i>double</i> </td>
     <td valign="top">vary the brightness, saturation, and hue of an image by the specified percentage</td>
   </tr>
 
@@ -1011,7 +1050,7 @@ fill=&gt;<i><a href="../www/color.html">color name</a></i>, channel=&gt;{All, De
 
   <tr>
     <td valign="top">ReduceNoise</td>
-    <td valign="top">radius=&gt;<i>double</i></td>
+    <td valign="top">geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>, height=&gt;<i>integer</i>, channel=&gt;{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}</td>
     <td valign="top">reduce noise in the image with a noise peak elimination filter</td>
   </tr>
 
@@ -1152,6 +1191,11 @@ fill=&gt;<i><a href="../www/color.html">color name</a></i>, channel=&gt;{All, De
     <td valign="top">displace image pixels by a random amount</td>
   </tr>
 
+  <tr>
+    <td valign="top">Statistic</td>
+    <td valign="top">geometry=&gt;<i>geometry</i>, width=&gt;<i>integer</i>, height=&gt;<i>integer</i>, channel=&gt;{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}, type=&gt;{Median, Mode, Mean, Maximum, Minimum, ReduceNoise}</td>
+    <td valign="top">replace each pixel with corresponding statistic from the neighborhood.</td>
+  </tr>
   <tr>
     <td valign="top">Stegano</td>
     <td valign="top">image=&gt;<i>image-handle</i>, offset=&gt;<i>integer</i></td>
@@ -2454,6 +2498,14 @@ blobs in any of these image <a href="../www/formats.html">formats</a> and provid
   $image-&gt;RemoteCommand('image.jpg');
 </pre>
 
+<p>The Smush() method smushes a set of images together. For example,</p>
+
+<pre class="code">
+  $p = $image-&gt;Smush(stack=&gt;{true,false},offset=&gt;<em>integer</em>);
+</pre>
+
+<p>smushes together all the images associated with object <kbd>$image</kbd>. By default, images are smushed left-to-right. Set <kbd>stack</kbd> to True to smushed them top-to-bottom.</p>
+
 <p>Statistics() returns the image statistics for each channel in the image. The returned values are an array of depth, minima, maxima, mean, standard deviation, kurtosis, and skewness values in RGB, CMYK, RGBA, or CMYKA order (depending on the image type).</p>
 
 <pre class="code">