• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2
3
4
5<!DOCTYPE html>
6<html lang="en">
7<head>
8  <meta charset="utf-8"  />
9  <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,shrink-to-fit=no"  />
10  <title>Command-line Tools: Identify @ ImageMagick</title>
11  <meta name="application-name" content="ImageMagick" />
12  <meta name="description" content="Use ImageMagick® to create, edit, compose, or convert bitmap images. You can resize your image, crop it, change its shades and colors, add captions, among other operations." />
13  <meta name="application-url" content="https://imagemagick.org" />
14  <meta name="generator" content="PHP" />
15  <meta name="keywords" content="command-line, tools:, identify, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert" />
16  <meta name="rating" content="GENERAL" />
17  <meta name="robots" content="INDEX, FOLLOW" />
18  <meta name="generator" content="ImageMagick Studio LLC" />
19  <meta name="author" content="ImageMagick Studio LLC" />
20  <meta name="revisit-after" content="2 DAYS" />
21  <meta name="resource-type" content="document" />
22  <meta name="copyright" content="Copyright (c) 1999-2019 ImageMagick Studio LLC" />
23  <meta name="distribution" content="Global" />
24  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" />
25  <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
26  <link href="identify.html" rel="canonical" />
27  <link href="../images/wand.png" rel="icon" />
28  <link href="../images/wand.ico" rel="shortcut icon" />
29  <link href="assets/magick.css" rel="stylesheet" />
30</head>
31<body>
32  <header>
33  <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
34    <a class="navbar-brand" href="../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../images/wand.ico"/></a>
35    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsMagick" aria-controls="navbarsMagick" aria-expanded="false" aria-label="Toggle navigation">
36      <span class="navbar-toggler-icon"></span>
37    </button>
38
39    <div class="navbar-collapse collapse" id="navbarsMagick" style="">
40    <ul class="navbar-nav mr-auto">
41      <li class="nav-item ">
42        <a class="nav-link" href="api/quantize.html">Home <span class="sr-only">(current)</span></a>
43      </li>
44      <li class="nav-item ">
45        <a class="nav-link" href="../www/download.html">Download</a>
46      </li>
47      <li class="nav-item ">
48        <a class="nav-link" href="../www/command-line-tools.html">Tools</a>
49      </li>
50      <li class="nav-item ">
51        <a class="nav-link" href="../www/command-line-processing.html">Command-line</a>
52      </li>
53      <li class="nav-item ">
54        <a class="nav-link" href="../www/resources.html">Resources</a>
55      </li>
56      <li class="nav-item ">
57        <a class="nav-link" href="../www/develop.html">Develop</a>
58      </li>
59      <li class="nav-item">
60        <a class="nav-link" target="_blank" href="https://imagemagick.org/discourse-server/">Community</a>
61      </li>
62    </ul>
63    <form class="form-inline my-2 my-lg-0" action="https://imagemagick.org/script/search.php">
64      <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search">
65      <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button>
66    </form>
67    </div>
68  </nav>
69  <div class="container">
70   <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
71         style="display:block"
72         data-ad-client="ca-pub-3129977114552745"
73         data-ad-slot="6345125851"
74         data-ad-format="auto"></ins>
75    <script>
76      (adsbygoogle = window.adsbygoogle || []).push({});
77    </script>
78
79  </div>
80  </header>
81  <main class="container">
82    <div class="magick-template">
83<div class="magick-header">
84<p class="text-center"><a href="identify.html#usage">Example Usage</a> • <a href="identify.html#options">Option Summary</a></p>
85
86<p class="lead magick-description">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="../www/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>
87
88<h2><a class="anchor" id="usage"></a>Example Usage</h2>
89
90<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>
91
92<pre class="highlight"><code>-> magick identify rose.jpg
93rose.jpg JPEG 70x46 70x46+0+0 8-bit sRGB 2.36KB 0.000u 0:00.000
94</code></pre>
95
96<p>Next, we look at the same image in greater detail:</p>
97
98<pre class="pre-scrollable"><code>-> magick identify -verbose rose.jpg
99Image: rose.jpg
100  Format: JPEG (Joint Photographic Experts Group JFIF format)
101  Mime type: images/jpeg
102  Class: DirectClass
103  Geometry: 70x46+0+0
104  Units: Undefined
105  Type: TrueColor
106  Endianess: Undefined
107  Colorspace: sRGB
108  Depth: 8-bit
109  Channel depth:
110    Red: 8-bit
111    Green: 8-bit
112    Blue: 8-bit
113  Channel statistics:
114    Pixels: 3220
115    Red:
116      min: 31 (0.121569)
117      max: 255 (1)
118      mean: 145.557 (0.570814)
119      standard deviation: 69.1933 (0.271346)
120      kurtosis: -1.38945
121      skewness: 0.138955
122      entropy: 0.970683
123    Green:
124      min: 27 (0.105882)
125      max: 255 (1)
126      mean: 89.246 (0.349984)
127      standard deviation: 52.4608 (0.205729)
128      kurtosis: 2.60139
129      skewness: 1.80708
130      entropy: 0.869711
131    Blue:
132      min: 21 (0.0823529)
133      max: 255 (1)
134      mean: 80.4196 (0.315371)
135      standard deviation: 54.9377 (0.215442)
136      kurtosis: 2.93417
137      skewness: 1.95544
138      entropy: 0.853176
139  Image statistics:
140    Overall:
141      min: 21 (0.0823529)
142      max: 255 (1)
143      mean: 105.074 (0.412056)
144      standard deviation: 58.8639 (0.230839)
145      kurtosis: 1.37788
146      skewness: 1.48073
147      entropy: 0.897856
148  Rendering intent: Perceptual
149  Gamma: 0.454545
150  Chromaticity:
151    red primary: (0.64,0.33)
152    green primary: (0.3,0.6)
153    blue primary: (0.15,0.06)
154    white point: (0.3127,0.329)
155  Alpha color: grey74
156  Background color: white
157  Border color: srgb(223,223,223)
158  Transparent color: none
159  Interlace: None
160  Intensity: Undefined
161  Compose: Over
162  Page geometry: 70x46+0+0
163  Dispose: Undefined
164  Iterations: 0
165  Compression: JPEG
166  Quality: 92
167  Orientation: Undefined
168  Properties:
169    jpeg:colorspace: 2
170    jpeg:sampling-factor: 1x1,1x1,1x1
171    signature: aea65c9b557d779d142f26d04abe7008bab50f1e9647faae20afdcc6c15140d5
172  Artifacts:
173    verbose: true
174  Tainted: False
175  Filesize: 2.65KB
176  Number pixels: 3.22K
177  User time: 0.000u
178  Elapsed time: 0:01.000
179  Version: ImageMagick 7.0.4-8 Q16 x86_64 http://imagemagick.org
180</code></pre>
181
182<p>To get the print size in inches of an image at 72 DPI, use:</p>
183
184<pre class="highlight"><code>-> magick identify -format "%[fx:w/72] by %[fx:h/72] inches" document.png
1858.5 x 11 inches
186</code></pre>
187
188<p>The depth and dimensions of a raw image must be specified on the command line:</p>
189
190<pre class="highlight"><code>-> magick identify -depth 8 -size 640x480 image.raw
191image.raw RGB 640x480 sRGB 9kb 0.000u 0:01
192</code></pre>
193
194<p>Here we display the image texture features, moments, perceptual hash, and the number of unique colors in the image:</p>
195
196<pre class="highlight"><code>-> magick identify -verbose -features 1 -moments -unique image.png
197</code></pre>
198
199<p>Here is a special define that outputs the location of the minimum or maximum pixel of the image:</p>
200
201<pre class="highlight"><code>magick identify -precision 5 -define identify:locate=maximum -define identify:limit=3 image.png
202</code></pre>
203
204<p>You can find additional examples of using <code>identify</code> in <a href="../Usage/">Examples of ImageMagick Usage</a>.</p>
205
206<h2><a class="anchor" id="options"></a>Option Summary</h2>
207
208<p>The <code>identify</code> command recognizes these options.  Click on an option to get more details about how that option works.</p>
209
210<table class="table table-sm table-striped">
211  <tbody>
212  <tr>
213    <th align="left">Option</th>
214    <th align="left">Description</th>
215  </tr>
216
217  <tr>
218    <td><a href="../www/command-line-options.html#alpha">-alpha</a></td>
219    <td>on, activate, off, deactivate, set, opaque, copy",
220transparent, extract, background, or shape the alpha channel</td>
221  </tr>
222
223  <tr>
224    <td><a href="../www/command-line-options.html#antialias">-antialias</a></td>
225    <td>remove pixel-aliasing</td>
226  </tr>
227
228  <tr>
229    <td><a href="../www/command-line-options.html#authenticate">-authenticate <var>value</var></a></td>
230    <td>decrypt image with this password</td>
231  </tr>
232
233  <tr>
234    <td><a href="../www/command-line-options.html#channel">-channel <var>type</var></a></td>
235    <td>apply option to select image channels</td>
236  </tr>
237
238  <tr>
239    <td><a href="../www/command-line-options.html#clip">-clip</a></td>
240    <td>clip along the first path from the 8BIM profile</td>
241  </tr>
242
243  <tr>
244    <td><a href="../www/command-line-options.html#clip-mask">-clip-mask</a> <var>filename</var></td>
245    <td>associate clip mask with the image</td>
246  </tr>
247
248  <tr>
249    <td><a href="../www/command-line-options.html#clip-path">-clip-path <var>id</var></a></td>
250    <td>clip along a named path from the 8BIM profile</td>
251  </tr>
252
253  <tr>
254    <td><a href="../www/command-line-options.html#colorspace">-colorspace <var>type</var></a></td>
255    <td>set image colorspace</td>
256  </tr>
257
258  <tr>
259    <td><a href="../www/command-line-options.html#crop">-crop <var>geometry</var></a></td>
260    <td>crop the image</td>
261  </tr>
262
263  <tr>
264    <td><a href="../www/command-line-options.html#debug">-debug <var>events</var></a></td>
265    <td>display copious debugging information</td>
266  </tr>
267
268  <tr>
269    <td><a href="../www/command-line-options.html#define">-define <var>format:option</var></a></td>
270    <td>define one or more image format options</td>
271  </tr>
272
273  <tr>
274    <td><a href="../www/command-line-options.html#density">-density <var>geometry</var></a></td>
275    <td>horizontal and vertical density of the image</td>
276  </tr>
277
278  <tr>
279    <td><a href="../www/command-line-options.html#depth">-depth <var>value</var></a></td>
280    <td>image depth</td>
281  </tr>
282
283  <tr>
284    <td><a href="../www/command-line-options.html#endian">-endian <var>type</var></a></td>
285    <td>endianness (MSB or LSB) of the image</td>
286  </tr>
287
288  <tr>
289    <td><a href="../www/command-line-options.html#extract">-extract <var>geometry</var></a></td>
290    <td>extract area from image</td>
291  </tr>
292
293  <tr>
294    <td><a href="../www/command-line-options.html#features">-features <var>distance</var></a></td>
295    <td>analyze image features (e.g. contract, correlations, etc.).</td>
296  </tr>
297
298  <tr>
299    <td><a href="../www/command-line-options.html#format_identify_">-format <var>string</var></a></td>
300    <td>output formatted image characteristics</td>
301  </tr>
302
303  <tr>
304    <td><a href="../www/command-line-options.html#gamma">-gamma <var>value</var></a></td>
305    <td>level of gamma correction</td>
306  </tr>
307
308  <tr>
309    <td><a href="../www/command-line-options.html#grayscale">-grayscale <var>method</var></a></td>
310    <td>convert image to grayscale</td>
311  </tr>
312
313  <tr>
314    <td><a href="../www/command-line-options.html#help">-help</a></td>
315    <td>print program options</td>
316  </tr>
317
318  <tr>
319    <td><a href="../www/command-line-options.html#interlace">-interlace <var>type</var></a></td>
320    <td>type of image interlacing scheme</td>
321  </tr>
322
323  <tr>
324    <td><a href="../www/command-line-options.html#interpolate">-interpolate <var>method</var></a></td>
325    <td>pixel color interpolation method</td>
326  </tr>
327
328  <tr>
329    <td><a href="../www/command-line-options.html#limit">-limit <var>type value</var></a></td>
330    <td>pixel cache resource limit</td>
331  </tr>
332
333  <tr>
334    <td><a href="../www/command-line-options.html#list">-list <var>type</var></a></td>
335    <td>Color, Configure, Delegate, Format, Magic, Module, Resource, or Type</td>
336  </tr>
337
338  <tr>
339    <td><a href="../www/command-line-options.html#log">-log <var>format</var></a></td>
340    <td>format of debugging information</td>
341  </tr>
342
343  <tr>
344    <td><a href="../www/command-line-options.html#mask">-mask <var>filename</var></a></td>
345    <td>associate a mask with the image</td>
346  </tr>
347
348  <tr>
349    <td><a href="../www/command-line-options.html#moments">-moments</a></td>
350    <td>display image moments and perceptual hash.</td>
351  </tr>
352
353  <tr>
354    <td><a href="../www/command-line-options.html#monitor">-monitor</a></td>
355    <td>monitor progress</td>
356  </tr>
357
358  <tr>
359    <td><a href="../www/command-line-options.html#negate">-negate</a></td>
360    <td>replace each pixel with its complementary color </td>
361  </tr>
362
363  <tr>
364    <td><a href="../www/command-line-options.html#precision">-precision <var>value</var></a></td>
365    <td>set the maximum number of significant digits to be printed</td>
366  </tr>
367
368  <tr>
369    <td><a href="../www/command-line-options.html#quiet">-quiet</a></td>
370    <td>suppress all warning messages</td>
371  </tr>
372
373  <tr>
374    <td><a href="../www/command-line-options.html#regard-warnings">-regard-warnings</a></td>
375    <td>pay attention to warning messages.</td>
376  </tr>
377
378  <tr>
379    <td><a href="../www/command-line-options.html#respect-parentheses">-respect-parentheses</a></td>
380    <td>settings remain in effect until parenthesis boundary.</td>
381  </tr>
382
383  <tr>
384    <td><a href="../www/command-line-options.html#sampling-factor">-sampling-factor <var>geometry</var></a></td>
385    <td>horizontal and vertical sampling factor</td>
386  </tr>
387
388  <tr>
389    <td><a href="../www/command-line-options.html#set">-set <var>attribute value</var></a></td>
390    <td>set an image attribute</td>
391  </tr>
392
393  <tr>
394    <td><a href="../www/command-line-options.html#size">-size <var>geometry</var></a></td>
395    <td>width and height of image</td>
396  </tr>
397
398  <tr>
399    <td><a href="../www/command-line-options.html#strip">-strip</a></td>
400    <td>strip image of all profiles and comments</td>
401  </tr>
402
403  <tr>
404    <td><a href="../www/command-line-options.html#unique">-unique</a></td>
405    <td>display image the number of unique colors in the image.</td>
406  </tr>
407
408  <tr>
409    <td><a href="../www/command-line-options.html#units">-units <var>type</var></a></td>
410    <td>the units of image resolution</td>
411  </tr>
412
413  <tr>
414    <td><a href="../www/command-line-options.html#verbose">-verbose</a></td>
415    <td>print detailed information about the image</td>
416  </tr>
417
418  <tr>
419    <td><a href="../www/command-line-options.html#version">-version</a></td>
420    <td>print version information</td>
421  </tr>
422
423  <tr>
424    <td><a href="../www/command-line-options.html#virtual-pixel">-virtual-pixel <var>method</var></a></td>
425    <td>access method for pixels outside the boundaries of the image</td>
426  </tr>
427
428  </tbody>
429</table>
430
431</div>
432    </div>
433  </main><!-- /.container -->
434  <footer class="magick-footer">
435    <p><a href="../www/security-policy.html">Security</a> •
436    <a href="../www/architecture.html">Architecture</a> •
437    <a href="../www/links.html">Related</a> •
438     <a href="../www/sitemap.html">Sitemap</a>
439
440    <a href="identify.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../images/wand.ico"/></a>
441
442    <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
443    <a href="../www/support.html">Donate</a> •
444    <a href="../www/https://imagemagick.org/script/contact.php">Contact Us</a>
445    <br/>
446    <small>© 1999-2019 ImageMagick Studio LLC</small></p>
447  </footer>
448
449  <!-- Javascript assets -->
450  <script src="assets/magick.js" crossorigin="anonymous"></script>
451  <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.3.1/jquery.min.js"><\/script>')</script>
452</body>
453</html>
454