escape.html 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979
  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 – Format and Print Image Properties</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="format, print, image, properties, 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="escape.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. <p class="lead magick-description">There are copious amounts of extra data associated with images (metadata), beyond the actual image pixels. This metadata can be useful, either for display, or for various calculations, or in modifying the behavior of later image processing operations. You can utilize percent escapes in a number of options, for example in <a href="../www/command-line-options.html#format_identify_">-format</a> or in montage <a href="../www/command-line-options.html#label" >-label</a>, to print various properties and other settings associated with an image.</p>
  84. <div>
  85. <table class="table table-hover table-striped">
  86. <tr>
  87. <td><b>Profile Data</b></td>
  88. <td>Such as EXIF: data, containing focal lengths, exposures, dates, and in
  89. some cases GPS locations.
  90. </td></tr>
  91. <tr>
  92. <td><b>Attributes</b></td>
  93. <td>These are directly involved with image data, and more commonly
  94. modified as part of normal image processing. These include
  95. width, height, depth, image type (colorspace), timing delays, and
  96. background color. Most specific percent escapes is to access this
  97. information.
  98. </td></tr>
  99. <tr>
  100. <td><b>Properties</b></td>
  101. <td>These are stored as a table of free form strings, and are (if possible)
  102. saved with the image (especially in MIFF and PNG image file formats).
  103. These include: Labels, Captions, Comments.
  104. </td></tr>
  105. <tr>
  106. <td><b>Artifacts</b></td>
  107. <td>These are various operational (expert) settings that are saved for
  108. use by various operators, or by the user for future use. It is just
  109. a table of free-form strings. They are not saved with the image when
  110. written. See Artifacts and Options below for details.
  111. </td></tr>
  112. <tr>
  113. <td><b>Options</b></td>
  114. <td>Also operational (expert) settings that are saved for
  115. use by various operators, but are set globally for use by a whole
  116. image list (also not saved). See Artifacts and Options below.
  117. </td></tr>
  118. </table></div>
  119. <h2>Percent Escape Handling</h2>
  120. <p>If you request a percent escape such as <samp>%[key]</samp> the setting
  121. is looked for in the following order until the first match has been
  122. found...</p>
  123. <ol>
  124. <li>Handle special prefixes such as 'artifact:' 'option:' 'exif:', or
  125. 'fx:'. This includes and calculations and or globs of those prefixes such
  126. as 'exif:*' or 'artifact:*' (see below).</li>
  127. <li>If <samp>key</samp> contains a glob pattern (but no known prefix)
  128. search free-form properties table.</li>
  129. <li>If <samp>key</samp> is a special image 'attribute' name (see list
  130. above) return the associated or calculated image attribute.</li>
  131. <li>Search for setting as a free-form 'property'</li>
  132. <li>Search for setting as a free-form 'artifact'</li>
  133. <li>Search for setting as a free-form 'option'</li>
  134. <li>Replace escape with empty string, and perhaps produce a warning.</li>
  135. </ol>
  136. <p>Remember, all long name forms of percent escapes are handled in a is case
  137. insensitive manner. </p>
  138. <p>You can now access the Artifact and Option
  139. free-form string tables directly, allowing you to override the above sequence,
  140. and avoid accessing an attribute or property of the same name.</p>
  141. <pre class="bg-light text-dark mx-4"><samp>%[artifact:<var>setting</var>]
  142. %[option:<var>setting</var>] </samp></pre>
  143. <p>Escape handling requires access to an image container. If none are available, a blank image is created to ensure the expression can be processed and a value returned. For example, <samp>magick -print "%[fx:.8765/3.14]" null: null:</samp>.</p>
  144. <h2>Single Letter Attribute Percent Escapes</h2>
  145. <p>Here are common single letter escapes (short form) is used to report the most
  146. common attributes and properties of an image, such as: the image filename
  147. filename, type, width, height. </p>
  148. <div>
  149. <table class="table table-sm table-hover table-striped table-responsive">
  150. <tr>
  151. <td>\</td>
  152. <td>backslash, the next character is literal and not subject to interpretation</td>
  153. </tr>
  154. <tr>
  155. <td>\n</td>
  156. <td>newline</td>
  157. </tr>
  158. <tr>
  159. <td>\r</td>
  160. <td>carriage return</td>
  161. </tr>
  162. <tr>
  163. <td>&lt;</td>
  164. <td>less-than character.</td>
  165. </tr>
  166. <tr>
  167. <td>&gt;</td>
  168. <td>greater-than character.</td>
  169. </tr>
  170. <tr>
  171. <td>&amp;</td>
  172. <td>ampersand character.</td>
  173. </tr>
  174. <tr>
  175. <td>%%</td>
  176. <td>a percent sign</td>
  177. </tr>
  178. <tr>
  179. <td>%b</td>
  180. <td>file size of image read in (use <a href="escape.html#precision">-precision</a> 16 to force results in B)</td>
  181. </tr>
  182. <tr>
  183. <td>%c</td>
  184. <td>comment meta-data property</td>
  185. </tr>
  186. <tr>
  187. <td>%d</td>
  188. <td>directory component of path</td>
  189. </tr>
  190. <tr>
  191. <td>%e</td>
  192. <td>filename extension or suffix</td>
  193. </tr>
  194. <tr>
  195. <td>%f</td>
  196. <td>filename (including suffix)</td>
  197. </tr>
  198. <tr>
  199. <td>%g</td>
  200. <td>layer canvas page geometry (equivalent to "%Wx%H%X%Y")</td>
  201. </tr>
  202. <tr>
  203. <td>%h</td>
  204. <td>current image height in pixels</td>
  205. </tr>
  206. <tr>
  207. <td>%i</td>
  208. <td>image filename (note: becomes output filename for "info:")</td>
  209. </tr>
  210. <tr>
  211. <td>%k</td>
  212. <td>CALCULATED: number of unique colors</td>
  213. </tr>
  214. <tr>
  215. <td>%l</td>
  216. <td>label meta-data property</td>
  217. </tr>
  218. <tr>
  219. <td>%m</td>
  220. <td>image file format (file magic)</td>
  221. </tr>
  222. <tr>
  223. <td>%n</td>
  224. <td>number of images in current image sequence, report once per frame</td>
  225. </tr>
  226. <tr>
  227. <td>%o</td>
  228. <td>output filename (used for delegates)</td>
  229. </tr>
  230. <tr>
  231. <td>%p</td>
  232. <td>index of image in current image list</td>
  233. </tr>
  234. <tr>
  235. <td>%q</td>
  236. <td>quantum depth (compile-time constant)</td>
  237. </tr>
  238. <tr>
  239. <td>%r</td>
  240. <td>image class and colorspace</td>
  241. </tr>
  242. <tr>
  243. <td>%s</td>
  244. <td>scene number (from input unless re-assigned)</td>
  245. </tr>
  246. <tr>
  247. <td>%t</td>
  248. <td>filename without directory or extension (suffix)</td>
  249. </tr>
  250. <tr>
  251. <td>%u</td>
  252. <td>unique temporary filename (used for delegates)</td>
  253. </tr>
  254. <tr>
  255. <td>%w</td>
  256. <td>current width in pixels</td>
  257. </tr>
  258. <tr>
  259. <td>%x</td>
  260. <td>x resolution (density)</td>
  261. </tr>
  262. <tr>
  263. <td>%y</td>
  264. <td>y resolution (density)</td>
  265. </tr>
  266. <tr>
  267. <td>%z</td>
  268. <td>image depth (as read in unless modified, image save depth)</td>
  269. </tr>
  270. <tr>
  271. <td>%A</td>
  272. <td>image transparency channel. Values include Undefined (no transparency channel), Blend, Copy, or Update. </td>
  273. </tr>
  274. <tr>
  275. <td>%B</td>
  276. <td>file size of image read in bytes</td>
  277. </tr>
  278. <tr>
  279. <td>%C</td>
  280. <td>image compression type</td>
  281. </tr>
  282. <tr>
  283. <td>%D</td>
  284. <td>image GIF dispose method</td>
  285. </tr>
  286. <tr>
  287. <td>%G</td>
  288. <td>original image size (%wx%h; before any resizes)</td>
  289. </tr>
  290. <tr>
  291. <td>%H</td>
  292. <td>page (canvas) height</td>
  293. </tr>
  294. <tr>
  295. <td>%M</td>
  296. <td>Magick filename (original file exactly as given, including read mods)</td>
  297. </tr>
  298. <tr>
  299. <td>%N</td>
  300. <td>number of images in current image sequence, report once per image sequence</td>
  301. </tr>
  302. <tr>
  303. <td>%O</td>
  304. <td>page (canvas) offset ( = %X%Y )</td>
  305. </tr>
  306. <tr>
  307. <td>%P</td>
  308. <td>page (canvas) size ( = %Wx%H )</td>
  309. </tr>
  310. <tr>
  311. <td>%Q</td>
  312. <td>image compression quality ( 0 = default )</td>
  313. </tr>
  314. <tr>
  315. <td>%S</td>
  316. <td>?? scenes ??</td>
  317. </tr>
  318. <tr>
  319. <td>%T</td>
  320. <td>image time delay (in centi-seconds)</td>
  321. </tr>
  322. <tr>
  323. <td>%U</td>
  324. <td>image resolution units</td>
  325. </tr>
  326. <tr>
  327. <td>%W</td>
  328. <td>page (canvas) width</td>
  329. </tr>
  330. <tr>
  331. <td>%X</td>
  332. <td>page (canvas) x offset (including sign)</td>
  333. </tr>
  334. <tr>
  335. <td>%Y</td>
  336. <td>page (canvas) y offset (including sign)</td>
  337. </tr>
  338. <tr>
  339. <td>%Z</td>
  340. <td>unique filename (used for delegates)</td>
  341. </tr>
  342. <tr>
  343. <td>%@</td>
  344. <td>CALCULATED: trim bounding box (without actually trimming)</td>
  345. </tr>
  346. <tr>
  347. <td>%#</td>
  348. <td>CALCULATED: 'signature' hash of image values</td>
  349. </tr>
  350. </table></div>
  351. <p>Here is a sample command and its output for an image with filename
  352. <samp>bird.miff</samp> and whose width is 512 and height is 480.</p>
  353. <pre class="bg-light text-dark mx-4"><samp>-> identify -format "%m:%f %wx%h" bird.miff
  354. MIFF:bird.miff 512x480 </samp></pre>
  355. <p>Note that all single letter percent escapes can also be used using long
  356. form (from IM version 6.7.6-9, see next). For example <samp>%[f]</samp> is
  357. equivalent to the <samp>%f</samp> short form. </p>
  358. <p><b>WARNING</b>: short form percent escapes are NOT performed when the percent
  359. is after a number. For example, <samp>10%x10</samp> does not expand the
  360. <samp>%x</samp> as a percent escape. If you specifically want to expand the
  361. 'x', use the long form which overrides this special case. EG:
  362. <samp>10%[x]10</samp>. </p>
  363. <p>Also be warned that calculated attributes can take some time to generate,
  364. especially for large images.</p>
  365. <h2>Long Form Attribute Percent Escapes</h2>
  366. <p>In addition to the above specific and calculated attributes are recognized
  367. when enclosed in braces (long form):</p>
  368. <div>
  369. <table class="table table-sm table-hover table-striped table-responsive">
  370. <tr>
  371. <td>%[basename]</td>
  372. <td>base filename, no suffixes (as %t)</td>
  373. </tr>
  374. <tr>
  375. <td>%[bit-depth]</td>
  376. <td>Actual bit-depth of the pixel data</td>
  377. </tr>
  378. <tr>
  379. <td>%[bounding-box]</td>
  380. <td>upper left and lower right corners of the image bounding box</td>
  381. </tr>
  382. <tr>
  383. <td>%[caption]</td>
  384. <td>caption meta-data property</td>
  385. </tr>
  386. <tr>
  387. <td>%[caption:lines]</td>
  388. <td>returns the number lines generated when wrapping the caption</td>
  389. </tr>
  390. <tr>
  391. <td>%[caption:pointsize]</td>
  392. <td>returns the pointsize computed during caption: processing</td>
  393. </tr>
  394. <tr>
  395. <td>%[channels]</td>
  396. <td>colorspace neumonic followed by total number of channels and meta channets, e.g., <code>cmyka 8.3</code> indicates a CMYK image with alpha channel for a total of 8 channels and 3 meta channels.</td>
  397. </tr>
  398. <tr>
  399. <td>%[colors]</td>
  400. <td>Number of unique colors in the image (as of IM 7.0.3.8)</td>
  401. </tr>
  402. <tr>
  403. <td>%[colorspace]</td>
  404. <td>colorspace of Image Data (excluding transparency)</td>
  405. </tr>
  406. <tr>
  407. <td>%[compose]</td>
  408. <td> </td>
  409. </tr>
  410. <tr>
  411. <td>%[compression]</td>
  412. <td>image compression type</td>
  413. </tr>
  414. <tr>
  415. <td><a href="convex-hull.html">%[convex-hull]</a></td>
  416. <td>points that form a convex hull around the foreground object. Use <samp><a href="../www/command-line-options.html#define">-define</a> convex-hull:background-color=<em>color</em></samp> to identify the image background color. Use <samp><a href="../www/command-line-options.html#fuzz">-fuzz</a> to allow for a non-uniform background color. </td>
  417. </tr>
  418. <tr>
  419. <td><a href="convex-hull.html">%[convex-hull:extreme-points]</a></td>
  420. <td>return the top, right, bottom, and left extreme points of the convex hull.</td>
  421. </tr>
  422. <tr>
  423. <td>%[copyright]</td>
  424. <td>ImageMagick Copyright String</td>
  425. </tr>
  426. <tr>
  427. <td>%[depth]</td>
  428. <td>depth of image for write (as input unless changed)</td>
  429. </tr>
  430. <tr>
  431. <td>%[deskew:angle]</td>
  432. <td>The deskew angle in degrees of rotation</td>
  433. </tr>
  434. <tr>
  435. <td>%[directory]</td>
  436. <td>directory part of filename (as %d)</td>
  437. </tr>
  438. <tr>
  439. <td>%[distortion]</td>
  440. <td>how well an image resembles a reference image (<a href="../www/command-line-options.html#compare" >-compare</a>)</td>
  441. </tr>
  442. <tr>
  443. <td>%[dominant-color]</td>
  444. <td>return the dominate image color in hex. Preceed usage with <a href="../www/command-line-options.html#kmeans" >-kmeans</a>.</td>
  445. </tr>
  446. <tr>
  447. <td>%[entropy]</td>
  448. <td>CALCULATED: entropy of the image</td>
  449. </tr>
  450. <tr>
  451. <td>%[extension]</td>
  452. <td>extension part of filename (as %e)</td>
  453. </tr>
  454. <tr>
  455. <td>%[gamma]</td>
  456. <td>value of image gamma</td>
  457. </tr>
  458. <tr>
  459. <td>%[group]</td>
  460. <td>??? window group ???</td>
  461. </tr>
  462. <tr>
  463. <td>%[height]</td>
  464. <td>original height of image (when it was read in)</td>
  465. </tr>
  466. <tr>
  467. <td>%[histogram:contrast-stretch]</td>
  468. <td>computed min and max contrast stretch percentage</td>
  469. </tr>
  470. <tr>
  471. <td>%[histogram:linear-stretch]</td>
  472. <td>computed min and max linear stretch percentage</td>
  473. </tr>
  474. <tr>
  475. <td>%[input]</td>
  476. <td> </td>
  477. </tr>
  478. <tr>
  479. <td>%[interlace]</td>
  480. <td>Image interlace mode (as of IM 7.0.3.8)</td>
  481. </tr>
  482. <tr>
  483. <td>%[kurtosis]</td>
  484. <td>CALCULATED: kurtosis statistic of image</td>
  485. </tr>
  486. <tr>
  487. <td>%[label]</td>
  488. <td>label meta-data property</td>
  489. </tr>
  490. <tr>
  491. <td>%[label:pointsize]</td>
  492. <td>returns the pointsize computed during label: processing</td>
  493. </tr>
  494. <tr>
  495. <td>%[magick]</td>
  496. <td>coder used to read image (not the file suffix)</td>
  497. </tr>
  498. <tr>
  499. <td>%[max]</td>
  500. <td>CALCULATED: maximum value statistic of image</td>
  501. </tr>
  502. <tr>
  503. <td>%[mean]</td>
  504. <td>CALCULATED: average value statistic of image</td>
  505. </tr>
  506. <tr>
  507. <td>%[median]</td>
  508. <td>CALCULATED: median value statistic of image</td>
  509. </tr>
  510. <tr>
  511. <td>%[min]</td>
  512. <td>CALCULATED: minimum value statistic of image</td>
  513. </tr>
  514. <tr>
  515. <td><a href="convex-hull.html">%[minimum-bounding-box]</a></td>
  516. <td>Use <samp><a href="../www/command-line-options.html#define">-define</a> convex-hull:background-color=<em>color</em></samp> to identify the image background color. Use <samp><a href="../www/command-line-options.html#fuzz">-fuzz</a> to allow for a non-uniform background color. In addition to the bounding box points, these properties are set: <samp>minimum-bounding-box:area</samp>, <samp>minimum-bounding-box:width</samp>, <samp>minimum-bounding-box:height</samp>, <samp>minimum-bounding-box:angle</samp>, and <samp>minimum-bounding-box:unrotate</samp>.</td>
  517. </tr>
  518. <tr>
  519. <td>%[opaque]</td>
  520. <td>CALCULATED: is image fully-opaque?</td>
  521. </tr>
  522. <tr>
  523. <td>%[orientation]</td>
  524. <td>image orientation</td>
  525. </tr>
  526. <tr>
  527. <td>%[page]</td>
  528. <td>Virtual canvas (page) geometry</td>
  529. </tr>
  530. <tr>
  531. <td>%[papersize:<em>name</em>]</td>
  532. <td>paper size for <em>name</em> in pixels at 72DPI (e.g. papersize:A4)</td>
  533. </tr>
  534. <tr>
  535. <td>%[printsize.x]</td>
  536. <td>X printsize</td>
  537. </tr>
  538. <tr>
  539. <td>%[printsize.y]</td>
  540. <td>Y printsize</td>
  541. </tr>
  542. <tr>
  543. <td>%[profile:icc]</td>
  544. <td>ICC profile info</td>
  545. </tr>
  546. <tr>
  547. <td>%[profile:icm]</td>
  548. <td>ICM profile info</td>
  549. </tr>
  550. <tr>
  551. <td>%[profiles]</td>
  552. <td>list of any embedded profiles</td>
  553. </tr>
  554. <tr>
  555. <td>%[quality]</td>
  556. <td>Image quality value (as of IM 7.0.3.8)</td>
  557. </tr>
  558. <tr>
  559. <td>%[rendering-intent]</td>
  560. <td>Image rendering intent (as of IM 7.0.3.8)</td>
  561. </tr>
  562. <tr>
  563. <td>%[resolution.x]</td>
  564. <td>X density (resolution) without units</td>
  565. </tr>
  566. <tr>
  567. <td>%[resolution.y]</td>
  568. <td>Y density (resolution) without units</td>
  569. </tr>
  570. <tr>
  571. <td>%[scene]</td>
  572. <td>original scene number of image in input file</td>
  573. </tr>
  574. <tr>
  575. <td>%[size]</td>
  576. <td>original size of image (when it was read in)</td>
  577. </tr>
  578. <tr>
  579. <td>%[skewness]</td>
  580. <td>CALCULATED: skewness statistic of image</td>
  581. </tr>
  582. <tr>
  583. <td>%[standard-deviation]</td>
  584. <td>CALCULATED: standard deviation statistic of image</td>
  585. </tr>
  586. <tr>
  587. <td>%[type]</td>
  588. <td>CALCULATED: image type</td>
  589. </tr>
  590. <tr>
  591. <td>%[unique]</td>
  592. <td>unique temporary filename ???</td>
  593. </tr>
  594. <tr>
  595. <td>%[units]</td>
  596. <td>image resolution units</td>
  597. </tr>
  598. <tr>
  599. <td>%[version]</td>
  600. <td>Version Information of this running ImageMagick</td>
  601. </tr>
  602. <tr>
  603. <td>%[width]</td>
  604. <td>original width of image (when it was read in)</td>
  605. </tr>
  606. <tr>
  607. <td>%[zero]</td>
  608. <td>zero (unique filename for delegate use)</td>
  609. </tr>
  610. </table></div>
  611. <h2>Properties</h2>
  612. <p>All other long forms of percent escapes (not single letter long form) are
  613. handled in a case insensitive manner. Such escapes will attempt to look
  614. up that name specific data sources. </p>
  615. <p>The primary search space (if not a specific attribute listed above) is
  616. a free-form property string. Such strings are associated and saved with
  617. images, and are typically set using either the <a href="../www/command-line-options.html#set" >-set</a>
  618. CLI option (or API equivalent), or from special convenience options
  619. (such as <a href="../www/command-line-options.html#label"
  620. >-label</a>, <a href="../www/command-line-options.html#comment"
  621. >-comment</a>, <a href="../www/command-line-options.html#caption"
  622. >-caption</a>). </p>
  623. <p>These convenience options are globally saved (as 'global options' so thay can
  624. be set before images are read), and later are transferred to the property of
  625. individual images, only when they are read in. At that time any internal
  626. percent escape present is then handled. </p>
  627. <p>To change a property of an image already in memory, you need to use <a
  628. href="../www/command-line-options.html#set" >-set</a>.
  629. </p>
  630. <p>Note that properties, like attributes (and profiles), are saved with
  631. images when write, if the image file format allows. </p>
  632. <h2>Artifacts and Options</h2>
  633. <p>The previous percent escapes are associated with the primary Attributes and
  634. Properties. Which is the original and primary focus of such percent escapes.
  635. </p>
  636. <p>However there are many operational settings that are used by various
  637. ImageMagick operators that can be useful to set and later access. These
  638. consist of per-image Artifacts, and Global options (associated with a list of
  639. images, typically the current image list).</p>
  640. <p>Note that the major difference between an artifact and a property is that
  641. artifacts, being an internal operational setting, is not saved with images (if
  642. such is possible). </p>
  643. <p>For example when you use <samp>-define 'distort:viewport=100x100'</samp> you
  644. are in fact generating a global option, which the <a href="../www/command-line-options.html#distort"
  645. >-distort</a> operator will use to modify its behavior (distorted output
  646. image 'view'). </p>
  647. <p>An Option is essentially an Artifact that has been stored globally as part
  648. of a list of images (specifically a 'Wand' of images). As such they are
  649. identical, in that a Option, is simply a global Artifact for all the
  650. associated images. </p>
  651. <p>As such you can use <samp>-set 'option:distort:viewport' '100x100'</samp> to
  652. achieve the same result of setting a Artifact for the disort operation to use.
  653. </p>
  654. <p><b>Internal Handling of a Global Option...</b></p>
  655. <p>The Core library ('MagickCore') does not generally directly understand
  656. Global Options. As such, continuing the previous example, the
  657. <samp>DistortImages()</samp> function only looks up an artifact to discover if
  658. a 'viewport' has been provided to it. </p>
  659. <p>How Global Options are used when a library function requests an Artifact is
  660. one of the key differences between IMv6 and IMv7.</p>
  661. <p>Sets a link back to the global options
  662. data, so that if a specific per-image Artifact is not found , then it will
  663. look for a equivalent global Option for that image list. directly. This
  664. saves coping these free-form options into artifacts repeatedly, and means you
  665. can now separately define a global option for a list, and a individual
  666. overriding artifact for a specific image in that list. </p>
  667. <p>Note that many API's that do not use Wands (PerlMagick for example using
  668. arrays of images rather than a Wand). In these API's you will not have Global
  669. Options, only per-image Artifacts. </p>
  670. <p>In summery a Global Option, if available, is equivalent to a per-image
  671. Artifact. </p>
  672. <h2>Glob-Pattern Listing of Properties, Artifacts and Options</h2>
  673. <p>The <var>setting</var> can contain a glob pattern. As such you can
  674. now list all free-form string properties, artifacts, and options, (but not
  675. specific image attributes) using...</p>
  676. <pre class="bg-light text-dark mx-4 cli"><samp>magick ... \
  677. -print "__Properties__\n%[*]" \
  678. -print "__Artifacts__\n%[artifact:*]" \
  679. -print "__Options__\n%[option:*]" \
  680. ... </samp></pre>
  681. <p> The format of glob patterns are very specific and as such is generally
  682. only used to list specific settings, such as when debugging, rather than being
  683. used for image processing use. </p>
  684. <h2>Calculated Percent Escape Prefixes</h2>
  685. <p>There are some special prefixes (before the first ':') which performs
  686. calculations based on the user provided string that follows that prefix. For
  687. example you can do a numerical calculation use <samp>%[fx:...]</samp> to
  688. evaluate the given <a href="fx.html">FX</a> expressions:</p>
  689. <pre class="bg-light text-dark mx-4"><samp>%[fx:<var>expression</var>] </samp></pre>
  690. <p>Use <samp>pixel:</samp> or <samp>hex:</samp> to evaluate a pixel color as defined by the <a
  691. href="fx.html">FX</a>
  692. expression:</p>
  693. <pre class="bg-light text-dark mx-4"><samp>%[pixel:<var>expression</var>] </samp></pre>
  694. <p>Use <a href="../www/command-line-options.html#define">-define</a> to specify the color compliance (e.g. <samp>-define pixel:compliance=css</samp>)</p>.
  695. <h2>Specific Profile Percent Escape Prefixes</h2>
  696. <p>You can also use the following special formatting syntax to print EXIF
  697. mage meta-data that was included in the image read in:</p>
  698. <pre class="bg-light text-dark mx-4"><samp>%[EXIF:<var>tag</var>] </samp></pre>
  699. <p>Choose <var>tag</var> from the following:</p>
  700. <pre class="pre-scrollable bg-light text-dark mx-4"><samp>
  701. * (print all EXIF tags, in keyword=data format)
  702. ! (print all EXIF tags, in tag_number data format)
  703. #hhhh (print data for EXIF tag #hhhh)
  704. ImageWidth
  705. ImageLength
  706. BitsPerSample
  707. Compression
  708. PhotometricInterpretation
  709. FillOrder
  710. DocumentName
  711. ImageDescription
  712. Make
  713. Model
  714. StripOffsets
  715. Orientation
  716. SamplesPerPixel
  717. RowsPerStrip
  718. StripByteCounts
  719. XResolution
  720. YResolution
  721. PlanarConfiguration
  722. ResolutionUnit
  723. TransferFunction
  724. Software
  725. DateTime
  726. Artist
  727. WhitePoint
  728. PrimaryChromaticities
  729. TransferRange
  730. JPEGProc
  731. JPEGInterchangeFormat
  732. JPEGInterchangeFormatLength
  733. YCbCrCoefficients
  734. YCbCrSubSampling
  735. YCbCrPositioning
  736. ReferenceBlackWhite
  737. CFARepeatPatternDim
  738. CFAPattern
  739. BatteryLevel
  740. Copyright
  741. ExposureTime
  742. FNumber
  743. IPTC/NAA
  744. EXIFOffset
  745. InterColorProfile
  746. ExposureProgram
  747. SpectralSensitivity
  748. GPSInfo
  749. ISOSpeedRatings
  750. OECF
  751. EXIFVersion
  752. DateTimeOriginal
  753. DateTimeDigitized
  754. ComponentsConfiguration
  755. CompressedBitsPerPixel
  756. ShutterSpeedValue
  757. ApertureValue
  758. BrightnessValue
  759. ExposureBiasValue
  760. MaxApertureValue
  761. SubjectDistance
  762. MeteringMode
  763. LightSource
  764. Flash
  765. FocalLength
  766. MakerNote
  767. UserComment
  768. SubSecTime
  769. SubSecTimeOriginal
  770. SubSecTimeDigitized
  771. FlashPixVersion
  772. ColorSpace
  773. EXIFImageWidth
  774. EXIFImageLength
  775. InteroperabilityOffset
  776. FlashEnergy
  777. SpatialFrequencyResponse
  778. FocalPlaneXResolution
  779. FocalPlaneYResolution
  780. FocalPlaneResolutionUnit
  781. SubjectLocation
  782. ExposureIndex
  783. SensingMethod
  784. FileSource
  785. SceneType </samp></pre>
  786. <br/>
  787. <p>Surround the format specification with quotation marks to prevent your
  788. shell from misinterpreting any spaces and square brackets.</p>
  789. <p>The following special formatting syntax can be used to print IPTC
  790. information contained in the file:</p>
  791. <pre class="bg-light text-dark mx-4"><samp>%[IPTC:<var>dataset</var>:<var>record</var>] </samp></pre>
  792. <p>Select <var>dataset</var> and <var>record</var> from the following:</p>
  793. <pre class="pre-scrollable bg-light text-dark:"><samp>
  794. Envelope Record
  795. 1:00 Model Version
  796. 1:05 Destination
  797. 1:20 File Format
  798. 1:22 File Format Version
  799. 1:30 Service Identifier
  800. 1:40 Envelope Number
  801. 1:50 Product ID
  802. 1:60 Envelope Priority
  803. 1:70 Date Sent
  804. 1:80 Time Sent
  805. 1:90 Coded Character Set
  806. 1:100 UNO (Unique Name of Object)
  807. 1:120 ARM Identifier
  808. 1:122 ARM Version
  809. Application Record
  810. 2:00 Record Version
  811. 2:03 Object Type Reference
  812. 2:05 Object Name (Title)
  813. 2:07 Edit Status
  814. 2:08 Editorial Update
  815. 2:10 Urgency
  816. 2:12 Subject Reference
  817. 2:15 Category
  818. 2:20 Supplemental Category
  819. 2:22 Fixture Identifier
  820. 2:25 Keywords
  821. 2:26 Content Location Code
  822. 2:27 Content Location Name
  823. 2:30 Release Date
  824. 2:35 Release Time
  825. 2:37 Expiration Date
  826. 2:38 Expiration Time
  827. 2:40 Special Instructions
  828. 2:42 Action Advised
  829. 2:45 Reference Service
  830. 2:47 Reference Date
  831. 2:50 Reference Number
  832. 2:55 Date Created
  833. 2:60 Time Created
  834. 2:62 Digital Creation Date
  835. 2:63 Digital Creation Time
  836. 2:65 Originating Program
  837. 2:70 Program Version
  838. 2:75 Object Cycle
  839. 2:80 By-Line (Author)
  840. 2:85 By-Line Title (Author Position) [Not used in Photoshop 7]
  841. 2:90 City
  842. 2:92 Sub-Location
  843. 2:95 Province/State
  844. 2:100 Country/Primary Location Code
  845. 2:101 Country/Primary Location Name
  846. 2:103 Original Transmission Reference
  847. 2:105 Headline
  848. 2:110 Credit
  849. 2:115 Source
  850. 2:116 Copyright Notice
  851. 2:118 Contact
  852. 2:120 Caption/Abstract
  853. 2:122 Caption Writer/Editor
  854. 2:125 Rasterized Caption
  855. 2:130 Image Type
  856. 2:131 Image Orientation
  857. 2:135 Language Identifier
  858. 2:150 Audio Type
  859. 2:151 Audio Sampling Rate
  860. 2:152 Audio Sampling Resolution
  861. 2:153 Audio Duration
  862. 2:154 Audio Outcue
  863. 2:200 ObjectData Preview File Format
  864. 2:201 ObjectData Preview File Format Version
  865. 2:202 ObjectData Preview Data
  866. Pre-ObjectData Descriptor Record
  867. 7:10 Size Mode
  868. 7:20 Max Subfile Size
  869. 7:90 ObjectData Size Announced
  870. 7:95 Maximum ObjectData Size
  871. ObjectData Record
  872. 8:10 Subfile
  873. Post ObjectData Descriptor Record
  874. 9:10 Confirmed ObjectData Size</samp></pre>
  875. </div>
  876. </div>
  877. </main><!-- /.container -->
  878. <footer class="magick-footer">
  879. <div class="container-fluid">
  880. <a href="../www/security-policy.html">Security</a> •
  881. <a href="../www/news.html">News</a>
  882. <a href="escape.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../images/wand.ico"/></a>
  883. <a href="../www/links.html">Related</a> •
  884. <a href="../www/sitemap.html">Sitemap</a>
  885. <br/>
  886. <a href="../www/support.html">Sponsor</a> •
  887. <a href="../www/cite.html">Cite</a> •
  888. <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
  889. <a href="../www/https://imagemagick.org/script/contact.php">Contact Us</a>
  890. <br/>
  891. <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> •
  892. <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>
  893. <br/>
  894. <small>Copyright © 1999 ImageMagick Studio LLC</small>
  895. </div>
  896. </footer>
  897. <!-- Javascript assets -->
  898. <script src="assets/magick.js" ></script>
  899. </body>
  900. </html>