1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="-//W3C//DTD XHTML 1.1//EN" xml:lang="en" xsi:schemaLocation="http://www.w3.org/1999/xhtml http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
4 <meta http-equiv="content-type" content="text/html; charset=UTF-8"></meta>
5 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4"></meta>
6 <title>ImageMagick: Command-line Tools: Identify</title>
7 <meta http-equiv="content-language" content="en-US"></meta>
8 <meta http-equiv="content-type" content="text/html; charset=utf-8"></meta>
9 <meta http-equiv="reply-to" content="magick-users@imagemagick.org"></meta>
10 <meta name="application-name" content="ImageMagick"></meta>
11 <meta name="description" content="Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats. In addition, resize, rotate, shear, distort or transform images automagically."></meta>
12 <meta name="application-url" content="http://www.imagemagick.org"></meta>
13 <meta name="generator" content="PHP"></meta>
14 <meta name="keywords" content="command-line, tools:, identify, ImageMagick, PerlMagick, image processing, OpenMP, software development library, image, photo, software, Magick++, MagickWand"></meta>
15 <meta name="rating" content="GENERAL"></meta>
16 <meta name="robots" content="INDEX, FOLLOW"></meta>
17 <meta name="generator" content="ImageMagick Studio LLC"></meta>
18 <meta name="author" content="ImageMagick Studio LLC"></meta>
19 <meta name="revisit-after" content="2 DAYS"></meta>
20 <meta name="resource-type" content="document"></meta>
21 <meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC"></meta>
22 <meta name="distribution" content="Global"></meta>
23 <link rel="icon" href="../images/wand.png"></link>
24 <link rel="shortcut icon" href="../images/wand.ico" type="images/x-icon"></link>
25 <link rel="canonical" href="http://www.imagemagick.org"></link>
26 <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"></link>
28 <!-- Add jQuery library -->
29 <script type="text/javascript" src="http://localhost/ajax/libs/jquery/1.7/jquery.min.js"></script>
31 <!-- Add mousewheel plugin (this is optional) -->
32 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
35 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/jquery.fancybox.css?v=2.0.6" type="text/css" media="screen"></link>
36 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/jquery.fancybox.pack.js?v=2.0.6"></script>
38 <!-- Optionally add helpers - button, thumbnail and/or media -->
39 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.2" type="text/css" media="screen"></link>
40 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.2"></script>
41 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.0"></script>
43 <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=2.0.6" type="text/css" media="screen"></link>
44 <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=2.0.6"></script>
46 <script type="text/javascript">
47 $(document).ready(function() {
48 $(".fancybox").fancybox();
52 <!-- ImageMagick style -->
53 <style type="text/css" media="all">
54 @import url("../www/magick.css");
58 <body id="www-imagemagick-org">
62 <div class="titlebar">
63 <div style="margin: 17px auto; float: left;">
64 <script type="text/javascript">
66 google_ad_client = "pub-3129977114552745";
67 google_ad_slot = "5439289906";
68 google_ad_width = 728;
69 google_ad_height = 90;
74 <a href="../discourse-server">
75 <img src="../images/logo.jpg" alt="ImageMagick Logo" style="width: 123px; height: 118px; border: 0px; float: right;"></img></a>
76 <a href="http://www.imagemagick.org/ImageMagick-7.0.0/index.html">
77 <img src="../images/sprite.jpg" alt="ImageMagick Sprite" style="width: 114px; height: 118px; border: 0px; float: right;"></img></a>
83 <a title="About ImageMagick" href="http://www.imagemagick.org/ImageMagick-7.0.0/index.html">About ImageMagick</a>
86 <a title="Binary Releases" href="binary-releases.html">Binary Releases</a>
89 <a title="Binary Release: Unix" href="binary-releases.html#unix">Unix</a>
92 <a title="Binary Release: MacOS X" href="binary-releases.html#macosx">Mac OS X</a>
95 <a title="Binary Release: iOS" href="binary-releases.html#iOS">iOS</a>
98 <a title="Binary Release: Windows" href="binary-releases.html#windows">Windows</a>
100 <div class="sep"></div>
102 <a title="Command-line Tools" href="command-line-tools.html">Command-line Tools</a>
105 <a title="Command-line Tools: Processing" href="command-line-processing.html">Processing</a>
108 <a title="Command-line Tools: Options" href="command-line-options.html">Options</a>
111 <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
114 <a title="Program Interfaces" href="api.html">Program Interfaces</a>
117 <a title="Program Interface: MagickWand" href="magick-wand.html">MagickWand</a>
120 <a title="Program Interface: MagickCore" href="magick-core.html">MagickCore</a>
123 <a title="Program Interface: PerlMagick" href="perl-magick.html">PerlMagick</a>
126 <a title="Program Interface: Magick++" href="magick++.html">Magick++</a>
128 <div class="sep"></div>
130 <a title="Install from Source" href="install-source.html">Install from Source</a>
133 <a title="Install from Source: Unix" href="install-source.html#unix">Unix</a>
136 <a title="Install from Source: Windows" href="install-source.html#windows">Windows</a>
139 <a title="Resources" href="resources.html">Resources</a>
142 <a title="Architecture" href="architecture.html">Architecture</a>
145 <a title="Download" href="download.html">Download</a>
147 <div class="sep"></div>
149 <a title="Search" href="search.html">Search</a>
151 <div class="sep"></div>
153 <a title="Site Map" href="sitemap.html">Site Map</a>
156 <a title="Site Map: Links" href="links.html">Links</a>
158 <div class="sep"></div>
161 <div class="eastbar">
163 <div> <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://www.imagemagick.org/"></a></div>
165 <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
166 <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" width="93" height="20" border="0"></img></a>
176 <h1>ImageMagick Identify Command-line Tool</h1>
177 <p class="navigation-index">[<a href="identify.html#usage">Example Usage</a> • <a href="identify.html#options">Option Summary</a>]</p>
179 <div class="doc-section">
180 <p>The <code>identify</code> program describes the format and characteristics of one or more image files. It also reports if an image is incomplete or corrupt. The information returned includes the image number, the file name, the width and height of the image, whether the image is colormapped or not, the number of colors in the image, the number of bytes in the image, the format of the image (JPEG, PNM, etc.), and finally the number of seconds it took to read and process the image. Many more attributes are available with the verbose option. See <a href="command-line-processing.html">Command Line Processing</a> for advice on how to structure your <code>identify</code> command or see below for example usages of the command.</p>
183 <h2><a id="usage"></a>Example Usage</h2>
184 <div class="doc-section">
186 <p>We list a few examples of the <code>identify</code> command here to illustrate its usefulness and ease of use. To get started, lets identify an image in the JPEG format:</p>
188 <p class="crt"><span class="crtprompt"> $magick> </span><span class="crtin">identify rose.jpg</span><span class="crtout"> rose.jpg JPEG 640x480 sRGB 87kb 0.050u 0:01</span></p>
189 <p>Next, we look at the same image in greater detail:</p>
191 <p class="crt"><span class="crtprompt"> $magick> </span><span class="crtin">identify -verbose rose.jpg</span><span class="crtout">Image: rose.jpg <br></br>
192 Format: JPEG (Joint Photographic Experts Group JFIF format) <br></br>
193 Class: DirectClass <br></br>
194 Geometry: 70x46+0+0 <br></br>
195 Resolution: 72x72 <br></br>
196 Print size: 0.972222x0.638889 <br></br>
197 Units: PixelsPerInch <br></br>
198 Type: TrueColor <br></br>
199 Endianess: Undefined <br></br>
200 Colorspace: RGB <br></br>
201 Depth: 8-bit <br></br>
202 Channel depth: <br></br>
204 green: 8-bit <br></br>
205 blue: 8-bit <br></br>
206 Channel statistics: <br></br>
208 min: 37 (0.145098) <br></br>
209 max: 255 (1) <br></br>
210 mean: 145.58 (0.5709) <br></br>
211 standard deviation: 67.3195 (0.263998) <br></br>
213 min: 31 (0.121569) <br></br>
214 max: 255 (1) <br></br>
215 mean: 89.2512 (0.350005) <br></br>
216 standard deviation: 52.0488 (0.204113) <br></br>
218 min: 17 (0.0666667) <br></br>
219 max: 255 (1) <br></br>
220 mean: 80.4075 (0.315323) <br></br>
221 standard deviation: 54.0052 (0.211785) <br></br>
222 Rendering intent: Undefined <br></br>
223 Interlace: None <br></br>
224 Background color: white <br></br>
225 Border color: rgb(223,223,223) <br></br>
226 Matte color: grey74 <br></br>
227 Transparent color: black <br></br>
228 Page geometry: 70x46+0+0 <br></br>
229 Dispose: Undefined <br></br>
230 Iterations: 0 <br></br>
231 Compression: JPEG <br></br>
232 Quality: 100 <br></br>
233 Orientation: Undefined <br></br>
234 Properties: <br></br>
235 date:create: 2008-01-08T11:08:52-05:00 <br></br>
236 date:modify: 2005-04-07T12:48:13-04:00 <br></br>
237 jpeg:colorspace: 2 <br></br>
238 jpeg:sampling-factor: 2x2,1x1,1x1 <br></br>
239 signature: dcd00d6303f80f4fa53f991804cb026151c1e851b7a96255e82da87299583ebc <br></br>
241 verbose: true <br></br>
242 Tainted: False <br></br>
243 Filesize: 3.97266kb <br></br>
244 Number pixels: 3.14453kb <br></br>
245 Version: ImageMagick 7.0.0-0 2013-07-15 Q16 http://www.imagemagick.org</span></p>
246 <p>To get the print size in inches of an image at 72 DPI, use:</p>
248 <p class="crt"><span class="crtprompt"> $magick> </span><span class="crtin">identify -format "%[fx:w/72] by %[fx:h/72] inches" document.png</span><span class="crtout">8.5 x 11 inches</span></p>
249 <p>The depth and dimensions of a raw image must be specified on the command line:</p>
251 <p class="crt"><span class="crtprompt"> $magick> </span><span class="crtin">identify -depth 8 -size 640x480 image.raw</span><span class="crtout">image.raw RGB 640x480 sRGB 9kb 0.000u 0:01</span></p>
252 <p>Here we display the image texture features, image moments, and the number of unique colors in the image:</p>
254 <p class="crt"><span class="crtprompt"> $magick> </span><span class="crtin">identify -verbose -features 1 -moments -unique image.png</span></p>
255 <p>Here is a special define that outputs the location of the minimum or maximum pixel of the image:</p>
257 <p class="crt"><span class="crtprompt"> $magick> </span><span class="crtin">identify -precision 5 -define identify:locate=maximum -define identify:limit=3 image.png</span></p>
258 <p>You can find additional examples of using <code>identify</code> in <a href="http://www.imagemagick.org/Usage/">Examples of ImageMagick Usage</a>.</p>
262 <h2><a id="options"></a>Option Summary</h2>
263 <div class="doc-section">
265 <p>The <code>identify</code> command recognizes these options. Click on an option to get more details about how that option works.</p>
270 <th align="left">Option</th>
271 <th align="left">Description</th>
275 <td valign="top"><a href="command-line-options.html#alpha">-alpha</a></td>
276 <td valign="top">on, activate, off, deactivate, set, opaque, copy",
277 transparent, extract, background, or shape the alpha channel</td>
281 <td valign="top"><a href="command-line-options.html#antialias">-antialias</a></td>
282 <td valign="top">remove pixel-aliasing</td>
286 <td valign="top"><a href="command-line-options.html#authenticate">-authenticate <em class="option">value</em></a></td>
287 <td valign="top">decrypt image with this password</td>
291 <td valign="top"><a href="command-line-options.html#channel">-channel <em class="option">type</em></a></td>
292 <td valign="top">apply option to select image channels</td>
296 <td valign="top"><a href="command-line-options.html#clip">-clip</a></td>
297 <td valign="top">clip along the first path from the 8BIM profile</td>
301 <td valign="top"><a href="command-line-options.html#clip-mask">-clip-mask</a> <em class="option">filename</em></td>
302 <td valign="top">associate clip mask with the image</td>
306 <td valign="top"><a href="command-line-options.html#clip-path">-clip-path <em class="option">id</em></a></td>
307 <td valign="top">clip along a named path from the 8BIM profile</td>
311 <td valign="top"><a href="command-line-options.html#colorspace">-colorspace <em class="option">type</em></a></td>
312 <td valign="top">set image colorspace</td>
316 <td valign="top"><a href="command-line-options.html#crop">-crop <em class="option">geometry</em></a></td>
317 <td valign="top">crop the image</td>
321 <td valign="top"><a href="command-line-options.html#debug">-debug <em class="option">events</em></a></td>
322 <td valign="top">display copious debugging information</td>
326 <td valign="top"><a href="command-line-options.html#define">-define <em class="option">format:option</em></a></td>
327 <td valign="top">define one or more image format options</td>
331 <td valign="top"><a href="command-line-options.html#density">-density <em class="option">geometry</em></a></td>
332 <td valign="top">horizontal and vertical density of the image</td>
336 <td valign="top"><a href="command-line-options.html#depth">-depth <em class="option">value</em></a></td>
337 <td valign="top">image depth</td>
341 <td valign="top"><a href="command-line-options.html#endian">-endian <em class="option">type</em></a></td>
342 <td valign="top">endianness (MSB or LSB) of the image</td>
346 <td valign="top"><a href="command-line-options.html#extract">-extract <em class="option">geometry</em></a></td>
347 <td valign="top">extract area from image</td>
351 <td valign="top"><a href="command-line-options.html#features">-features <em class="option">distance</em></a></td>
352 <td valign="top">analyze image features (e.g. contract, correlations, etc.).</td>
356 <td valign="top"><a href="command-line-options.html#format_identify_">-format <em class="option">string</em></a></td>
357 <td valign="top">output formatted image characteristics</td>
361 <td valign="top"><a href="command-line-options.html#gamma">-gamma <em class="option">value</em></a></td>
362 <td valign="top">level of gamma correction</td>
366 <td valign="top"><a href="command-line-options.html#intensity">-grayscale <em class="option">method</em></a></td>
367 <td valign="top">convert image to grayscale</td>
371 <td valign="top"><a href="command-line-options.html#help">-help</a></td>
372 <td valign="top">print program options</td>
376 <td valign="top"><a href="command-line-options.html#interlace">-interlace <em class="option">type</em></a></td>
377 <td valign="top">type of image interlacing scheme</td>
381 <td valign="top"><a href="command-line-options.html#interpolate">-interpolate <em class="option">method</em></a></td>
382 <td valign="top">pixel color interpolation method</td>
386 <td valign="top"><a href="command-line-options.html#limit">-limit <em class="option">type value</em></a></td>
387 <td valign="top">pixel cache resource limit</td>
391 <td valign="top"><a href="command-line-options.html#list">-list <em class="option">type</em></a></td>
392 <td valign="top">Color, Configure, Delegate, Format, Magic, Module, Resource, or Type</td>
396 <td valign="top"><a href="command-line-options.html#log">-log <em class="option">format</em></a></td>
397 <td valign="top">format of debugging information</td>
401 <td valign="top"><a href="command-line-options.html#mask">-mask <em class="option">filename</em></a></td>
402 <td valign="top">associate a mask with the image</td>
406 <td valign="top"><a href="command-line-options.html#moments">-moments</a></td>
407 <td valign="top">display image moments.</td>
411 <td valign="top"><a href="command-line-options.html#monitor">-monitor</a></td>
412 <td valign="top">monitor progress</td>
416 <td valign="top"><a href="command-line-options.html#negate">-negate</a></td>
417 <td valign="top">replace each pixel with its complementary color </td>
421 <td valign="top"><a href="command-line-options.html#precision">-precision <em class="option">value</em></a></td>
422 <td valign="top">set the maximum number of significant digits to be printed</td>
426 <td valign="top"><a href="command-line-options.html#quiet">-quiet</a></td>
427 <td valign="top">suppress all warning messages</td>
431 <td valign="top"><a href="command-line-options.html#regard-warnings">-regard-warnings</a></td>
432 <td valign="top">pay attention to warning messages.</td>
436 <td valign="top"><a href="command-line-options.html#respect-parentheses">-respect-parentheses</a></td>
437 <td valign="top">settings remain in effect until parenthesis boundary.</td>
441 <td valign="top"><a href="command-line-options.html#sampling-factor">-sampling-factor <em class="option">geometry</em></a></td>
442 <td valign="top">horizontal and vertical sampling factor</td>
446 <td valign="top"><a href="command-line-options.html#set">-set <em class="option">attribute value</em></a></td>
447 <td valign="top">set an image attribute</td>
451 <td valign="top"><a href="command-line-options.html#size">-size <em class="option">geometry</em></a></td>
452 <td valign="top">width and height of image</td>
456 <td valign="top"><a href="command-line-options.html#strip">-strip</a></td>
457 <td valign="top">strip image of all profiles and comments</td>
461 <td valign="top"><a href="command-line-options.html#unique">-unique</a></td>
462 <td valign="top">display image the number of unique colors in the image.</td>
466 <td valign="top"><a href="command-line-options.html#units">-units <em class="option">type</em></a></td>
467 <td valign="top">the units of image resolution</td>
471 <td valign="top"><a href="command-line-options.html#verbose">-verbose</a></td>
472 <td valign="top">print detailed information about the image</td>
476 <td valign="top"><a href="command-line-options.html#version">-version</a></td>
477 <td valign="top">print version information</td>
481 <td valign="top"><a href="command-line-options.html#virtual-pixel">-virtual-pixel <em class="option">method</em></a></td>
482 <td valign="top">access method for pixels outside the boundaries of the image</td>
493 <span id="linkbar-west"> </span>
495 <span id="linkbar-center">
496 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> •
497 <a href="../discourse-server">Discourse Server</a> •
498 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a> •
499 <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
501 <span id="linkbar-east"> </span>
504 <span id="footer-west">© 1999-2013 ImageMagick Studio LLC</span>
505 <span id="footer-east"> <a href="contact.html">Contact the Wizards</a></span>
507 <div style="clear: both; margin: 0; width: 100%; "></div>