Debian Codegraph @

www/escape.html

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