]> granicus.if.org Git - imagemagick/blobdiff - www/perl-magick.html
...
[imagemagick] / www / perl-magick.html
index 3f49dc57405a7ccf4ddae5d4d4a60b35a641e309..8d360136f0682e95135ba6d3913970fe5ee5ca23 100644 (file)
@@ -1,32 +1,45 @@
+
+
+
+
 <!DOCTYPE html>
 <html lang="en">
 <head>
-  
-    <title>ImageMagick: PerlMagick, Perl API for ImageMagick</title>
-  <meta http-equiv="content-type" content="text/html; charset=utf-8">
-  <meta name="application-name" content="ImageMagick">
-  <meta name="description" content="ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.">
-  <meta name="application-url" content="http://www.imagemagick.org">
-  <meta name="generator" content="PHP">
-  <meta name="keywords" content="perlmagick, perl, api, for, imagemagick, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert">
-  <meta name="rating" content="GENERAL">
-  <meta name="robots" content="INDEX, FOLLOW">
-  <meta name="generator" content="ImageMagick Studio LLC">
-  <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-2015 ImageMagick Studio LLC">
-  <meta name="distribution" content="Global">
-  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1">
-  <link rel="icon" href="../images/wand.png">
-  <link rel="shortcut icon" href="../images/wand.ico">
-  <link rel="stylesheet" href="../css/magick.html">
+  <meta charset="utf-8" />
+  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
+  <meta http-equiv="x-ua-compatible" content="ie=edge" />
+  <title>PerlMagick, Perl API @ ImageMagick</title>
+  <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
+  <meta name="application-name" content="ImageMagick"/>
+  <meta name="description" content="ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves."/>
+  <meta name="application-url" content="https://www.imagemagick.org"/>
+  <meta name="generator" content="PHP"/>
+  <meta name="keywords" content="perlmagick, perl, api, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/>
+  <meta name="rating" content="GENERAL"/>
+  <meta name="robots" content="INDEX, FOLLOW"/>
+  <meta name="generator" content="ImageMagick Studio LLC"/>
+  <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-2016 ImageMagick Studio LLC"/>
+  <meta name="distribution" content="Global"/>
+  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
+  <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
+  <link rel="canonical" href="https://www.imagemagick.org/script/perl-magick.html"/>
+  <link rel="icon" href="../images/wand.png"/>
+  <link rel="shortcut icon" href="../images/wand.ico"/>
+  <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:900,400,400italic,700,700italic,300,300italic|Open+Sans:300italic,400italic,700italic,300,400,600,700" />
+  <link rel="stylesheet" href="css/magick.css"/>
 </head>
 <body>
 <div class="main">
 <div class="magick-masthead">
   <div class="container">
-    <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3129977114552745" data-ad-slot="6345125851" data-ad-format="auto"></ins>
+    <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
+         style="display:block"
+         data-ad-client="ca-pub-3129977114552745"
+         data-ad-slot="6345125851"
+         data-ad-format="auto"></ins>
     <script>
       (adsbygoogle = window.adsbygoogle || []).push({});
     </script>
       <a class="magick-nav-item " href="../index.html">Home</a>
       <a class="magick-nav-item " href="binary-releases.html">Download</a>
       <a class="magick-nav-item " href="command-line-tools.html">Tools</a>
-      <a class="magick-nav-item " href="command-line-options.html">Options</a>
+      <a class="magick-nav-item " href="command-line-processing.html">Command-line</a>
       <a class="magick-nav-item " href="resources.html">Resources</a>
       <a class="magick-nav-item " href="api.html">Develop</a>
-      <a class="magick-nav-item " href="http://nextgen.imagemagick.org/script/search.php">Search</a>
-      <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a>
+      <a class="magick-nav-item " href="https://www.imagemagick.org/script/search.php">Search</a>
+      <a class="magick-nav-item pull-right" href="https://www.imagemagick.org/discourse-server/">Community</a>
     </nav>
   </div>
 </div>
