identify.html 19 KB

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