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, initial-scale=1" /> 10 <title>ImageMagick - Command-line Tools: Identify</title> 11 <meta name="application-name" content="ImageMagick" /> 12 <meta name="description" content="Use ImageMagick® to create, edit, compose, and convert digital images. Resize an image, crop it, change its shades and colors, add captions, and more." /> 13 <meta name="application-url" content="https://imagemagick.org" /> 14 <meta name="generator" content="PHP" /> 15 <meta name="keywords" content="command-line, tools:, identify, image processing software" /> 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-2020 ImageMagick Studio LLC" /> 23 <meta name="distribution" content="Global" /> 24 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" /> 25 <meta property='og:url' content='../' /> 26 <meta property='og:title' content='ImageMagick' /> 27 <meta property='og:image' content='../images/logo.png' /> 28 <meta property='og:type' content='website' /> 29 <meta property='og:site_name' content='ImageMagick' /> 30 <meta property='og:description' content="Create, Edit, Compose, or Convert Digital Images" /> 31 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" /> 32 <link href="identify.html" rel="canonical" /> 33 <link href="../images/wand.png" rel="icon" /> 34 <link href="../images/wand.ico" rel="shortcut icon" /> 35 <link href="assets/magick.css" rel="stylesheet" /> 36</head> 37<body> 38 <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top"> 39 <div class="container-fluid"> 40 <a class="navbar-brand" href="../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../images/wand.ico"/></a> 41 <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#magick-navbars" aria-controls="magick-navbars" aria-expanded="false" aria-label="Toggle navigation"> 42 <span class="navbar-toggler-icon"></span> 43 </button> 44 45 <div class="collapse navbar-collapse" id="magick-navbars"> 46 <ul class="navbar-nav me-auto mb-2 mb-md-0"> 47 <li class="nav-item"> 48 <a class="nav-link " href="../www/index.html">Home</a> 49 </li> 50 <li class="nav-item"> 51 <a class="nav-link " href="../www/download.html">Download</a> 52 </li> 53 <li class="nav-item"> 54 <a class="nav-link " href="../www/command-line-tools.html">Tools</a> 55 </li> 56 <li class="nav-item"> 57 <a class="nav-link " href="../www/command-line-processing.html">CLI</a> 58 </li> 59 <li class="nav-item"> 60 <a class="nav-link " href="../www/develop.html">Develop</a> 61 </li> 62 <li class="nav-item"> 63 <a class="nav-link" target="_blank" href="https://github.com/ImageMagick/ImageMagick/discussions">Community</a> 64 </li> 65 <li class="nav-item"> 66 <iframe src="https://github.com/sponsors/ImageMagick/button" title="Sponsor ImageMagick" height="35" width="107" style="border: 0;"></iframe> 67 </li> 68 </ul> 69 <form class="d-flex form-inline" action="search.html"> 70 <input class="form-control me-2" type="text" name="q" placeholder="Search" aria-label="Search"> 71 <button class="btn btn-outline-success" type="submit" name="sa">Search</button> 72 </form> 73 </div> 74 </div> 75 </nav> 76 77 <div class="container"> 78 <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script> 79 <ins class="adsbygoogle" 80 style="display:block" 81 data-ad-client="ca-pub-3129977114552745" 82 data-ad-slot="6345125851" 83 data-full-width-responsive="true" 84 data-ad-format="horizontal"></ins> 85 <script> 86 (adsbygoogle = window.adsbygoogle || []).push({}); 87 </script> 88 89 </div> 90 91 <main class="container"> 92 <div class="magick-template"> 93<div class="magick-header"> 94<h1 class="text-center">Image Format and Characteristics</h1> 95<p class="text-center"><a href="identify.html#usage">Example Usage</a> • <a href="identify.html#options">Option Summary</a></p> 96 97<p class="lead magick-description">The <code>magick 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>magick identify</code> command or see below for example usages of the command.</p> 98 99<h2><a class="anchor" id="usage"></a>Example Usage</h2> 100 101<p>We list a few examples of the <code>magick identify</code> command here to illustrate its usefulness and ease of use. To get started, lets identify an image in the JPEG format:</p> 102 103<pre class="highlight"><code>-> magick identify rose.jpg 104rose.jpg JPEG 70x46 70x46+0+0 8-bit sRGB 2.36KB 0.000u 0:00.000 105</code></pre> 106 107<p>By default, <code>magick identify</code> provides the following output:</p> 108 109<ul><code>Filename[frame #] image-format widthxheight page-widthxpage-height+x-offset+y-offset colorspace user-time elapsed-time</code></ul> 110 111<p>Next, we look at the same image in greater detail:</p> 112 113<pre class="pre-scrollable highlight"><code>-> magick identify -verbose rose.jpg 114Image: rose.jpg 115 Format: JPEG (Joint Photographic Experts Group JFIF format) 116 Mime type: images/jpeg 117 Class: DirectClass 118 Geometry: 70x46+0+0 119 Units: Undefined 120 Type: TrueColor 121 Endianness: Undefined 122 Colorspace: sRGB 123 Depth: 8-bit 124 Channel depth: 125 Red: 8-bit 126 Green: 8-bit 127 Blue: 8-bit 128 Channel statistics: 129 Pixels: 3220 130 Red: 131 min: 31 (0.121569) 132 max: 255 (1) 133 mean: 145.557 (0.570814) 134 standard deviation: 69.1933 (0.271346) 135 kurtosis: -1.38945 136 skewness: 0.138955 137 entropy: 0.970683 138 Green: 139 min: 27 (0.105882) 140 max: 255 (1) 141 mean: 89.246 (0.349984) 142 standard deviation: 52.4608 (0.205729) 143 kurtosis: 2.60139 144 skewness: 1.80708 145 entropy: 0.869711 146 Blue: 147 min: 21 (0.0823529) 148 max: 255 (1) 149 mean: 80.4196 (0.315371) 150 standard deviation: 54.9377 (0.215442) 151 kurtosis: 2.93417 152 skewness: 1.95544 153 entropy: 0.853176 154 Image statistics: 155 Overall: 156 min: 21 (0.0823529) 157 max: 255 (1) 158 mean: 105.074 (0.412056) 159 standard deviation: 58.8639 (0.230839) 160 kurtosis: 1.37788 161 skewness: 1.48073 162 entropy: 0.897856 163 Rendering intent: Perceptual 164 Gamma: 0.454545 165 Chromaticity: 166 red primary: (0.64,0.33) 167 green primary: (0.3,0.6) 168 blue primary: (0.15,0.06) 169 white point: (0.3127,0.329) 170 Alpha color: grey74 171 Background color: white 172 Border color: srgb(223,223,223) 173 Transparent color: none 174 Interlace: None 175 Intensity: Undefined 176 Compose: Over 177 Page geometry: 70x46+0+0 178 Dispose: Undefined 179 Iterations: 0 180 Compression: JPEG 181 Quality: 92 182 Orientation: Undefined 183 Properties: 184 jpeg:colorspace: 2 185 jpeg:sampling-factor: 1x1,1x1,1x1 186 signature: aea65c9b557d779d142f26d04abe7008bab50f1e9647faae20afdcc6c15140d5 187 Artifacts: 188 verbose: true 189 Tainted: False 190 Filesize: 2.65KB 191 Number pixels: 3.22K 192 User time: 0.000u 193 Elapsed time: 0:01.000 194 Version: ImageMagick 7.0.4-8 Q16 x86_64 http://imagemagick.org 195</code></pre> 196<p>Note, the image signature is generated from the pixel components, not the image metadata.</p> 197 198<p>To get the print size in inches of an image at 72 DPI, use:</p> 199 200<pre class="highlight"><code>-> magick identify -format "%[fx:w/72] by %[fx:h/72] inches" document.png 2018.5 x 11 inches 202</code></pre> 203 204<p>The depth and dimensions of a raw image must be specified on the command line:</p> 205 206<pre class="highlight"><code>-> magick identify -depth 8 -size 640x480 image.raw 207image.raw RGB 640x480 sRGB 9kb 0.000u 0:01 208</code></pre> 209 210<p>Here we display the image texture features, moments, perceptual hash, and the number of unique colors in the image:</p> 211 212<pre class="highlight"><code>-> magick identify -verbose -features 1 -moments -unique image.png</code></pre> 213 214<p>To display the convex hull and minimum bounding box attributes of the image, use:</p> 215 216<pre class="highlight"><code>magick identify -define identify:convex-hull=true image.png</code></pre> 217 218<p>Here is a special define that outputs the location of the minimum or maximum pixel of the image:</p> 219 220<pre class="highlight"><code>magick identify -precision 5 -define identify:locate=maximum -define identify:limit=3 image.png</code></pre> 221 222<p>You can find additional examples of using <code>magick identify</code> in <a href="https://legacy.imagemagick.org/Usage/">Examples of ImageMagick Usage</a>.</p> 223 224<h2><a class="anchor" id="options"></a>Option Summary</h2> 225 226<p>The <code>magick identify</code> command recognizes these options. Click on an option to get more details about how that option works.</p> 227 228<table class="table table-sm table-hover"> 229 <tbody> 230 <tr> 231 <th align="left">Option</th> 232 <th align="left">Description</th> 233 </tr> 234 235 <tr> 236 <td><a href="../www/command-line-options.html#alpha">-alpha</a></td> 237 <td>on, activate, off, deactivate, set, opaque, copy", 238transparent, extract, background, or shape the alpha channel</td> 239 </tr> 240 241 <tr> 242 <td><a href="../www/command-line-options.html#antialias">-antialias</a></td> 243 <td>remove pixel-aliasing</td> 244 </tr> 245 246 <tr> 247 <td><a href="../www/command-line-options.html#authenticate">-authenticate <var>value</var></a></td> 248 <td>decrypt image with this password</td> 249 </tr> 250 251 <tr> 252 <td><a href="../www/command-line-options.html#channel">-channel <var>type</var></a></td> 253 <td>apply option to select image channels</td> 254 </tr> 255 256 <tr> 257 <td><a href="../www/command-line-options.html#clip">-clip</a></td> 258 <td>clip along the first path from the 8BIM profile</td> 259 </tr> 260 261 <tr> 262 <td><a href="../www/command-line-options.html#clip-mask">-clip-mask</a> <var>filename</var></td> 263 <td>associate clip mask with the image</td> 264 </tr> 265 266 <tr> 267 <td><a href="../www/command-line-options.html#clip-path">-clip-path <var>id</var></a></td> 268 <td>clip along a named path from the 8BIM profile</td> 269 </tr> 270 271 <tr> 272 <td><a href="../www/command-line-options.html#colorspace">-colorspace <var>type</var></a></td> 273 <td>set image colorspace</td> 274 </tr> 275 276 <tr> 277 <td><a href="../www/command-line-options.html#crop">-crop <var>geometry</var></a></td> 278 <td>crop the image</td> 279 </tr> 280 281 <tr> 282 <td><a href="../www/command-line-options.html#debug">-debug <var>events</var></a></td> 283 <td>display copious debugging information</td> 284 </tr> 285 286 <tr> 287 <td><a href="../www/command-line-options.html#define">-define <var>format:option</var></a></td> 288 <td>define one or more image format options</td> 289 </tr> 290 291 <tr> 292 <td><a href="../www/command-line-options.html#density">-density <var>geometry</var></a></td> 293 <td>horizontal and vertical density of the image</td> 294 </tr> 295 296 <tr> 297 <td><a href="../www/command-line-options.html#depth">-depth <var>value</var></a></td> 298 <td>image depth</td> 299 </tr> 300 301 <tr> 302 <td><a href="../www/command-line-options.html#endian">-endian <var>type</var></a></td> 303 <td>endianness (MSB or LSB) of the image</td> 304 </tr> 305 306 <tr> 307 <td><a href="../www/command-line-options.html#extract">-extract <var>geometry</var></a></td> 308 <td>extract area from image</td> 309 </tr> 310 311 <tr> 312 <td><a href="../www/command-line-options.html#features">-features <var>distance</var></a></td> 313 <td>analyze image features (e.g. contract, correlations, etc.).</td> 314 </tr> 315 316 <tr> 317 <td><a href="../www/command-line-options.html#format_identify_">-format <var>string</var></a></td> 318 <td>output formatted image characteristics</td> 319 </tr> 320 321 <tr> 322 <td><a href="../www/command-line-options.html#gamma">-gamma <var>value</var></a></td> 323 <td>level of gamma correction</td> 324 </tr> 325 326 <tr> 327 <td><a href="../www/command-line-options.html#grayscale">-grayscale <var>method</var></a></td> 328 <td>convert image to grayscale</td> 329 </tr> 330 331 <tr> 332 <td><a href="../www/command-line-options.html#help">-help</a></td> 333 <td>print program options</td> 334 </tr> 335 336 <tr> 337 <td><a href="../www/command-line-options.html#interlace">-interlace <var>type</var></a></td> 338 <td>type of image interlacing scheme</td> 339 </tr> 340 341 <tr> 342 <td><a href="../www/command-line-options.html#interpolate">-interpolate <var>method</var></a></td> 343 <td>pixel color interpolation method</td> 344 </tr> 345 346 <tr> 347 <td><a href="../www/command-line-options.html#limit">-limit <var>type value</var></a></td> 348 <td>pixel cache resource limit</td> 349 </tr> 350 351 <tr> 352 <td><a href="../www/command-line-options.html#list">-list <var>type</var></a></td> 353 <td>Color, Configure, Delegate, Format, Magic, Module, Resource, or Type</td> 354 </tr> 355 356 <tr> 357 <td><a href="../www/command-line-options.html#log">-log <var>format</var></a></td> 358 <td>format of debugging information</td> 359 </tr> 360 361 <tr> 362 <td><a href="../www/command-line-options.html#mask">-mask <var>filename</var></a></td> 363 <td>associate a mask with the image</td> 364 </tr> 365 366 <tr> 367 <td><a href="../www/command-line-options.html#moments">-moments</a></td> 368 <td>display image moments and perceptual hash.</td> 369 </tr> 370 371 <tr> 372 <td><a href="../www/command-line-options.html#monitor">-monitor</a></td> 373 <td>monitor progress</td> 374 </tr> 375 376 <tr> 377 <td><a href="../www/command-line-options.html#negate">-negate</a></td> 378 <td>replace each pixel with its complementary color </td> 379 </tr> 380 381 <tr> 382 <td><a href="../www/command-line-options.html#ping">-ping</a></td> 383 <td>by default, efficiently determine certain image characteristics.</td> 384 </tr> 385 386 <tr> 387 <td><a href="../www/command-line-options.html#precision">-precision <var>value</var></a></td> 388 <td>set the maximum number of significant digits to be printed</td> 389 </tr> 390 391 <tr> 392 <td><a href="../www/command-line-options.html#quiet">-quiet</a></td> 393 <td>suppress all warning messages</td> 394 </tr> 395 396 <tr> 397 <td><a href="../www/command-line-options.html#regard-warnings">-regard-warnings</a></td> 398 <td>pay attention to warning messages.</td> 399 </tr> 400 401 <tr> 402 <td><a href="../www/command-line-options.html#respect-parentheses">-respect-parentheses</a></td> 403 <td>settings remain in effect until parenthesis boundary.</td> 404 </tr> 405 406 <tr> 407 <td><a href="../www/command-line-options.html#sampling-factor">-sampling-factor <var>geometry</var></a></td> 408 <td>horizontal and vertical sampling factor</td> 409 </tr> 410 411 <tr> 412 <td><a href="../www/command-line-options.html#set">-set <var>attribute value</var></a></td> 413 <td>set an image attribute</td> 414 </tr> 415 416 <tr> 417 <td><a href="../www/command-line-options.html#size">-size <var>geometry</var></a></td> 418 <td>width and height of image</td> 419 </tr> 420 421 <tr> 422 <td><a href="../www/command-line-options.html#strip">-strip</a></td> 423 <td>strip image of all profiles and comments</td> 424 </tr> 425 426 <tr> 427 <td><a href="../www/command-line-options.html#unique">-unique</a></td> 428 <td>display image the number of unique colors in the image.</td> 429 </tr> 430 431 <tr> 432 <td><a href="../www/command-line-options.html#units">-units <var>type</var></a></td> 433 <td>the units of image resolution</td> 434 </tr> 435 436 <tr> 437 <td><a href="../www/command-line-options.html#verbose">-verbose</a></td> 438 <td>print detailed information about the image</td> 439 </tr> 440 441 <tr> 442 <td><a href="../www/command-line-options.html#version">-version</a></td> 443 <td>print version information</td> 444 </tr> 445 446 <tr> 447 <td><a href="../www/command-line-options.html#virtual-pixel">-virtual-pixel <var>method</var></a></td> 448 <td>access method for pixels outside the boundaries of the image</td> 449 </tr> 450 451 </tbody> 452</table> 453 454</div> 455 </div> 456 </main><!-- /.container --> 457 <footer class="magick-footer"> 458 <div class="container-fluid"> 459 <a href="../www/security-policy.html">Security</a> • 460 <a href="../www/news.html">News</a> 461 462 <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> 463 464 <a href="../www/links.html">Related</a> • 465 <a href="../www/sitemap.html">Sitemap</a> 466 <br/> 467 <a href="../www/support.html">Sponsor</a> • 468 <a href="../www/cite.html">Cite</a> • 469 <a href="http://pgp.mit.edu/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> • 470 <a href="../www/https://imagemagick.org/script/contact.php">Contact Us</a> 471 <br/> 472 <a href="https://github.com/imagemagick/imagemagick" target="_blank" rel="noopener" aria-label="GitHub"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 499.36" width="2%" height="2%" role="img" focusable="false"><title>GitHub</title><path fill="currentColor" fill-rule="evenodd" d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z"/></svg></a> • 473 <a href="https://twitter.com/imagemagick" target="_blank" rel="noopener" aria-label="Twitter"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 416.32" width="2%" height="2%" role="img" focusable="false"><title>Twitter</title><path fill="currentColor" d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92"/></svg></a> 474 <br/> 475 <small>© 1999-2021 ImageMagick Studio LLC</small> 476 </div> 477 </footer> 478 479 <!-- Javascript assets --> 480 <script src="assets/magick.js" ></script> 481 </body> 482</html> 483<!-- Magick Cache 13th February 2021 13:45 -->