@@ -49,9 +62,9 @@
 <a id="introduction"></a>
 <p class="lead magick-description"><a href="download.html">PerlMagick</a> is an objected-oriented <a href="http://www.perl.com/perl/">Perl</a> interface to ImageMagick. 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 ImageMagick 6.5.5 or above and Perl version 5.005_02 or greater installed on your system for PerlMagick to build properly.</p>
 
-<p>There are a number of useful scripts available to show you the value of PerlMagick. You can do Web based image manipulation and conversion with <a href="http://www.imagemagick.org/download/perl">MagickStudio</a>, or use <a href="http://git.imagemagick.org/repos/ImageMagick/PerlMagick/demo">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="http://webmagick.sourceforge.net/">WebMagick Image Navigator</a>.</p>
+<p>There are a number of useful scripts available to show you the value of PerlMagick. You can do Web based image manipulation and conversion with <a href="https://www.imagemagick.org/download/perl">MagickStudio</a>, or use <a href="http://git.imagemagick.org/repos/ImageMagick/PerlMagick/demo">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="http://webmagick.sourceforge.net/">WebMagick Image Navigator</a>.</p>
 
-<p>You can try PerlMagick 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.html">examples</a> of select PerlMagick functions.</p>
+<p>You can try PerlMagick from your Web browser at the <a href="https://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">ImageMagick Studio</a>. Or, you can see <a href="examples.html">examples</a> of select PerlMagick functions.</p>
 
 <h2 class="magick-header"><a id="installation"></a>Installation</h2>
 
@@ -63,7 +76,7 @@
 yum install ImageMagick-perl
 </pre>
 
-<p>If not, you must install PerlMagick from the ImageMagick source distribution.  Download the latest <a href="http://www.imagemagick.org/download/ImageMagick.tar.gz">source</a> release.</p>
+<p>If not, you must install PerlMagick from the ImageMagick source distribution.  Download the latest <a href="https://www.imagemagick.org/download/ImageMagick.tar.gz">source</a> release.</p>
 
 <p>Unpack the distribution with this command:</p>
 
@@ -73,7 +86,7 @@ tar xvzf ImageMagick.tar.gz
 
 <p>Next configure and compile ImageMagick:</p>
 
-<pre><span class="crtprompt"> </span><span class="crtin">cd ImageMagick-7.0.0</span><span class="crtout"></span><span class="crtprompt"> </span><span class="crtin">./configure -with-perl</span><span class="crtout"></span><span class="crtprompt"> </span><span class="crtin">make</span></pre>
+<pre><span class="crtprompt"> </span><span class='crtin'>cd ImageMagick-7.0.3</span><span class='crtout'></span><span class="crtprompt"> </span><span class='crtin'>./configure -with-perl</span><span class='crtout'></span><span class="crtprompt"> </span><span class='crtin'>make</span></pre>
 <p>If ImageMagick / PerlMagick configured and compiled without complaint, you are ready to install it on your system.  Administrator privileges are required to install.  To install, type</p>
 
 <pre>
@@ -90,10 +103,10 @@ sudo ldconfig /usr/local/lib
 <p>Finally, verify the PerlMagick install worked properly, type</p>
 
 <pre>
-perl -e \"use Image::Magick; print Image::Magick-&gt;QuantumDepth\"
+perl -MImage::Magick -le 'print Image::Magick->QuantumDepth'
 </pre>
 
-<p>Congratulations, you have a working ImageMagick distribution and you are ready to use PerlMagick to <a href="http://www.imagemagick.org/Usage/">convert, compose, or edit</a> your images.</p>
+<p>Congratulations, you have a working ImageMagick distribution and you are ready to use PerlMagick to <a href="https://www.imagemagick.org/Usage/">convert, compose, or edit</a> your images.</p>
 
 <p><b>Windows XP / Windows 2000</b></p>
 
