Debian Codegraph @

www/escape/index.html

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