root / ImageMagick / trunk / www / compare.html

Revision 12091, 18.6 kB (checked in by cristy, 40 hours ago)
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
4<head>
5  <style type="text/css" media="screen,projection"><!--
6    @import url("../www/magick.css");
7  //--></style>
8  <meta name="verify-v1" content="g222frIIxcQTrvDR3NBRUSKP3AnMNoqxOkIniCEkV7U=" />
9  <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf" />
10  <title>ImageMagick: Command-line Tools: Compare</title>
11  <meta http-equiv="Content-Language" content="en-US"/>
12  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
13  <meta http-equiv="Reply-to" content="magick-users@imagemagick.org"/>
14  <meta name="Generator" content="PHP"/>
15  <meta name="Keywords" content="command-line, tools:, compare, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand, ImageMagickObject"/>
16  <meta name="Description" content="ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (about 100) including GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.  ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you can freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems.  The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite programming language. Choose from these interfaces: MagickCore (C), MagickWand (C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a language interface, use ImageMagick to modify or create images automagically and dynamically."/>
17  <meta name="Rating" content="GENERAL"/>
18  <meta name="Robots" content="INDEX, FOLLOW"/>
19  <meta name="Generator" content="ImageMagick Studio LLC"/>
20  <meta name="Author" content="ImageMagick Studio LLC"/>
21  <meta name="Revisit-after" content="2 DAYS"/>
22  <meta name="Resource-type" content="document"/>
23  <meta name="Copyright" content="Copyright (c) 1999-2008 ImageMagick Studio LLC"/>
24  <meta name="Distribution" content="Global"/>
25  <link rel="shortcut icon" href="../images/wand.ico"  type="images/vnd.microsoft.icon"/>
26</head>
27
28<body id="www-imagemagick-org">
29  <table id="titlebar" style="width: 100%;background-color: #f5f5f5" cellpadding="0" cellspacing="0" border="0" summary="ImageMagick">
30    <tbody>
31      <tr valign="top">
32        <td align="left"><a href="../index.html"><img id="titlebar-west" src="../images/script.png" alt="[ImageMagick]" width="350" height="60" vspace="28" name="titlebar-west"/></a></td>
33        <td align="left"><a href="https://secure.networkredux.com/affiliate/idevaffiliate.html?id=146" target="649764193"><img id="titlebar-west" src="../images/networkredux.png" alt="[sponsor]" border="0" vspace="45" name="titlebar-west"/></a></td>
34        <td width="99%"><br /> </td>
35        <td style="background-color: white" align="right"><a href="../index.html"><img src="../images/sprite.jpg" alt="" width="114" height="118" border="0" name="titlebar-east"/></a></td>
36        <td style="background-color: white" align="right"><a href="http://www.imagemagick.org/discourse-server/" target="2144163309"><img id="titlebar-east" src="../images/logo.jpg" alt="" width="114" height="118" border="0" name="titlebar-east"/></a></td>
37      </tr>
38    </tbody>
39  </table>
40
41  <table style="width: 100%" border="0" cellpadding="0" cellspacing="0" summary="">
42  <tbody>
43
44    <tr valign="top" style="height: 100%;">
45      <td id="menu" width="1%" height="100%">
46      <p><a href="#main">Skip to page contents</a></p>
47      <font size="-1">
48      <span>[</span>
49      <a href="../index.html">About ImageMagick</a>
50  <span>]</span><br /><span>[</span>
51      <a href="../www/command-line-tools.html">Command-line Tools</a>
52      <a href="../www/command-line-processing.html" class="sub">Processing</a>
53      <a href="../www/command-line-options.html" class="sub">Options</a>
54      <a href="http://www.imagemagick.org/Usage/" target="1148663787" class="sub">Usage</a>
55      <a href="../www/api.html">Program Interfaces</a>
56      <a href="../www/magick-wand.html" class="sub">MagickWand</a>
57      <a href="../www/magick-core.html" class="sub">MagickCore</a>
58      <a href="../www/perl-magick.html" class="sub">PerlMagick</a>
59      <a href="../www/Magick++/" target="1187243316" class="sub">Magick++</a>
60      <a href="../www/architecture.html">Architecture</a>
61  <span>]</span><br /><span>[</span>
62      <a href="../www/install-source.html">Install from Source</a>
63      <a href="../www/install-source.html#unix" class="sub">Unix</a>
64      <a href="../www/install-source.html#windows" class="sub">Windows</a>
65      <a href="../www/binary-releases.html">Binary Releases</a>
66      <a href="../www/binary-releases.html#unix" class="sub">Unix</a>
67      <a href="../www/binary-releases.html#macosx" class="sub">Mac OS X</a>
68      <a href="../www/binary-releases.html#windows" class="sub">Windows</a>
69      <a href="../www/resources.html">Resources</a>
70  <span>]</span><br /><span>[</span>
71      <a href="../www/download.html">Download</a>
72  <span>]</span><br /><span>[</span>
73      <a href="../www/sitemap.html">Site Map</a>
74                        <a href="../www/links.html" class="sub">Links</a>
75  <span>]</span><br /><span>[</span>
76      <a href="../www/sponsors.html">Sponsors:</a>
77      <fieldset>
78  <a href="http://desktopexchange.com" class="sponsor" target="sponsor">Free Wallpaper</a><!-- 200810010004 -->
79      <br />
80      <a href="http://www.brothersoft.com" class="sponsor" target="sponsor">Software Download</a><!-- 200809010200 -->
81      <br />
82      <a href="http://www.posters555.com" class="sponsor" target="sponsor">Poster</a><!-- 200903010800 -->
83      <br />
84      <a href="http://www.iceposter.com" class="sponsor" target="sponsor">Posters</a><!-- 200812010200 -->
85      <br />
86      <a href="http://meta-preisvergleich.de" class="sponsor" target="sponsor">Preisvergleich</a><!-- 200810010120 -->
87      <br />
88      <a href="http://www.hotel-erb.de"><img src="../images/bw_erb.gif" alt="[Munich Hotel]" width="110" height="40" border="0" name="Munich Hotel"/></a> <!-- 200809010160 -->
89      <br />
90      <a href="http://www.imade-art.de"><img src="../images/imade_art2.jpg" alt="[Kunst bei imade-art]" width="116" height="28" border="0" name="Kunst bei imade-art"/></a> <!-- 200811010160 -->
91      </fieldset>
92      <span>]</span>
93      </font>
94      </td>
95
96      <td id="main" valign="top">
97<p class="navigation-index">[<a href="#usage">Example Usage</a> &bull; <a href="#options">Option Summary</a>]</p>
98
99<p>Use the <kbd>compare</kbd> program to mathematically and visually annotate the difference between an image and its reconstruction.  See <a href="../www/command-line-processing.html">Command Line Processing</a> for advice on how to structure your <kbd>compare</kbd> command or see below for example usages of the command.</p>
100
101<div style="margin: auto;">
102  <h2><a name="usage"></a>Example Usage</h2>
103</div>
104
105<p>We list a few examples of the <kbd>compare</kbd> command here to illustrate its usefulness and ease of use. To get started, lets compare an image to one thats been sharpened:</p>
106
107<pre class="text">
108  convert rose.jpg -sharpen 0x1 reconstruct.jpg
109  compare rose.jpg reconstruct.jpg difference.png
110  compare -compose src rose.jpg reconstruct.jpg difference.png
111</pre>
112
113<p class="image">
114  <a href="../images/rose.jpg"><img src="../images/rose.jpg" width="70" height="46" align="middle" alt="rose" /></a>
115  <a href="../images/reconstruct.jpg"><img src="../images/reconstruct.jpg" width="70" height="46" align="middle" alt="rose" /></a>
116  <img src="../images/right.gif" width="20" height="20" align="middle" alt="==>" />
117  <a href="../images/difference.png"><img src="../images/difference.png" width="70" height="46" align="middle" alt="rose" /></a>
118</p>
119
120<p>The red areas of the difference image emphasizes (highlight) pixels that are affected by the image sharpening, whereas white de-emphasizes (lowlight) pixels that are untouched by the sharpening process.</p>
121
122<p>In addition to the visual interpretation of the difference in an image and its reconstruction, we report a mathematical measure of the difference:</p>
123
124<pre class="text">
125  compare verbose -metric mae rose.jpg reconstruct.jpg difference.png
126  Image: rose.jpg
127    Channel distortion: MAE
128      red: 2282.91 (0.034835)
129      green: 1853.99 (0.0282901)
130      blue: 2008.67 (0.0306503)
131      all: 1536.39 (0.0234439)
132</pre>
133
134<p>Or, if you just want the red channel distortion, use this command:</p>
135
136<pre class="text">
137  compare -channel red -metric PSNR rose.jpg reconstruct.jpg difference.png
138  19.63
139</pre>
140
141<p>Or, if you just want the overall image distortion, use this command:</p>
142
143<pre class="text">
144  compare -metric PSNR rose.jpg reconstruct.jpg difference.png
145  28.31
146</pre>
147
148<p>You can find additional examples of using <kbd>compare</kbd> in <a href="http://www-106.ibm.com/developerworks/library/l-graf/?ca=dnt-428" target="911858237">Graphics from the Command Line</a>.  Further discussion is available in <a href="http://www-106.ibm.com/developerworks/library/l-graf2/?ca=dgr-lnxw15GraphicsLine" target="1615869340">More Graphics from the Command Line</a> and <a href="http://www.imagemagick.org/Usage/" target="206413829">Examples of ImageMagick Usage</a>.</p>
149
150<div style="margin: auto;">
151  <h2><a name="options"></a>Option Summary</h2>
152</div>
153
154<p>The <kbd>compare</kbd> command recognizes these options.  Click on an option to get more details about how that option works.</p>
155
156<table id="table" cellpadding="2" cellspacing="0" style="width: 93%">
157  <tbody>
158  <tr>
159    <th align="left">Option</th>
160    <th align="left">Description</th>
161  </tr>
162
163  <tr>
164    <td valign="top"><a href="../www/command-line-options.html#alpha" target="magick-options">-alpha</a></td>
165    <td valign="top">activate, deactivate, reset, or set the alpha channel</td>
166  </tr>
167
168  <tr>
169    <td valign="top"><a href="../www/command-line-options.html#authenticate" target="magick-options">-authenticate <em class="option">value</em></a></td>
170    <td valign="top">decrypt image with this password</td>
171  </tr>
172
173  <tr>
174    <td valign="top"><a href="../www/command-line-options.html#channel" target="magick-options">-channel <em class="option">type</em></a></td>
175    <td valign="top">apply option to select image channels</td>
176  </tr>
177
178  <tr>
179    <td valign="top"><a href="../www/command-line-options.html#colorspace" target="magick-options">-colorspace <em class="option">type</em></a></td>
180    <td valign="top">set image colorspace</td>
181  </tr>
182
183  <tr>
184    <td valign="top"><a href="../www/command-line-options.html#compose" target="magick-options">-compose <em class="option">operator</em></a></td>
185    <td valign="top">set image composite operator</td>
186  </tr>
187
188  <tr>
189    <td valign="top"><a href="../www/command-line-options.html#decipher" target="magick-options">-decipher <em class="option">filename</em></a></td>
190    <td valign="top">convert cipher pixels to plain</td>
191  </tr>
192
193  <tr>
194    <td valign="top"><a href="../www/command-line-options.html#debug" target="magick-options">-debug <em class="option">events</em></a></td>
195    <td valign="top">display copious debugging information</td>
196  </tr>
197
198  <tr>
199    <td valign="top"><a href="../www/command-line-options.html#define" target="magick-options">-define <em class="option">format:option</em></a></td>
200    <td valign="top">define one or more image format options</td>
201  </tr>
202
203  <tr>
204    <td valign="top"><a href="../www/command-line-options.html#density" target="magick-options">-density <em class="option">geometry</em></a></td>
205    <td valign="top">horizontal and vertical density of the image</td>
206  </tr>
207
208  <tr>
209    <td valign="top"><a href="../www/command-line-options.html#depth" target="magick-options">-depth <em class="option">value</em></a></td>
210    <td valign="top">image depth</td>
211  </tr>
212
213  <tr>
214    <td valign="top"><a href="../www/command-line-options.html#encipher" target="magick-options">-encipher <em class="option">filename</em></a></td>
215    <td valign="top">convert plain pixels to cipher pixels</td>
216  </tr>
217
218  <tr>
219    <td valign="top"><a href="../www/command-line-options.html#extract" target="magick-options">-extract <em class="option">geometry</em></a></td>
220    <td valign="top">extract area from image</td>
221  </tr>
222
223  <tr>
224    <td valign="top"><a href="../www/command-line-options.html#fuzz" target="magick-options">-fuzz <em class="option">distance</em></a></td>
225    <td valign="top">colors within this distance are considered equal</td>
226  </tr>
227
228  <tr>
229  <tr>
230    <td valign="top"><a href="../www/command-line-options.html#help" target="magick-options">-help</a></td>
231    <td valign="top">print program options</td>
232  </tr>
233
234  <tr>
235    <td valign="top"><a href="../www/command-line-options.html#highlight-color" target="magick-options">-highlight-color <em class="option">color</em></a></td>
236    <td valign="top">emphasize pixel differences with this color</td>
237  </tr>
238
239  <tr>
240    <td valign="top"><a href="../www/command-line-options.html#identify" target="magick-options">-identify</a></td>
241    <td valign="top">identify the format and characteristics of the image</td>
242  </tr>
243
244  <tr>
245    <td valign="top"><a href="../www/command-line-options.html#interlace" target="magick-options">-interlace <em class="option">type</em></a></td>
246    <td valign="top">type of image interlacing scheme</td>
247  </tr>
248
249  <tr>
250    <td valign="top"><a href="../www/command-line-options.html#limit" target="magick-options">-limit <em class="option">type value</em></a></td>
251    <td valign="top">pixel cache resource limit</td>
252  </tr>
253
254  <tr>
255    <td valign="top"><a href="../www/command-line-options.html#log" target="magick-options">-log <em class="option">format</em></a></td>
256    <td valign="top">format of debugging information</td>
257  </tr>
258
259  <tr>
260    <td valign="top"><a href="../www/command-line-options.html#lowlight-color" target="magick-options">-lowlight-color <em class="option">color</em></a></td>
261    <td valign="top">de-emphasize pixel differences with this color</td>
262  </tr>
263
264  <tr>
265    <td valign="top"><a href="../www/command-line-options.html#metric" target="magick-options">-metric <em class="option">type</em></a></td>
266    <td valign="top">measure differences between images with this metric</td>
267  </tr>
268
269  <tr>
270    <td valign="top"><a href="../www/command-line-options.html#profile" target="magick-options">-profile <em class="option">filename</em></a></td>
271    <td valign="top">add, delete, or apply an image profile</td>
272  </tr>
273
274  <tr>
275    <td valign="top"><a href="../www/command-line-options.html#quality" target="magick-options">-quality <em class="option">value</em></a></td>
276    <td valign="top">JPEG/MIFF/PNG compression level</td>
277  </tr>
278
279  <tr>
280    <td valign="top"><a href="../www/command-line-options.html#quantize" target="magick-options">-quantize <em class="option">colorspace</em></a></td>
281    <td valign="top">reduce image colors in this colorspace</td>
282  </tr>
283
284  <tr>
285    <td valign="top"><a href="../www/command-line-options.html#quiet" target="magick-options">-quiet</a></td>
286    <td valign="top">suppress all warning messages</td>
287  </tr>
288
289  <tr>
290    <td valign="top"><a href="../www/command-line-options.html#regard-warnings" target="magick-options">-regard-warnings</a></td>
291    <td valign="top">pay attention to warning messages.</td>
292  </tr>
293
294  <tr>
295    <td valign="top"><a href="../www/command-line-options.html#respect-parenthesis" target="magick-options">-respect-parenthesis</a></td>
296    <td valign="top">settings remain in effect until parenthesis boundary.</td>
297  </tr>
298
299  <tr>
300    <td valign="top"><a href="../www/command-line-options.html#sampling-factor" target="magick-options">-sampling-factor <em class="option">geometry</em></a></td>
301    <td valign="top">horizontal and vertical sampling factor</td>
302  </tr>
303
304  <tr>
305    <td valign="top"><a href="../www/command-line-options.html#seed" target="magick-options">-seed <em class="option">value</em></a></td>
306    <td valign="top">seed a new sequence of pseudo-random numbers</td>
307  </tr>
308
309  <tr>
310    <td valign="top"><a href="../www/command-line-options.html#set" target="magick-options">-set <em class="option">attribute value</em></a></td>
311    <td valign="top">set an image attribute</td>
312  </tr>
313
314  <tr>
315    <td valign="top"><a href="../www/command-line-options.html#size" target="magick-options">-size <em class="option">geometry</em></a></td>
316    <td valign="top">width and height of image</td>
317  </tr>
318
319  <tr>
320    <td valign="top"><a href="../www/command-line-options.html#transparent-color" target="magick-options">-transparent-color <em class="option">color</em></a></td>
321    <td valign="top">transparent color</td>
322  </tr>
323
324  <tr>
325    <td valign="top"><a href="../www/command-line-options.html#verbose" target="magick-options">-verbose</a></td>
326    <td valign="top">print detailed information about the image</td>
327  </tr>
328
329  <tr>
330    <td valign="top"><a href="../www/command-line-options.html#version" target="magick-options">-version</a></td>
331    <td valign="top">print version information</td>
332  </tr>
333
334  <tr>
335    <td valign="top"><a href="../www/command-line-options.html#virtual-pixel" target="magick-options">-virtual-pixel <em class="option">method</em></a></td>
336    <td valign="top">access method for pixels outside the boundaries of the image</td>
337  </tr>
338
339  </tbody>
340</table>
341      </td>
342      <td id="margin" width="1%" height="100%" valign="top" align="right">&nbsp;</td>
343    </tr>
344  </tbody>
345  </table>
346  <div id="linkbar">
347    <span id="linkbar-west">
348      <font size="-1">
349      <a href="http://www.downloadroute.com/" target="481914491">Downloads and Opinions</a><!-- 200810010100 -->
350      </font>
351    </span>
352    <span id="linkbar-center">
353      <a href="http://www.imagemagick.org/discourse-server/" target="642971446">Discourse Server</a> &bull;
354      <a href="../www/mailing-list.html">Mailing Lists</a> &bull;
355      <a href="http://cafe.imagemagick.org" target="104438127">Cafe</a> &bull;
356    <a href="http://studio.webbyland.com/ImageMagick/MagickStudio/scripts/MagickStudio.cgi" target="395472988">Studio</a>
357    </span>
358  </div>
359  <div id="footer">
360    <span id="footer-west">&copy; 1999-2008 ImageMagick Studio LLC</span>
361  </div>
362  <div style="clear: both; margin: 0; width: 100%; "></div>
363</body>
364</html>
Note: See TracBrowser for help on using the browser.