@@ -185,13 +198,13 @@ $ENV{PATH}' . "='/../bin:/usr/bin:/usr/local/bin';
 
 <pre>
 #!/usr/local/bin/perl
-use Image::Magick;<br>
-my($image, $x);<br>
+use Image::Magick;<br />
+my($image, $x);<br />
 $image = Image::Magick-&gt;new;
 $x = $image-&gt;Read('girl.png', 'logo.png', 'rose.png');
-warn "$x" if "$x";<br>
+warn "$x" if "$x";<br />
 $x = $image-&gt;Crop(geometry=&gt;'100x100+100+100');
-warn "$x" if "$x";<br>
+warn "$x" if "$x";<br />
 $x = $image-&gt;Write('x.png');
 warn "$x" if "$x";
 </pre>
@@ -199,8 +212,8 @@ warn "$x" if "$x";
 <p>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 done:</p>
 
 <pre class="pre-scrollable">#!/usr/local/bin/perl
-use Image::Magick;<br>
-my($image, $p, $q);<br>
+use Image::Magick;<br />
+my($image, $p, $q);<br />
 $image = new Image::Magick;
 $image-&gt;Read('x1.png');
 $image-&gt;Read('j*.jpg');
@@ -272,10 +285,10 @@ $p-&gt;Convolve([1, 2, 1, 2, 4, 2, 1, 2, 1]);   # 3x3 Gaussian kernel
 <table class="table table-condensed table-striped">
 <caption>Read or Write Methods</caption>
 <colgroup>
-  <col width="20%">
-  <col width="20%">
-  <col width="20%">
-  <col width="40%">
+  <col width="20%" />
+  <col width="20%" />
+  <col width="20%" />
+  <col width="40%" />
 </colgroup>
 <tbody>
 
@@ -342,7 +355,7 @@ close(IMAGE);
 
 <pre>
 $filename = "image.png";
-open(IMAGE, "&gt;$filename");
+open(IMAGE, ">$filename");
 $image-&gt;Write(file=&gt;\*IMAGE, filename=&gt;$filename);
 close(IMAGE);
 </pre>
@@ -441,13 +454,13 @@ $image-&gt;[$x]-&gt;Frame("100x200");
 
   <tr>
     <td>AutoOrient</td>
-    <td><br></td>
+    <td><br /></td>
     <td>adjusts an image so that its orientation is suitable for viewing (i.e. top-left orientation)</td>
   </tr>
 
   <tr>
     <td>BlackThreshold</td>
-    <td>threshold=&gt;<i>string</i>, channel=&gt;{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}</td>
+    <td>threshold=&gt;<i>string</i>, channel=&gt;{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}</td>
     <td>force all pixels below the threshold intensity into black</td>
   </tr>
 
@@ -513,7 +526,7 @@ $image-&gt;[$x]-&gt;Frame("100x200");
 
   <tr>
     <td>Coalesce</td>
-    <td><br></td>
+    <td><br /></td>
     <td>merge a sequence of images</td>
   </tr>
 
@@ -617,7 +630,7 @@ ay connectivity.</td>
 
   <tr>
     <td>Deconstruct</td>
-    <td><br></td>
+    <td><br /></td>
     <td>break down an image sequence into constituent parts</td>
   </tr>
 
@@ -641,7 +654,7 @@ ay connectivity.</td>
 
   <tr>
     <td>Distort</td>
-    <td>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>points=&gt;<i>array of float values</i>, method=&gt;{Affine, AffineProjection, ScaleRotateTranslate, SRT, Perspective, PerspectiveProjection, BilinearForward, BilinearReverse, Polynomial, Arc, Polar, DePolar, Barrel, BarrelInverse, Shepards, Resize}, 'virtual-pixel'=&gt;{Background Black Constant Dither Edge Gray Mirror Random Tile Transparent White}, 'best-fit'=&gt;{True, False}</td>
     <td>distort image</td>
   </tr>
 
@@ -671,13 +684,13 @@ ay connectivity.</td>
 
   <tr>
     <td>Enhance</td>
