Debian Codegraph @

www/escape.html

raw symbols ◀ ▶
Source reconstructed at patch state 3 of 5 — not the installed (fully patched) source.
5 Debian patches touch this file
1
2
3
4 <!DOCTYPE html>
5 <html lang="en" data-bs-theme="dark">
6 <head>
7 <script src="assets/color-modes.js" ></script>
8 <meta charset="utf-8" />
9 <meta name="viewport" content="width=device-width, initial-scale=1" />
10 <title>ImageMagick – Format and Print Image Properties</title>
11 <meta name="keywords" content="Format and Print Image Properties, Image Processing, Digital Image Editing, Image Conversion, Open-Source Software, Image Manipulation, Command-Line Image Tools" />
12 <meta name="description" content="ImageMagick is a powerful, open-source software suite for creating, editing, converting, and manipulating images in over 200 formats. Ideal for web developers, graphic designers, and researchers, it offers versatile tools for image processing, including batch processing, format conversion, and complex image transformations." />
13 <meta name="application-name" content="ImageMagick" />
14 <meta name="application-url" content="https://imagemagick.org" />
15 <meta name="copyright" content="Copyright (c) 1999 ImageMagick Studio LLC" />
16 <meta itemprop='url' content='../' />
17 <meta itemprop='title' content='ImageMagick' />
18 <meta itemprop='description' content="ImageMagick is a powerful, open-source software suite for creating, editing, converting, and manipulating images in over 200 formats. Ideal for web developers, graphic designers, and researchers, it offers versatile tools for image processing, including batch processing, format conversion, and complex image transformations." />
19 <meta property='og:url' content='../' />
20 <meta property='og:name' content='ImageMagick' />
21 <meta property='og:image' content='../images/logo.png' />
22 <meta property='og:type' content='website' />
23 <meta property='og:site_name' content='ImageMagick' />
24 <meta property='og:description' content="ImageMagick is a powerful, open-source software suite for creating, editing, converting, and manipulating images in over 200 formats. Ideal for web developers, graphic designers, and researchers, it offers versatile tools for image processing, including batch processing, format conversion, and complex image transformations." />
25 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
26 <link type="images/png" sizes="64x64" href="../images/wand.png" rel="icon" />
27 <link type="images/icon" sizes="16x16" href="../images/wand.ico" rel="shortcut icon" />
28 <link href="escape.html" rel="canonical" />
29 <link href="assets/bootstrap.min.css" rel="stylesheet" />
30 </head>
31 <body>
32 <svg xmlns="http://www.w3.org/2000/svg" class="d-none">
33 <symbol id="check2" viewBox="0 0 16 16">
34 <path d="M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z"/>
35 </symbol>
36 <symbol id="circle-half" viewBox="0 0 16 16">
37 <path d="M8 15A7 7 0 1 0 8 1v14zm0 1A8 8 0 1 1 8 0a8 8 0 0 1 0 16z"/>
38 </symbol>
39 <symbol id="moon-stars-fill" viewBox="0 0 16 16">
40 <path d="M6 .278a.768.768 0 0 1 .08.858 7.208 7.208 0 0 0-.878 3.46c0 4.021 3.278 7.277 7.318 7.277.527 0 1.04-.055 1.533-.16a.787.787 0 0 1 .81.316.733.733 0 0 1-.031.893A8.349 8.349 0 0 1 8.344 16C3.734 16 0 12.286 0 7.71 0 4.266 2.114 1.312 5.124.06A.752.752 0 0 1 6 .278z"/>
41 <path d="M10.794 3.148a.217.217 0 0 1 .412 0l.387 1.162c.173.518.579.924 1.097 1.097l1.162.387a.217.217 0 0 1 0 .412l-1.162.387a1.734 1.734 0 0 0-1.097 1.097l-.387 1.162a.217.217 0 0 1-.412 0l-.387-1.162A1.734 1.734 0 0 0 9.31 6.593l-1.162-.387a.217.217 0 0 1 0-.412l1.162-.387a1.734 1.734 0 0 0 1.097-1.097l.387-1.162zM13.863.099a.145.145 0 0 1 .274 0l.258.774c.115.346.386.617.732.732l.774.258a.145.145 0 0 1 0 .274l-.774.258a1.156 1.156 0 0 0-.732.732l-.258.774a.145.145 0 0 1-.274 0l-.258-.774a1.156 1.156 0 0 0-.732-.732l-.774-.258a.145.145 0 0 1 0-.274l.774-.258c.346-.115.617-.386.732-.732L13.863.1z"/>
42 </symbol>
43 <symbol id="sun-fill" viewBox="0 0 16 16">
44 <path d="M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 0a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 0zm0 13a.5.5 0 0 1 .5.5v2a.5.5 0 0 1-1 0v-2A.5.5 0 0 1 8 13zm8-5a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2a.5.5 0 0 1 .5.5zM3 8a.5.5 0 0 1-.5.5h-2a.5.5 0 0 1 0-1h2A.5.5 0 0 1 3 8zm10.657-5.657a.5.5 0 0 1 0 .707l-1.414 1.415a.5.5 0 1 1-.707-.708l1.414-1.414a.5.5 0 0 1 .707 0zm-9.193 9.193a.5.5 0 0 1 0 .707L3.05 13.657a.5.5 0 0 1-.707-.707l1.414-1.414a.5.5 0 0 1 .707 0zm9.193 2.121a.5.5 0 0 1-.707 0l-1.414-1.414a.5.5 0 0 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .707zM4.464 4.465a.5.5 0 0 1-.707 0L2.343 3.05a.5.5 0 1 1 .707-.707l1.414 1.414a.5.5 0 0 1 0 .708z"/>
45 </symbol>
46 </svg>
47 <div class="dropdown position-fixed bottom-0 end-0 mb-3 me-3 bd-mode-toggle">
48 <button class="btn btn-bd-secondary py-2 dropdown-toggle d-flex align-items-center"
49 id="bd-theme"
50 type="button"
51 aria-expanded="false"
52 data-bs-toggle="dropdown"
53 aria-label="Toggle theme (auto)">
54 <svg class="bi my-1 theme-icon-active" width="1em" height="1em"><use href="#circle-half"></use></svg>
55 <span class="visually-hidden" id="bd-theme-text">Toggle theme</span>
56 </button>
57 <ul class="dropdown-menu dropdown-menu-end shadow" aria-labelledby="bd-theme-text">
58 <li>
59 <button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="light" aria-pressed="false">
60 <svg class="bi me-2 opacity-50" width="1em" height="1em"><use href="#sun-fill"></use></svg>
61 Light
62 <svg class="bi ms-auto d-none" width="1em" height="1em"><use href="#check2"></use></svg>
63 </button>
64 </li>
65 <li>
66 <button type="button" class="dropdown-item d-flex align-items-center active" data-bs-theme-value="dark" aria-pressed="false">
67 <svg class="bi me-2 opacity-50" width="1em" height="1em"><use href="#moon-stars-fill"></use></svg>
68 Dark
69 <svg class="bi ms-auto d-none" width="1em" height="1em"><use href="#check2"></use></svg>
70 </button>
71 </li>
72 <li>
73 <button type="button" class="dropdown-item d-flex align-items-center" data-bs-theme-value="auto" aria-pressed="true">
74 <svg class="bi me-2 opacity-50" width="1em" height="1em"><use href="#circle-half"></use></svg>
75 Auto
76 <svg class="bi ms-auto d-none" width="1em" height="1em"><use href="#check2"></use></svg>
77 </button>
78 </li>
79 </ul>
80 </div>
81 <svg xmlns="http://www.w3.org/2000/svg" class="d-none">
82 <symbol id="arrow-right-circle" viewBox="0 0 16 16">
83 <path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zM4.5 7.5a.5.5 0 0 0 0 1h5.793l-2.147 2.146a.5.5 0 0 0 .708.708l3-3a.5.5 0 0 0 0-.708l-3-3a.5.5 0 1 0-.708.708L10.293 7.5H4.5z"/>
84 </symbol>
85 <symbol id="color-mode" viewBox="0 0 118 94">
86 <title>Color Modes</title>
87 <path fill-rule="evenodd" clip-rule="evenodd" d="M24.509 0c-6.733 0-11.715 5.893-11.492 12.284.214 6.14-.064 14.092-2.066 20.577C8.943 39.365 5.547 43.485 0 44.014v5.972c5.547.529 8.943 4.649 10.951 11.153 2.002 6.485 2.28 14.437 2.066 20.577C12.794 88.106 17.776 94 24.51 94H93.5c6.733 0 11.714-5.893 11.491-12.284-.214-6.14.064-14.092 2.066-20.577 2.009-6.504 5.396-10.624 10.943-11.153v-5.972c-5.547-.529-8.934-4.649-10.943-11.153-2.002-6.484-2.28-14.437-2.066-20.577C105.214 5.894 100.233 0 93.5 0H24.508zM80 57.863C80 66.663 73.436 72 62.543 72H44a2 2 0 01-2-2V24a2 2 0 012-2h18.437c9.083 0 15.044 4.92 15.044 12.474 0 5.302-4.01 10.049-9.119 10.88v.277C75.317 46.394 80 51.21 80 57.863zM60.521 28.34H49.948v14.934h8.905c6.884 0 10.68-2.772 10.68-7.727 0-4.643-3.264-7.207-9.012-7.207zM49.948 49.2v16.458H60.91c7.167 0 10.964-2.876 10.964-8.281 0-5.406-3.903-8.178-11.425-8.178H49.948z"></path>
88 </symbol>
89 </svg>
90 <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
91 <div class="container-fluid">
92 <a class="navbar-brand" href="../index.html"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../images/wand.ico"/></a>
93 <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">
94 <span class="navbar-toggler-icon"></span>
95 </button>
96
97 <div class="collapse navbar-collapse" id="magick-navbars">
98 <ul class="navbar-nav me-auto mb-2 mb-md-0">
99 <li class="nav-item">
100 <a class="nav-link " href="download.html">Download</a>
101 </li>
102 <li class="nav-item">
103 <a class="nav-link " href="command-line-tools.html">Tools</a>
104 </li>
105 <li class="nav-item">
106 <a class="nav-link " href="command-line-processing.html">CLI</a>
107 </li>
108 <li class="nav-item">
109 <a class="nav-link " href="develop.html">Develop</a>
110 </li>
111 <li class="nav-item">
112 <a class="nav-link" rel="noopener" target="_blank" href="https://github.com/ImageMagick/ImageMagick/discussions">Community</a>
113 </li>
114 <li class="nav-item">
115 <iframe src="https://github.com/sponsors/ImageMagick/button" title="Sponsor ImageMagick" height="35" width="107" style="border: 0;"></iframe>
116 </li>
117 </ul>
118 <form class="d-flex form-inline" action="search.html">
119 <input class="form-control me-2" type="text" name="q" placeholder="Search" aria-label="Search">
120 <button class="btn btn-outline-success" type="submit" name="sa">Search</button>
121 </form>
122 </div>
123 </div>
124 </nav>
125
126 <div class="col-lg-8 mx-auto p-4 py-md-5 text-body-secondary">
127 <header class="d-flex align-items-center pb-3 mb-5 border-bottom">
128 <a href="../index.html" class="d-flex align-items-center text-decoration-none">
129 <h1 class="mt-5 fs-4">Format and Print Image Properties</h1>
130 </a>
131 </header>
132
133 <main class="container">
134 <div>
135 <p class="lead">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="command-line-options.html#format_identify_">-format</a> or in montage <a href="command-line-options.html#label" >-label</a>, to print various properties and other settings associated with an image.</p>
136
137 <div>
138 <table class="table table-hover table-striped">
139 <tr>
140 <td><b>Profile Data</b></td>
141 <td>Such as EXIF: data, containing focal lengths, exposures, dates, and in
142 some cases GPS locations.
143 </td></tr>
144 <tr>
145 <td><b>Attributes</b></td>
146 <td>These are directly involved with image data, and more commonly
147 modified as part of normal image processing. These include
148 width, height, depth, image type (colorspace), timing delays, and
149 background color. Most specific percent escapes is to access this
150 information.
151 </td></tr>
152 <tr>
153 <td><b>Properties</b></td>
154 <td>These are stored as a table of free form strings, and are (if possible)
155 saved with the image (especially in MIFF and PNG image file formats).
156 These include: Labels, Captions, Comments.
157 </td></tr>
158 <tr>
159 <td><b>Artifacts</b></td>
160 <td>These are various operational (expert) settings that are saved for
161 use by various operators, or by the user for future use. It is just
162 a table of free-form strings. They are not saved with the image when
163 written. See Artifacts and Options below for details.
164 </td></tr>
165 <tr>
166 <td><b>Options</b></td>
167 <td>Also operational (expert) settings that are saved for
168 use by various operators, but are set globally for use by a whole
169 image list (also not saved). See Artifacts and Options below.
170 </td></tr>
171 </table></div>
172
173 <h2>Percent Escape Handling</h2>
174
175 <p>If you request a percent escape such as <samp>%[key]</samp> the setting
176 is looked for in the following order until the first match has been
177 found...</p>
178
179 <ol>
180 <li>Handle special prefixes such as 'artifact:' 'option:' 'exif:', or
181 'fx:'. This includes and calculations and or globs of those prefixes such
182 as 'exif:*' or 'artifact:*' (see below).</li>
183
184 <li>If <samp>key</samp> contains a glob pattern (but no known prefix)
185 search free-form properties table.</li>
186
187 <li>If <samp>key</samp> is a special image 'attribute' name (see list
188 above) return the associated or calculated image attribute.</li>
189
190 <li>Search for setting as a free-form 'property'</li>
191 <li>Search for setting as a free-form 'artifact'</li>
192 <li>Search for setting as a free-form 'option'</li>
193
194 <li>Replace escape with empty string, and perhaps produce a warning.</li>
195 </ol>
196
197 <p>Remember, all long name forms of percent escapes are handled in a is case
198 insensitive manner. </p>
199
200 <p>You can now access the Artifact and Option
201 free-form string tables directly, allowing you to override the above sequence,
202 and avoid accessing an attribute or property of the same name.</p>
203
204 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><samp>%[artifact:<var>setting</var>]
205 %[option:<var>setting</var>] </samp></pre>
206
207 <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>
208
209 <h2>Single Letter Attribute Percent Escapes</h2>
210
211 <p>Here are common single letter escapes (short form) is used to report the most
212 common attributes and properties of an image, such as: the image filename
213 filename, type, width, height. </p>
214
215 <div>
216 <table class="table table-sm table-hover table-striped table-responsive">
217 <tr>
218 <td>\</td>
219 <td>backslash, the next character is literal and not subject to interpretation</td>
220 </tr>
221 <tr>
222 <td>\n</td>
223 <td>newline</td>
224 </tr>
225 <tr>
226 <td>\r</td>
227 <td>carriage return</td>
228 </tr>
229 <tr>
230 <td>&lt;</td>
231 <td>less-than character.</td>
232 </tr>
233 <tr>
234 <td>&gt;</td>
235 <td>greater-than character.</td>
236 </tr>
237 <tr>
238 <td>&amp;</td>
239 <td>ampersand character.</td>
240 </tr>
241 <tr>
242 <td>%%</td>
243 <td>a percent sign</td>
244 </tr>
245 <tr>
246 <td>%b</td>
247 <td>file size of image read in (use <a href="#precision">-precision</a> 16 to force results in B)</td>
248 </tr>
249 <tr>
250 <td>%c</td>
251 <td>comment meta-data property</td>
252 </tr>
253 <tr>
254 <td>%d</td>
255 <td>directory component of path</td>
256 </tr>
257 <tr>
258 <td>%e</td>
259 <td>filename extension or suffix</td>
260 </tr>
261 <tr>
262 <td>%f</td>
263 <td>filename (including suffix)</td>
264 </tr>
265 <tr>
266 <td>%g</td>
267 <td>layer canvas page geometry (equivalent to "%Wx%H%X%Y")</td>
268 </tr>
269 <tr>
270 <td>%h</td>
271 <td>current image height in pixels</td>
272 </tr>
273 <tr>
274 <td>%i</td>
275 <td>image filename (note: becomes output filename for "info:")</td>
276 </tr>
277 <tr>
278 <td>%k</td>
279 <td>CALCULATED: number of unique colors</td>
280 </tr>
281 <tr>
282 <td>%l</td>
283 <td>label meta-data property</td>
284 </tr>
285 <tr>
286 <td>%m</td>
287 <td>image file format (file magic)</td>
288 </tr>
289 <tr>
290 <td>%n</td>
291 <td>number of images in current image sequence, report once per frame</td>
292 </tr>
293 <tr>
294 <td>%o</td>
295 <td>output filename (used for delegates)</td>
296 </tr>
297 <tr>
298 <td>%p</td>
299 <td>index of image in current image list</td>
300 </tr>
301 <tr>
302 <td>%q</td>
303 <td>quantum depth (compile-time constant)</td>
304 </tr>
305 <tr>
306 <td>%r</td>
307 <td>image class and colorspace</td>
308 </tr>
309 <tr>
310 <td>%s</td>
311 <td>scene number (from input unless re-assigned)</td>
312 </tr>
313 <tr>
314 <td>%t</td>
315 <td>filename without directory or extension (suffix)</td>
316 </tr>
317 <tr>
318 <td>%u</td>
319 <td>unique temporary filename (used for delegates)</td>
320 </tr>
321 <tr>
322 <td>%w</td>
323 <td>current width in pixels</td>
324 </tr>
325 <tr>
326 <td>%x</td>
327 <td>x resolution (density)</td>
328 </tr>
329 <tr>
330 <td>%y</td>
331 <td>y resolution (density)</td>
332 </tr>
333 <tr>
334 <td>%z</td>
335 <td>image depth (as read in unless modified, image save depth)</td>
336 </tr>
337 <tr>
338 <td>%A</td>
339 <td>image transparency channel. Values include Undefined (no transparency channel), Blend, Copy, or Update. </td>
340 </tr>
341 <tr>
342 <td>%B</td>
343 <td>file size of image read in bytes</td>
344 </tr>
345 <tr>
346 <td>%C</td>
347 <td>image compression type</td>
348 </tr>
349 <tr>
350 <td>%D</td>
351 <td>image GIF dispose method</td>
352 </tr>
353 <tr>
354 <td>%G</td>
355 <td>original image size (%wx%h; before any resizes)</td>
356 </tr>
357 <tr>
358 <td>%H</td>
359 <td>page (canvas) height</td>
360 </tr>
361 <tr>
362 <td>%M</td>
363 <td>Magick filename (original file exactly as given, including read mods)</td>
364 </tr>
365 <tr>
366 <td>%N</td>
367 <td>number of images in current image sequence, report once per image sequence</td>
368 </tr>
369 <tr>
370 <td>%O</td>
371 <td>page (canvas) offset ( = %X%Y )</td>
372 </tr>
373 <tr>
374 <td>%P</td>
375 <td>page (canvas) size ( = %Wx%H )</td>
376 </tr>
377 <tr>
378 <td>%Q</td>
379 <td>image compression quality ( 0 = default )</td>
380 </tr>
381 <tr>
382 <td>%S</td>
383 <td>?? scenes ??</td>
384 </tr>
385 <tr>
386 <td>%T</td>
387 <td>image time delay (in centi-seconds)</td>
388 </tr>
389 <tr>
390 <td>%U</td>
391 <td>image resolution units</td>
392 </tr>
393 <tr>
394 <td>%W</td>
395 <td>page (canvas) width</td>
396 </tr>
397 <tr>
398 <td>%X</td>
399 <td>page (canvas) x offset (including sign)</td>
400 </tr>
401 <tr>
402 <td>%Y</td>
403 <td>page (canvas) y offset (including sign)</td>
404 </tr>
405 <tr>
406 <td>%Z</td>
407 <td>unique filename (used for delegates)</td>
408 </tr>
409 <tr>
410 <td>%@</td>
411 <td>CALCULATED: trim bounding box (without actually trimming)</td>
412 </tr>
413 <tr>
414 <td>%#</td>
415 <td>CALCULATED: 'signature' hash of image values</td>
416 </tr>
417 </table></div>
418
419 <p>Here is a sample command and its output for an image with filename
420 <samp>bird.miff</samp> and whose width is 512 and height is 480.</p>
421
422 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><samp>-> identify -format "%m:%f %wx%h" bird.miff
423 MIFF:bird.miff 512x480 </samp></pre>
424
425 <p>Note that all single letter percent escapes can also be used using long
426 form (from IM version 6.7.6-9, see next). For example <samp>%[f]</samp> is
427 equivalent to the <samp>%f</samp> short form. </p>
428
429 <p><b>WARNING</b>: short form percent escapes are NOT performed when the percent
430 is after a number. For example, <samp>10%x10</samp> does not expand the
431 <samp>%x</samp> as a percent escape. If you specifically want to expand the
432 'x', use the long form which overrides this special case. EG:
433 <samp>10%[x]10</samp>. </p>
434
435 <p>Also be warned that calculated attributes can take some time to generate,
436 especially for large images.</p>
437
438 <h2>Long Form Attribute Percent Escapes</h2>
439
440 <p>In addition to the above specific and calculated attributes are recognized
441 when enclosed in braces (long form):</p>
442
443 <div>
444 <table class="table table-sm table-hover table-striped table-responsive">
445 <tr>
446 <td>%[basename]</td>
447 <td>base filename, no suffixes (as %t)</td>
448 </tr>
449 <tr>
450 <td>%[bit-depth]</td>
451 <td>Actual bit-depth of the pixel data</td>
452 </tr>
453 <tr>
454 <td>%[bounding-box]</td>
455 <td>upper left and lower right corners of the image bounding box</td>
456 </tr>
457 <tr>
458 <td>%[caption]</td>
459 <td>caption meta-data property</td>
460 </tr>
461 <tr>
462 <td>%[caption:lines]</td>
463 <td>returns the number lines generated when wrapping the caption</td>
464 </tr>
465 <tr>
466 <td>%[caption:pointsize]</td>
467 <td>returns the pointsize computed during caption: processing</td>
468 </tr>
469 <tr>
470 <td>%[channels]</td>
471 <td>colorspace neumonic followed by total number of channels and meta channels, 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>
472 </tr>
473 <tr>
474 <td>%[colors]</td>
475 <td>Number of unique colors in the image (as of IM 7.0.3.8)</td>
476 </tr>
477 <tr>
478 <td>%[colorspace]</td>
479 <td>colorspace of Image Data (excluding transparency)</td>
480 </tr>
481 <tr>
482 <td>%[compose]</td>
483 <td> </td>
484 </tr>
485 <tr>
486 <td>%[compression]</td>
487 <td>image compression type</td>
488 </tr>
489 <tr>
490 <td><a href="convex-hull.html">%[convex-hull]</a></td>
491 <td>points that form a convex hull around the foreground object. Use <samp><a href="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="command-line-options.html#fuzz">-fuzz</a> to allow for a non-uniform background color. </samp></td>
492 </tr>
493 <tr>
494 <td><a href="convex-hull.html">%[convex-hull:extreme-points]</a></td>
495 <td>return the top, right, bottom, and left extreme points of the convex hull.</td>
496 </tr>
497 <tr>
498 <td>%[copyright]</td>
499 <td>ImageMagick Copyright String</td>
500 </tr>
501 <tr>
502 <td>%[depth]</td>
503 <td>depth of image for write (as input unless changed)</td>
504 </tr>
505 <tr>
506 <td>%[deskew:angle]</td>
507 <td>The deskew angle in degrees of rotation</td>
508 </tr>
509 <tr>
510 <td>%[directory]</td>
511 <td>directory part of filename (as %d)</td>
512 </tr>
513 <tr>
514 <td>%[distortion]</td>
515 <td>how well an image resembles a reference image (<a href="command-line-options.html#compare" >-compare</a>)</td>
516 </tr>
517 <tr>
518 <td>%[dominant-color]</td>
519 <td>return the dominate image color in hex. Precede usage with <a href="command-line-options.html#kmeans" >-kmeans</a>.</td>
520 </tr>
521 <tr>
522 <td>%[entropy]</td>
523 <td>CALCULATED: entropy of the image</td>
524 </tr>
525 <tr>
526 <td>%[extension]</td>
527 <td>extension part of filename (as %e)</td>
528 </tr>
529 <tr>
530 <td>%[gamma]</td>
531 <td>value of image gamma</td>
532 </tr>
533 <tr>
534 <td>%[group]</td>
535 <td>??? window group ???</td>
536 </tr>
537 <tr>
538 <td>%[height]</td>
539 <td>original height of image (when it was read in)</td>
540 </tr>
541 <tr>
542 <td>%[histogram:contrast-stretch]</td>
543 <td>computed min and max contrast stretch percentage</td>
544 </tr>
545 <tr>
546 <td>%[histogram:linear-stretch]</td>
547 <td>computed min and max linear stretch percentage</td>
548 </tr>
549 <tr>
550 <td>%[input]</td>
551 <td> </td>
552 </tr>
553 <tr>
554 <td>%[interlace]</td>
555 <td>Image interlace mode (as of IM 7.0.3.8)</td>
556 </tr>
557 <tr>
558 <td>%[kurtosis]</td>
559 <td>CALCULATED: kurtosis statistic of image</td>
560 </tr>
561 <tr>
562 <td>%[label]</td>
563 <td>label meta-data property</td>
564 </tr>
565 <tr>
566 <td>%[label:pointsize]</td>
567 <td>returns the pointsize computed during label: processing</td>
568 </tr>
569 <tr>
570 <td>%[magick]</td>
571 <td>coder used to read image (not the file suffix)</td>
572 </tr>
573 <tr>
574 <td>%[max]</td>
575 <td>CALCULATED: maximum value statistic of image</td>
576 </tr>
577 <tr>
578 <td>%[mean]</td>
579 <td>CALCULATED: average value statistic of image</td>
580 </tr>
581 <tr>
582 <td>%[median]</td>
583 <td>CALCULATED: median value statistic of image</td>
584 </tr>
585 <tr>
586 <td>%[min]</td>
587 <td>CALCULATED: minimum value statistic of image</td>
588 </tr>
589 <tr>
590 <td><a href="convex-hull.html">%[minimum-bounding-box]</a></td>
591 <td>Use <samp><a href="command-line-options.html#define">-define</a> convex-hull:background-color=<em>color</em></samp> to identify the image background color. Use <a href="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>
592 </tr>
593 <tr>
594 <td>%[opaque]</td>
595 <td>CALCULATED: is image fully-opaque?</td>
596 </tr>
597 <tr>
598 <td>%[orientation]</td>
599 <td>image orientation</td>
600 </tr>
601 <tr>
602 <td>%[page]</td>
603 <td>Virtual canvas (page) geometry</td>
604 </tr>
605 <tr>
606 <td>%[papersize:<em>name</em>]</td>
607 <td>paper size for <em>name</em> in pixels at 72DPI (e.g. papersize:A4)</td>
608 </tr>
609 <tr>
610 <td>%[printsize.x]</td>
611 <td>X printsize</td>
612 </tr>
613 <tr>
614 <td>%[printsize.y]</td>
615 <td>Y printsize</td>
616 </tr>
617 <tr>
618 <td>%[profile:icc]</td>
619 <td>ICC profile info</td>
620 </tr>
621 <tr>
622 <td>%[profile:icm]</td>
623 <td>ICM profile info</td>
624 </tr>
625 <tr>
626 <td>%[profiles]</td>
627 <td>list of any embedded profiles</td>
628 </tr>
629 <tr>
630 <td>%[quality]</td>
631 <td>Image quality value (as of IM 7.0.3.8)</td>
632 </tr>
633 <tr>
634 <td>%[rendering-intent]</td>
635 <td>Image rendering intent (as of IM 7.0.3.8)</td>
636 </tr>
637 <tr>
638 <td>%[resolution.x]</td>
639 <td>X density (resolution) without units</td>
640 </tr>
641 <tr>
642 <td>%[resolution.y]</td>
643 <td>Y density (resolution) without units</td>
644 </tr>
645 <tr>
646 <td>%[scene]</td>
647 <td>original scene number of image in input file</td>
648 </tr>
649 <tr>
650 <td>%[size]</td>
651 <td>original size of image (when it was read in)</td>
652 </tr>
653 <tr>
654 <td>%[skewness]</td>
655 <td>CALCULATED: skewness statistic of image</td>
656 </tr>
657 <tr>
658 <td>%[standard-deviation]</td>
659 <td>CALCULATED: standard deviation statistic of image</td>
660 </tr>
661 <tr>
662 <td>%[type]</td>
663 <td>CALCULATED: image type</td>
664 </tr>
665 <tr>
666 <td>%[unique]</td>
667 <td>unique temporary filename ???</td>
668 </tr>
669 <tr>
670 <td>%[units]</td>
671 <td>image resolution units</td>
672 </tr>
673 <tr>
674 <td>%[version]</td>
675 <td>Version Information of this running ImageMagick</td>
676 </tr>
677 <tr>
678 <td>%[width]</td>
679 <td>original width of image (when it was read in)</td>
680 </tr>
681 <tr>
682 <td>%[zero]</td>
683 <td>zero (unique filename for delegate use)</td>
684 </tr>
685 </table></div>
686
687 <h2>Properties</h2>
688
689 <p>All other long forms of percent escapes (not single letter long form) are
690 handled in a case insensitive manner. Such escapes will attempt to look
691 up that name specific data sources. </p>
692
693 <p>The primary search space (if not a specific attribute listed above) is
694 a free-form property string. Such strings are associated and saved with
695 images, and are typically set using either the <a href="command-line-options.html#set" >-set</a>
696 CLI option (or API equivalent), or from special convenience options
697 (such as <a href="command-line-options.html#label"
698 >-label</a>, <a href="command-line-options.html#comment"
699 >-comment</a>, <a href="command-line-options.html#caption"
700 >-caption</a>). </p>
701
702 <p>These convenience options are globally saved (as 'global options' so they can
703 be set before images are read), and later are transferred to the property of
704 individual images, only when they are read in. At that time any internal
705 percent escape present is then handled. </p>
706
707 <p>To change a property of an image already in memory, you need to use <a
708 href="command-line-options.html#set" >-set</a>.
709 </p>
710
711 <p>Note that properties, like attributes (and profiles), are saved with
712 images when write, if the image file format allows. </p>
713
714
715 <h2>Artifacts and Options</h2>
716
717 <p>The previous percent escapes are associated with the primary Attributes and
718 Properties. Which is the original and primary focus of such percent escapes.
719 </p>
720
721 <p>However there are many operational settings that are used by various
722 ImageMagick operators that can be useful to set and later access. These
723 consist of per-image Artifacts, and Global options (associated with a list of
724 images, typically the current image list).</p>
725
726 <p>Note that the major difference between an artifact and a property is that
727 artifacts, being an internal operational setting, is not saved with images (if
728 such is possible). </p>
729
730 <p>For example when you use <samp>-define 'distort:viewport=100x100'</samp> you
731 are in fact generating a global option, which the <a href="command-line-options.html#distort"
732 >-distort</a> operator will use to modify its behavior (distorted output
733 image 'view'). </p>
734
735 <p>An Option is essentially an Artifact that has been stored globally as part
736 of a list of images (specifically a 'Wand' of images). As such they are
737 identical, in that a Option, is simply a global Artifact for all the
738 associated images. </p>
739
740 <p>As such you can use <samp>-set 'option:distort:viewport' '100x100'</samp> to
741 achieve the same result of setting a Artifact for the disort operation to use.
742 </p>
743
744 <p><b>Internal Handling of a Global Option...</b></p>
745
746 <p>The Core library ('MagickCore') does not generally directly understand
747 Global Options. As such, continuing the previous example, the
748 <samp>DistortImages()</samp> function only looks up an artifact to discover if
749 a 'viewport' has been provided to it. </p>
750
751 <p>How Global Options are used when a library function requests an Artifact is
752 one of the key differences between IMv6 and IMv7.</p>
753
754 <p>Sets a link back to the global options
755 data, so that if a specific per-image Artifact is not found , then it will
756 look for a equivalent global Option for that image list. directly. This
757 saves coping these free-form options into artifacts repeatedly, and means you
758 can now separately define a global option for a list, and a individual
759 overriding artifact for a specific image in that list. </p>
760
761 <p>Note that many API's that do not use Wands (PerlMagick for example using
762 arrays of images rather than a Wand). In these API's you will not have Global
763 Options, only per-image Artifacts. </p>
764
765 <p>In summery a Global Option, if available, is equivalent to a per-image
766 Artifact. </p>
767
768
769 <h2>Glob-Pattern Listing of Properties, Artifacts and Options</h2>
770
771 <p>The <var>setting</var> can contain a glob pattern. As such you can
772 now list all free-form string properties, artifacts, and options, (but not
773 specific image attributes) using...</p>
774
775 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>magick ... \
776 -print "__Properties__\n%[*]" \
777 -print "__Artifacts__\n%[artifact:*]" \
778 -print "__Options__\n%[option:*]" \
779 ... </samp></pre>
780
781 <p> The format of glob patterns are very specific and as such is generally
782 only used to list specific settings, such as when debugging, rather than being
783 used for image processing use. </p>
784
785
786 <h2>Calculated Percent Escape Prefixes</h2>
787
788 <p>There are some special prefixes (before the first ':') which performs
789 calculations based on the user provided string that follows that prefix. For
790 example you can do a numerical calculation use <samp>%[fx:...]</samp> to
791 evaluate the given <a href="fx.html">FX</a> expressions:</p>
792
793 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><samp>%[fx:<var>expression</var>] </samp></pre>
794
795 <p>Use <samp>pixel:</samp> or <samp>hex:</samp> to evaluate a pixel color as defined by the <a
796 href="fx.html">FX</a>
797 expression:</p>
798
799 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><samp>%[pixel:<var>expression</var>] </samp></pre>
800
801 <p>Use <a href="command-line-options.html#define">-define</a> to specify the color compliance (e.g. <samp>-define pixel:compliance=css</samp>)</p>.
802
803 <h2>Specific Profile Percent Escape Prefixes</h2>
804
805 <p>You can also use the following special formatting syntax to print EXIF
806 mage meta-data that was included in the image read in:</p>
807
808 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><samp>%[EXIF:<var>tag</var>] </samp></pre>
809
810 <p>Choose <var>tag</var> from the following:</p>
811
812 <pre class="pre-scrollable p-3 mb-2 text-body-secondary bg-body-tertiary"><samp>
813 * (print all EXIF tags, in keyword=data format)
814 ! (print all EXIF tags, in tag_number data format)
815 #hhhh (print data for EXIF tag #hhhh)
816 ImageWidth
817 ImageLength
818 BitsPerSample
819 Compression
820 PhotometricInterpretation
821 FillOrder
822 DocumentName
823 ImageDescription
824 Make
825 Model
826 StripOffsets
827 Orientation
828 SamplesPerPixel
829 RowsPerStrip
830 StripByteCounts
831 XResolution
832 YResolution
833 PlanarConfiguration
834 ResolutionUnit
835 TransferFunction
836 Software
837 DateTime
838 Artist
839 WhitePoint
840 PrimaryChromaticities
841 TransferRange
842 JPEGProc
843 JPEGInterchangeFormat
844 JPEGInterchangeFormatLength
845 YCbCrCoefficients
846 YCbCrSubSampling
847 YCbCrPositioning
848 ReferenceBlackWhite
849 CFARepeatPatternDim
850 CFAPattern
851 BatteryLevel
852 Copyright
853 ExposureTime
854 FNumber
855 IPTC/NAA
856 EXIFOffset
857 InterColorProfile
858 ExposureProgram
859 SpectralSensitivity
860 GPSInfo
861 ISOSpeedRatings
862 OECF
863 EXIFVersion
864 DateTimeOriginal
865 DateTimeDigitized
866 ComponentsConfiguration
867 CompressedBitsPerPixel
868 ShutterSpeedValue
869 ApertureValue
870 BrightnessValue
871 ExposureBiasValue
872 MaxApertureValue
873 SubjectDistance
874 MeteringMode
875 LightSource
876 Flash
877 FocalLength
878 MakerNote
879 UserComment
880 SubSecTime
881 SubSecTimeOriginal
882 SubSecTimeDigitized
883 FlashPixVersion
884 ColorSpace
885 EXIFImageWidth
886 EXIFImageLength
887 InteroperabilityOffset
888 FlashEnergy
889 SpatialFrequencyResponse
890 FocalPlaneXResolution
891 FocalPlaneYResolution
892 FocalPlaneResolutionUnit
893 SubjectLocation
894 ExposureIndex
895 SensingMethod
896 FileSource
897 SceneType </samp></pre>
898 <br/>
899 <p>Surround the format specification with quotation marks to prevent your
900 shell from misinterpreting any spaces and square brackets.</p>
901
902 <p>The following special formatting syntax can be used to print IPTC
903 information contained in the file:</p>
904
905 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><samp>%[IPTC:<var>dataset</var>:<var>record</var>] </samp></pre>
906
907 <p>Select <var>dataset</var> and <var>record</var> from the following:</p>
908
909 <pre class="pre-scrollable p-3 mb-2 text-body-secondary bg-body-tertiary text-body-secondary bg-body-tertiary:"><samp>
910 Envelope Record
911 1:00 Model Version
912 1:05 Destination
913 1:20 File Format
914 1:22 File Format Version
915 1:30 Service Identifier
916 1:40 Envelope Number
917 1:50 Product ID
918 1:60 Envelope Priority
919 1:70 Date Sent
920 1:80 Time Sent
921 1:90 Coded Character Set
922 1:100 UNO (Unique Name of Object)
923 1:120 ARM Identifier
924 1:122 ARM Version
925
926 Application Record
927 2:00 Record Version
928 2:03 Object Type Reference
929 2:05 Object Name (Title)
930 2:07 Edit Status
931 2:08 Editorial Update
932 2:10 Urgency
933 2:12 Subject Reference
934 2:15 Category
935 2:20 Supplemental Category
936 2:22 Fixture Identifier
937 2:25 Keywords
938 2:26 Content Location Code
939 2:27 Content Location Name
940 2:30 Release Date
941 2:35 Release Time
942 2:37 Expiration Date
943 2:38 Expiration Time
944 2:40 Special Instructions
945 2:42 Action Advised
946 2:45 Reference Service
947 2:47 Reference Date
948 2:50 Reference Number
949 2:55 Date Created
950 2:60 Time Created
951 2:62 Digital Creation Date
952 2:63 Digital Creation Time
953 2:65 Originating Program
954 2:70 Program Version
955 2:75 Object Cycle
956 2:80 By-Line (Author)
957 2:85 By-Line Title (Author Position) [Not used in Photoshop 7]
958 2:90 City
959 2:92 Sub-Location
960 2:95 Province/State
961 2:100 Country/Primary Location Code
962 2:101 Country/Primary Location Name
963 2:103 Original Transmission Reference
964 2:105 Headline
965 2:110 Credit
966 2:115 Source
967 2:116 Copyright Notice
968 2:118 Contact
969 2:120 Caption/Abstract
970 2:122 Caption Writer/Editor
971 2:125 Rasterized Caption
972 2:130 Image Type
973 2:131 Image Orientation
974 2:135 Language Identifier
975 2:150 Audio Type
976 2:151 Audio Sampling Rate
977 2:152 Audio Sampling Resolution
978 2:153 Audio Duration
979 2:154 Audio Outcue
980 2:200 ObjectData Preview File Format
981 2:201 ObjectData Preview File Format Version
982 2:202 ObjectData Preview Data
983
984 Pre-ObjectData Descriptor Record
985 7:10 Size Mode
986 7:20 Max Subfile Size
987 7:90 ObjectData Size Announced
988 7:95 Maximum ObjectData Size
989
990 ObjectData Record
991 8:10 Subfile
992
993 Post ObjectData Descriptor Record
994 9:10 Confirmed ObjectData Size</samp></pre>
995 </div>
996 </main><!-- /.container -->
997 <footer class="text-center pt-5 my-5 text-body-secondary border-top">
998 <div class="container-fluid">
999 <a href="security-policy.html">Security</a> •
1000 <a href="news.html">News</a>
1001
1002 <a href="#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../images/wand.ico"/></a>
1003
1004 <a href="links.html">Related</a> •
1005 <a href="sitemap.html">Sitemap</a>
1006 <br/>
1007 <a href="support.html">Sponsor</a> •
1008 <a href="cite.html">Cite</a> •
1009 <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
1010 <a href="../www/../www/../www/../www/https://imagemagick.org/script/contact.php">Contact Us</a>
1011 <br/>
1012 <a href="https://github.com/imagemagick/imagemagick" rel="noopener" target="_blank" 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> •
1013 <a href="https://twitter.com/imagemagick" rel="noopener" target="_blank" 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>
1014 <br/>
1015 <small>Copyright © 1999 ImageMagick Studio LLC</small>
1016 </div>
1017 </footer>
1018 </div>
1019
1020 <!-- Javascript assets -->
1021 <script src="assets/bootstrap.bundle.min.js" ></script>
1022 </body>
1023 </html>
1024 <!-- Magick Cache 1st March 2025 17:03 -->