-    <td><br></td>
+    <td><br /></td>
     <td>apply a digital filter to enhance a noisy image</td>
   </tr>
 
   <tr>
     <td>Equalize</td>
-    <td>channel=&gt;{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}<br></td>
+    <td>channel=&gt;{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}<br /></td>
     <td>perform histogram equalization to the image</td>
   </tr>
 
@@ -701,13 +714,13 @@ ay connectivity.</td>
 
   <tr>
     <td>Flip</td>
-    <td><br></td>
+    <td><br /></td>
     <td>reflect the image scanlines in the vertical direction</td>
   </tr>
 
   <tr>
     <td>Flop</td>
-    <td><br></td>
+    <td><br /></td>
     <td>reflect the image scanlines in the horizontal direction</td>
   </tr>
 
@@ -839,7 +852,7 @@ ay connectivity.</td>
 
   <tr>
     <td>Magnify</td>
-    <td><br></td>
+    <td><br /></td>
     <td>double the size of the image with pixel art scaling</td>
   </tr>
 
@@ -869,7 +882,7 @@ ay connectivity.</td>
 
   <tr>
     <td>Minify</td>
-    <td><br></td>
+    <td><br /></td>
     <td>half the size of an image</td>
   </tr>
 
@@ -905,7 +918,7 @@ ay connectivity.</td>
 
   <tr>
     <td>Normalize</td>
-    <td>channel=&gt;{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}<br></td>
+    <td>channel=&gt;{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}<br /></td>
     <td>transform image to span the full range of color values</td>
   </tr>
 
@@ -1079,7 +1092,7 @@ fill=&gt;<i><a href="color.html">color name</a></i>, channel=&gt;{All, Default,
 
   <tr>
     <td>Signature</td>
-    <td><br></td>
+    <td><br /></td>
     <td>generate an SHA-256 message digest for the image pixel stream</td>
   </tr>
 
@@ -1132,7 +1145,7 @@ fill=&gt;<i><a href="color.html">color name</a></i>, channel=&gt;{All, Default,
 
   <tr>
     <td>Strip</td>
-    <td><br></td>
+    <td><br /></td>
     <td>strip an image of all profiles and comments.</td>
   </tr>
 
@@ -1174,19 +1187,19 @@ fill=&gt;<i><a href="color.html">color name</a></i>, channel=&gt;{All, Default,
 
   <tr>
     <td>Transpose</td>
-    <td><br></td>
+    <td><br /></td>
     <td>flip image in the vertical direction and rotate 90 degrees</td>
   </tr>
 
   <tr>
     <td>Transverse</td>
-    <td><br></td>
+    <td><br /></td>
     <td>flop image in the horizontal direction and rotate 270 degrees</td>
   </tr>
 
   <tr>
     <td>Trim</td>
-    <td><br></td>
+    <td><br /></td>
     <td>remove edges that are the background color from the image</td>
   </tr>
 
@@ -1208,6 +1221,12 @@ fill=&gt;<i><a href="color.html">color name</a></i>, channel=&gt;{All, Default,
     <td>alter an image along a sine wave</td>
   </tr>
 
+  <tr>
+    <td>WaveDenoise</td>
+    <td>geometry=&gt;<i>geometry</i>, threshold=&gt;<i>double</i>, threshold=&gt;<i>double</i></td>
+    <td>removes noise from the image using a wavelet transform</td>
+  </tr>
+
   <tr>
     <td>WhiteThreshold</td>
     <td>threshold=&gt;<i>string</i>, , channel=&gt;{All, Default, Alpha, Black, Blue, CMYK, Cyan, Gray, Green, Index, Magenta, Opacity, Red, RGB, Yellow}</td>
@@ -1827,12 +1846,30 @@ $width = $image-&gt;[3]-&gt;Get('columns');
     <td>the number of rows or height of an image</td>
   </tr>
 
+  <tr>
+    <td>icc</td>
+    <td><i>string</i></td>
+    <td>ICC profile</td>
+  </tr>
+
+  <tr>
+    <td>icc</td>
+    <td><i>string</i></td>
+    <td>ICM profile</td>
+  </tr>
+
   <tr>
     <td>id</td>
     <td><i>integer</i></td>
     <td>ImageMagick registry id</td>
   </tr>
 
+  <tr>
+    <td>IPTC</td>
+    <td><i>string</i></td>
+    <td>IPTC profile</td>
+  </tr>
+
   <tr>
     <td>mean-error</td>
     <td><i>double</i></td>
@@ -1935,6 +1972,12 @@ $width = $image-&gt;[3]-&gt;Get('columns');
     <td>the number of columns or width of an image</td>
   </tr>
 
+  <tr>
+    <td>XMP</td>
+    <td><i>string</i></td>
+    <td>XMP profile</td>
+  </tr>
+
   <tr>
     <td>x-resolution</td>
     <td><i>integer</i></td>
@@ -1998,14 +2041,14 @@ $width = $image-&gt;[3]-&gt;Get('columns');
 <pre>
 use Image::Magick;
 
-$logo=Image::Magick-&gt;New();
-$logo-&gt;Read('logo:');
-$sharp=Image::Magick-&gt;New();
-$sharp-&gt;Read('logo:');
-$sharp-&gt;Sharpen('0x1');
-$difference=$logo-&gt;Compare(image=&gt;$sharp, metric=&gt;'rmse');
-print $difference-&gt;Get('error'), "\n";
-$difference-&gt;Display();
+$logo=Image::Magick->New();
+$logo->Read('logo:');
+$sharp=Image::Magick->New();
+$sharp->Read('logo:');
+$sharp->Sharpen('0x1');
+$difference=$logo->Compare(image=>$sharp, metric=>'rmse');
+print $difference->Get('error'), "\n";
+$difference->Display();
 </pre>
 
 <p>In addition to the reported root mean squared error of around 0.024, a difference image is displayed so you can visually identify the difference between the images.</p>
@@ -2069,7 +2112,7 @@ $image-&gt;Montage(geometry=&gt;'160x160', tile=&gt;'2x2', texture=&gt;'granite:
     <td>geometry</td>
     <td><i>geometry</i></td>
     <td>preferred tile and border size of each tile of the composite
-image (e.g. 120x120+4+3&gt;)</td>
+image (e.g. 120x120+4+3>)</td>
   </tr>
 
   <tr>
@@ -2279,7 +2322,7 @@ $p = $image-&gt;EvaluateImages('mean');
 <p>Finally, the Transform() method accepts a fully-qualified geometry specification for cropping or resizing one or more images.  For example,</p>
 
 <pre>
-$p = $images-&gt;Transform(crop=&gt;'100x100+10+60');
+$p = $images-&gt;Transform(crop=>'100x100+10+60');
 </pre>
 
 <p>The Flatten() method flattens a set of images and returns it. For example,</p>
@@ -2547,17 +2590,19 @@ Image::Magick-&gt;QuantumDepth
     <p><a href="support.html">Donate</a> •
      <a href="sitemap.html">Sitemap</a> •
     <a href="links.html">Related</a> •
+    <a href="security-policy.html">Security</a> •
     <a href="architecture.html">Architecture</a>
 </p>
     <p><a href="perl-magick.html#">Back to top</a> •
     <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
-    <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p>
-        <p><small>©  1999-2015 ImageMagick Studio LLC</small></p>
+    <a href="https://www.imagemagick.org/script/contact.php">Contact Us</a></p>
+        <p><small>©  1999-2016 ImageMagick Studio LLC</small></p>
   </footer>
 </div><!-- /.container -->
 
   <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
-  <script src="http://nextgen.imagemagick.org/js/magick.html"></script>
+  <script src="../js/magick.html"></script>
 </div>
 </body>
 </html>
+<!-- Magick Cache 26th November 2016 12:14 -->
\ No newline at end of file