• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2
3
4
5<!doctype html>
6<html lang="en">
7<head>
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="application-name" content="ImageMagick" />
12  <meta name="description" content="Use ImageMagick® to create, edit, compose, and convert digital images. Resize an image, crop it, change its shades and colors, add captions, and more." />
13  <meta name="application-url" content="https://imagemagick.org" />
14  <meta name="generator" content="PHP" />
15  <meta name="keywords" content="format, print, image, properties, image processing software" />
16  <meta name="rating" content="GENERAL" />
17  <meta name="robots" content="INDEX, FOLLOW" />
18  <meta name="generator" content="ImageMagick Studio LLC" />
19  <meta name="author" content="ImageMagick Studio LLC" />
20  <meta name="revisit-after" content="2 DAYS" />
21  <meta name="resource-type" content="document" />
22  <meta name="copyright" content="Copyright (c) 1999-2020 ImageMagick Studio LLC" />
23  <meta name="distribution" content="Global" />
24  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" />
25  <meta property='og:url' content='../' />
26  <meta property='og:title' content='ImageMagick' />
27  <meta property='og:image' content='../images/logo.png' />
28  <meta property='og:type' content='website' />
29  <meta property='og:site_name' content='ImageMagick' />
30  <meta property='og:description' content="Create, Edit, Compose, or Convert Digital Images" />
31  <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
32  <link href="escape.html" rel="canonical" />
33  <link href="../images/wand.png" rel="icon" />
34  <link href="../images/wand.ico" rel="shortcut icon" />
35  <link href="assets/magick.css" rel="stylesheet" />
36</head>
37<body>
38  <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
39  <div class="container-fluid">
40    <a class="navbar-brand" href="../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../images/wand.ico"/></a>
41    <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">
42      <span class="navbar-toggler-icon"></span>
43    </button>
44
45    <div class="collapse navbar-collapse" id="magick-navbars">
46      <ul class="navbar-nav me-auto mb-2 mb-md-0">
47        <li class="nav-item">
48          <a class="nav-link " href="../www/index.html">Home</a>
49        </li>
50        <li class="nav-item">
51          <a class="nav-link " href="../www/download.html">Download</a>
52        </li>
53        <li class="nav-item">
54          <a class="nav-link " href="../www/command-line-tools.html">Tools</a>
55        </li>
56        <li class="nav-item">
57          <a class="nav-link " href="../www/command-line-processing.html">CLI</a>
58        </li>
59        <li class="nav-item">
60          <a class="nav-link " href="../www/develop.html">Develop</a>
61        </li>
62        <li class="nav-item">
63          <a class="nav-link" target="_blank" href="https://github.com/ImageMagick/ImageMagick/discussions">Community</a>
64        </li>
65        <li class="nav-item">
66          <iframe src="https://github.com/sponsors/ImageMagick/button" title="Sponsor ImageMagick" height="35" width="107" style="border: 0;"></iframe>
67        </li>
68      </ul>
69      <form class="d-flex form-inline" action="search.html">
70        <input class="form-control me-2" type="text" name="q" placeholder="Search" aria-label="Search">
71        <button class="btn btn-outline-success" type="submit" name="sa">Search</button>
72      </form>
73    </div>
74  </div>
75  </nav>
76
77  <div class="container">
78    <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script>
79    <ins class="adsbygoogle"
80      style="display:block"
81      data-ad-client="ca-pub-3129977114552745"
82      data-ad-slot="6345125851"
83      data-full-width-responsive="true"
84      data-ad-format="horizontal"></ins>
85    <script>
86      (adsbygoogle = window.adsbygoogle || []).push({});
87    </script>
88
89  </div>
90
91  <main class="container">
92  <div class="magick-template">
93<div class="magick-header">
94<p class="lead magick-description">There are copious amounts of extra data associated with images (metadata), beyond the actual image pixels. This metadata can be useful, either for display, or for various calculations, or in modifying the behavior of later image processing operations.  You can utilize percent escapes in a number of options, for example in <a href="../www/command-line-options.html#format_identify_">-format</a> or in montage <a href="../www/command-line-options.html#label" >-label</a>, to print various properties and other settings associated with an image.</p>
95
96<div class="table-responsive" style="font-size:87.5% !important;">
97<table class="table table-hover">
98<tr>
99    <td><b>Profile Data</b></td>
100    <td>Such as EXIF: data, containing focal lengths, exposures, dates, and in
101        some cases GPS locations.
102    </td></tr>
103<tr>
104    <td><b>Attributes</b></td>
105    <td>These are directly involved with image data, and more commonly
106        modified as part of normal image processing.  These include
107        width, height, depth, image type (colorspace), timing delays, and
108        background color. Most specific percent escapes is to access this
109        information.
110    </td></tr>
111<tr>
112    <td><b>Properties</b></td>
113    <td>These are stored as a table of free form strings, and are (if possible)
114        saved with the image (especially in MIFF and PNG image file formats).
115        These include: Labels, Captions, Comments.
116    </td></tr>
117<tr>
118    <td><b>Artifacts</b></td>
119    <td>These are various operational (expert) settings that are saved for
120        use by various operators, or by the user for future use.  It is just
121        a table of free-form strings.  They are not saved with the image when
122        written.  See Artifacts and Options below for details.
123    </td></tr>
124<tr>
125    <td><b>Options</b></td>
126    <td>Also operational (expert) settings that are saved for
127        use by various operators, but are set globally for use by a whole
128        image list (also not saved).  See Artifacts and Options below.
129    </td></tr>
130</table></div>
131
132<h3>Percent Escape Handling</h3>
133
134<p>If you request a percent escape such as <code>%[key]</code> the setting
135is looked for in the following order until the first match has been
136found...</p>
137
138<ol>
139<li>Handle special prefixes such as 'artifact:' 'option:' 'exif:', or
140    'fx:'.  This includes and calculations and or globs of those prefixes such
141    as 'exif:*' or 'artifact:*' (see below).</li>
142
143<li>If <code>key</code> contains a glob pattern (but no known prefix)
144    search free-form properties table.</li>
145
146<li>If <code>key</code> is a special image 'attribute' name (see list
147    above) return the associated or calculated image attribute.</li>
148
149<li>Search for setting as a free-form 'property'</li>
150<li>Search for setting as a free-form 'artifact'</li>
151<li>Search for setting as a free-form 'option'</li>
152
153<li>Replace escape with empty string, and perhaps produce a warning.</li>
154</ol>
155
156<p>Remember, all long name forms of percent escapes are handled in a is case
157insensitive manner. </p>
158
159<p>You can now access the Artifact and Option
160free-form string tables directly, allowing you to override the above sequence,
161and avoid accessing an attribute or property of the same name.</p>
162
163<pre class="highlight"><code>%[artifact:<var>setting</var>]
164%[option:<var>setting</var>]
165</code></pre>
166
167<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, <code>magick -print "%[fx:.8765/3.14]" null: null:</code>.</p>
168
169<h3>Single Letter Attribute Percent Escapes</h3>
170
171<p>Here are common single letter escapes (short form) is used to report the most
172common attributes and properties of an image, such as: the image filename
173filename, type, width, height. </p>
174
175<div class="table-responsive" style="font-size:87.5% !important;">
176<table class="table table-sm table-hover">
177  <tr>
178    <td>\</td>
179    <td>backslash, the next character is literal and not subject to interpretation</td>
180  </tr>
181  <tr>
182    <td>\n</td>
183    <td>newline</td>
184  </tr>
185  <tr>
186    <td>\r</td>
187    <td>carriage return</td>
188  </tr>
189  <tr>
190    <td>&lt;</td>
191    <td>less-than character.</td>
192  </tr>
193  <tr>
194    <td>&gt;</td>
195    <td>greater-than character.</td>
196  </tr>
197  <tr>
198    <td>&amp;</td>
199    <td>ampersand character.</td>
200  </tr>
201  <tr>
202    <td>%%</td>
203    <td>a percent sign</td>
204  </tr>
205  <tr>
206    <td>%b</td>
207    <td>file size of image read in (use <a href="escape.html#precision">-precision</a> 16 to force results in B)</td>
208  </tr>
209  <tr>
210    <td>%c</td>
211    <td>comment meta-data property</td>
212  </tr>
213  <tr>
214    <td>%d</td>
215    <td>directory component of path</td>
216  </tr>
217  <tr>
218    <td>%e</td>
219    <td>filename extension or suffix</td>
220  </tr>
221  <tr>
222    <td>%f</td>
223    <td>filename (including suffix)</td>
224  </tr>
225  <tr>
226    <td>%g</td>
227    <td>layer canvas page geometry   (equivalent to "%Wx%H%X%Y")</td>
228  </tr>
229  <tr>
230    <td>%h</td>
231    <td>current image height in pixels</td>
232  </tr>
233  <tr>
234    <td>%i</td>
235    <td>image filename (note: becomes output filename for "info:")</td>
236  </tr>
237  <tr>
238    <td>%k</td>
239    <td>CALCULATED: number of unique colors</td>
240  </tr>
241  <tr>
242    <td>%l</td>
243    <td>label meta-data property</td>
244  </tr>
245  <tr>
246    <td>%m</td>
247    <td>image file format (file magic)</td>
248  </tr>
249  <tr>
250    <td>%n</td>
251    <td>number of images in current image sequence, report once per frame</td>
252  </tr>
253  <tr>
254    <td>%o</td>
255    <td>output filename  (used for delegates)</td>
256  </tr>
257  <tr>
258    <td>%p</td>
259    <td>index of image in current image list</td>
260  </tr>
261  <tr>
262    <td>%q</td>
263    <td>quantum depth (compile-time constant)</td>
264  </tr>
265  <tr>
266    <td>%r</td>
267    <td>image class and colorspace</td>
268  </tr>
269  <tr>
270    <td>%s</td>
271    <td>scene number (from input unless re-assigned)</td>
272  </tr>
273  <tr>
274    <td>%t</td>
275    <td>filename without directory or extension (suffix)</td>
276  </tr>
277  <tr>
278    <td>%u</td>
279    <td>unique temporary filename (used for delegates)</td>
280  </tr>
281  <tr>
282    <td>%w</td>
283    <td>current width in pixels</td>
284  </tr>
285  <tr>
286    <td>%x</td>
287    <td>x resolution (density)</td>
288  </tr>
289  <tr>
290    <td>%y</td>
291    <td>y resolution (density)</td>
292  </tr>
293  <tr>
294    <td>%z</td>
295    <td>image depth (as read in unless modified, image save depth)</td>
296  </tr>
297  <tr>
298    <td>%A</td>
299    <td>image transparency channel enabled (true/false)</td>
300  </tr>
301  <tr>
302    <td>%B</td>
303    <td>file size of image read in bytes</td>
304  </tr>
305  <tr>
306    <td>%C</td>
307    <td>image compression type</td>
308  </tr>
309  <tr>
310    <td>%D</td>
311    <td>image GIF dispose method</td>
312  </tr>
313  <tr>
314    <td>%G</td>
315    <td>original image size (%wx%h; before any resizes)</td>
316  </tr>
317  <tr>
318    <td>%H</td>
319    <td>page (canvas) height</td>
320  </tr>
321  <tr>
322    <td>%M</td>
323    <td>Magick filename (original file exactly as given,  including read mods)</td>
324  </tr>
325  <tr>
326    <td>%N</td>
327    <td>number of images in current image sequence, report once per image sequence</td>
328  </tr>
329  <tr>
330    <td>%O</td>
331    <td>page (canvas) offset ( = %X%Y )</td>
332  </tr>
333  <tr>
334    <td>%P</td>
335    <td>page (canvas) size ( = %Wx%H )</td>
336  </tr>
337  <tr>
338    <td>%Q</td>
339    <td>image compression quality ( 0 = default )</td>
340  </tr>
341  <tr>
342    <td>%S</td>
343    <td>?? scenes ??</td>
344  </tr>
345  <tr>
346    <td>%T</td>
347    <td>image time delay (in centi-seconds)</td>
348  </tr>
349  <tr>
350    <td>%U</td>
351    <td>image resolution units</td>
352  </tr>
353  <tr>
354    <td>%W</td>
355    <td>page (canvas) width</td>
356  </tr>
357  <tr>
358    <td>%X</td>
359    <td>page (canvas) x offset (including sign)</td>
360  </tr>
361  <tr>
362    <td>%Y</td>
363    <td>page (canvas) y offset (including sign)</td>
364  </tr>
365  <tr>
366    <td>%Z</td>
367    <td>unique filename (used for delegates)</td>
368  </tr>
369  <tr>
370    <td>%@</td>
371    <td>CALCULATED: trim bounding box (without actually trimming)</td>
372  </tr>
373  <tr>
374    <td>%#</td>
375    <td>CALCULATED: 'signature' hash of image values</td>
376  </tr>
377</table></div>
378
379<p>Here is a sample command and its output for an image with filename
380<code>bird.miff</code> and whose width is 512 and height is 480.</p>
381
382<pre class="highlight"><code>-> identify -format "%m:%f %wx%h" bird.miff
383MIFF:bird.miff 512x480
384</code></pre>
385
386<p>Note that all single letter percent escapes can also be used using long
387form (from IM version 6.7.6-9, see next). For example <code>%[f]</code> is
388equivalent to the <code>%f</code> short form. </p>
389
390<p><b>WARNING</b>: short form percent escapes are NOT performed when the percent
391is after a number.  For example,  <code>10%x10</code> does not expand the
392<code>%x</code> as a percent escape.  If you specifically want to expand the
393'x', use the long form which overrides this special case. EG:
394<code>10%[x]10</code>. </p>
395
396<p>Also be warned that calculated attributes can take some time to generate,
397especially for large images.</p>
398
399<h3>Long Form Attribute Percent Escapes</h3>
400
401<p>In addition to the above specific and calculated attributes are recognized
402when enclosed in braces (long form):</p>
403
404<div class="table-responsive" style="font-size:87.5% !important;">
405<table class="table table-sm table-hover">
406  <tr>
407    <td>%[basename]</td>
408    <td>base filename, no suffixes (as %t)</td>
409  </tr>
410  <tr>
411    <td>%[bit-depth]</td>
412    <td>Actual bit-depth of the pixel data</td>
413  </tr>
414  <tr>
415    <td>%[bounding-box]</td>
416    <td>upper left and lower right corners of the image bounding box</td>
417  </tr>
418  <tr>
419    <td>%[caption]</td>
420    <td>caption meta-data property</td>
421  </tr>
422  <tr>
423    <td>%[caption:lines]</td>
424    <td>returns the number lines generated when wrapping the caption</td>
425  </tr>
426  <tr>
427    <td>%[caption:pointsize]</td>
428    <td>returns the pointsize computed during caption: processing</td>
429  </tr>
430  <tr>
431    <td>%[channels]</td>
432    <td>??? channels in use - colorspace ???</td>
433  </tr>
434  <tr>
435    <td>%[colors]</td>
436    <td>Number of unique colors in the image (as of IM 7.0.3.8)</td>
437  </tr>
438  <tr>
439    <td>%[colorspace]</td>
440    <td>colorspace of Image Data (excluding transparency)</td>
441  </tr>
442  <tr>
443    <td>%[compose]</td>
444    <td> </td>
445  </tr>
446  <tr>
447    <td>%[compression]</td>
448    <td>image compression type</td>
449  </tr>
450  <tr>
451    <td><a href="convex-hull.html">%[convex-hull]</a></td>
452    <td>points that form a convex hull around the foreground object.  Use <code><a href="../www/command-line-options.html#define">-define</a> convex-hull:background-color=<em>color</em></code> to identify the image background color.  Use <code><a href="../www/command-line-options.html#fuzz">-fuzz</a> to allow for a non-uniform background color. </td>
453  </tr>
454  <tr>
455    <td>%[copyright]</td>
456    <td>ImageMagick Copyright String</td>
457  </tr>
458  <tr>
459    <td>%[depth]</td>
460    <td>depth of image for write (as input unless changed)</td>
461  </tr>
462  <tr>
463    <td>%[deskew:angle]</td>
464    <td>The deskew angle in degrees of rotation</td>
465  </tr>
466  <tr>
467    <td>%[directory]</td>
468    <td>directory part of filename (as %d)</td>
469  </tr>
470  <tr>
471    <td>%[distortion]</td>
472    <td>how well an image resembles a reference image (<a href="../www/command-line-options.html#compare" >-compare</a>)</td>
473  </tr>
474  <tr>
475    <td>%[entropy]</td>
476    <td>CALCULATED: entropy of the image</td>
477  </tr>
478  <tr>
479    <td>%[extension]</td>
480    <td>extension part of filename (as %e)</td>
481  </tr>
482  <tr>
483    <td>%[gamma]</td>
484    <td>value of image gamma</td>
485  </tr>
486  <tr>
487    <td>%[group]</td>
488    <td>??? window group ???</td>
489  </tr>
490  <tr>
491    <td>%[height]</td>
492    <td>original height of image (when it was read in)</td>
493  </tr>
494  <tr>
495    <td>%[input]</td>
496    <td> </td>
497  </tr>
498  <tr>
499    <td>%[interlace]</td>
500    <td>Image interlace mode (as of IM 7.0.3.8)</td>
501  </tr>
502  <tr>
503    <td>%[kurtosis]</td>
504    <td>CALCULATED: kurtosis statistic of image</td>
505  </tr>
506  <tr>
507    <td>%[label]</td>
508    <td>label meta-data property</td>
509  </tr>
510   <tr>
511    <td>%[label:pointsize]</td>
512    <td>returns the pointsize computed during label: processing</td>
513  </tr>
514  <tr>
515    <td>%[magick]</td>
516    <td>coder used to read image (not the file suffix)</td>
517  </tr>
518  <tr>
519    <td>%[max]</td>
520    <td>CALCULATED: maximum value statistic of image</td>
521  </tr>
522  <tr>
523    <td>%[mean]</td>
524    <td>CALCULATED: average value statistic of image</td>
525  </tr>
526  <tr>
527    <td>%[median]</td>
528    <td>CALCULATED: median value statistic of image</td>
529  </tr>
530  <tr>
531    <td>%[min]</td>
532    <td>CALCULATED: minimum value statistic of image</td>
533  </tr>
534  <tr>
535    <td><a href="convex-hull.html">%[minimum-bounding-box]</a></td>
536    <td>Use <code><a href="../www/command-line-options.html#define">-define</a> convex-hull:background-color=<em>color</em></code> to identify the image background color.  Use <code><a href="../www/command-line-options.html#fuzz">-fuzz</a> to allow for a non-uniform background color.  In addition to the bounding box points, these properties are set: <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>
537  </tr>
538  <tr>
539    <td>%[opaque]</td>
540    <td>CALCULATED: is image fully-opaque?</td>
541  </tr>
542  <tr>
543    <td>%[orientation]</td>
544    <td>image orientation</td>
545  </tr>
546  <tr>
547    <td>%[page]</td>
548    <td>Virtual canvas (page) geometry</td>
549  </tr>
550  <tr>
551    <td>%[papersize:<em>name</em>]</td>
552    <td>paper size for <em>name</em> in pixels at 72DPI (e.g. papersize:A4)</td>
553  </tr>
554  <tr>
555    <td>%[printsize.x]</td>
556    <td>X printsize</td>
557  </tr>
558  <tr>
559    <td>%[printsize.y]</td>
560    <td>Y printsize</td>
561  </tr>
562  <tr>
563    <td>%[profile:icc]</td>
564    <td>ICC profile info</td>
565  </tr>
566  <tr>
567    <td>%[profile:icm]</td>
568    <td>ICM profile info</td>
569  </tr>
570  <tr>
571    <td>%[profiles]</td>
572    <td>list of any embedded profiles</td>
573  </tr>
574  <tr>
575    <td>%[quality]</td>
576    <td>Image quality value (as of IM 7.0.3.8)</td>
577  </tr>
578  <tr>
579    <td>%[rendering-intent]</td>
580    <td>Image rendering intent (as of IM 7.0.3.8)</td>
581  </tr>
582  <tr>
583    <td>%[resolution.x]</td>
584    <td>X density (resolution) without units</td>
585  </tr>
586  <tr>
587    <td>%[resolution.y]</td>
588    <td>Y density (resolution) without units</td>
589  </tr>
590  <tr>
591    <td>%[scene]</td>
592    <td>original scene number of image in input file</td>
593  </tr>
594  <tr>
595    <td>%[size]</td>
596    <td>original size of image (when it was read in)</td>
597  </tr>
598  <tr>
599    <td>%[skewness]</td>
600    <td>CALCULATED: skewness statistic of image</td>
601  </tr>
602  <tr>
603    <td>%[standard-deviation]</td>
604    <td>CALCULATED: standard deviation statistic of image</td>
605  </tr>
606  <tr>
607    <td>%[type]</td>
608    <td>CALCULATED: image type</td>
609  </tr>
610  <tr>
611    <td>%[unique]</td>
612    <td>unique temporary filename ???</td>
613  </tr>
614  <tr>
615    <td>%[units]</td>
616    <td>image resolution units</td>
617  </tr>
618  <tr>
619    <td>%[version]</td>
620    <td>Version Information of this running ImageMagick</td>
621  </tr>
622  <tr>
623    <td>%[width]</td>
624    <td>original width of image (when it was read in)</td>
625  </tr>
626  <tr>
627    <td>%[zero]</td>
628    <td>zero (unique filename for delegate use)</td>
629  </tr>
630</table></div>
631
632<h3>Properties</h3>
633
634<p>All other long forms of percent escapes (not single letter long form) are
635handled in a case insensitive manner. Such escapes will attempt to look
636up that name specific data sources. </p>
637
638<p>The primary search space (if not a specific attribute listed above) is
639a free-form property string.  Such strings are associated and saved with
640images, and are typically set using either the <a href="../www/command-line-options.html#set" >-set</a>
641CLI option (or API equivalent), or from special convenience options
642(such as <a href="../www/command-line-options.html#label"
643>-label</a>, <a href="../www/command-line-options.html#comment"
644>-comment</a>, <a href="../www/command-line-options.html#caption"
645>-caption</a>). </p>
646
647<p>These convenience options are globally saved (as 'global options' so thay can
648be set before images are read), and later are transferred to the property of
649individual images, only when they are read in. At that time any internal
650percent escape present is then handled. </p>
651
652<p>To change a property of an image already in memory, you need to use <a
653href="../www/command-line-options.html#set" >-set</a>.
654</p>
655
656<p>Note that properties, like attributes (and profiles), are saved with
657images when write, if the image file format allows. </p>
658
659
660<h3>Artifacts and Options</h3>
661
662<p>The previous percent escapes are associated with the primary Attributes and
663Properties. Which is the original and primary focus of such percent escapes.
664</p>
665
666<p>However there are many operational settings that are used by various
667ImageMagick operators that can be useful to set and later access.  These
668consist of per-image Artifacts, and Global options (associated with a list of
669images, typically the current image list).</p>
670
671<p>Note that the major difference between an artifact and a property is that
672artifacts, being an internal operational setting, is not saved with images (if
673such is possible). </p>
674
675<p>For example when you use <code>-define 'distort:viewport=100x100'</code> you
676are in fact generating a global option, which the <a href="../www/command-line-options.html#distort"
677>-distort</a> operator will use to modify its behavior (distorted output
678image 'view'). </p>
679
680<p>An Option is essentially an Artifact that has been stored globally as part
681of a list of images (specifically a 'Wand' of images). As such they are
682identical, in that a Option, is simply a global Artifact for all the
683associated images. </p>
684
685<p>As such you can use <code>-set 'option:distort:viewport' '100x100'</code> to
686achieve the same result of setting a Artifact for the disort operation to use.
687</p>
688
689<p><b>Internal Handling of a Global Option...</b></p>
690
691<p>The Core library ('MagickCore') does not generally directly understand
692Global Options. As such, continuing the previous example, the
693<code>DistortImages()</code> function only looks up an artifact to discover if
694a 'viewport' has been provided to it. </p>
695
696<p>How Global Options are used when a library function requests an Artifact is
697one of the key differences between IMv6 and IMv7.</p>
698
699<p>Sets a link back to the global options
700data, so that if a specific per-image Artifact is not found , then it will
701look for a equivalent global Option for that image list.  directly.  This
702saves coping these free-form options into artifacts repeatedly, and means you
703can now separately define a global option for a list, and a individual
704overriding artifact for a specific image in that list. </p>
705
706<p>Note that many API's that do not use Wands (PerlMagick for example using
707arrays of images rather than a Wand). In these API's you will not have Global
708Options, only per-image Artifacts. </p>
709
710<p>In summery a Global Option, if available, is equivalent to a per-image
711Artifact. </p>
712
713
714<h3>Glob-Pattern Listing of Properties, Artifacts and Options</h3>
715
716<p>The <var>setting</var> can contain a glob pattern. As such you can
717now list all free-form string properties, artifacts, and options, (but not
718specific image attributes) using...</p>
719
720<pre class="highlight"><code>magick ... \
721   -print "__Properties__\n%[*]" \
722   -print "__Artifacts__\n%[artifact:*]" \
723   -print "__Options__\n%[option:*]" \
724   ...
725</code></pre>
726
727<p> The format of glob patterns are very specific and as such is generally
728only used to list specific settings, such as when debugging, rather than being
729used for image processing use. </p>
730
731
732<h3>Calculated Percent Escape Prefixes</h3>
733
734<p>There are some special prefixes (before the first ':') which performs
735calculations based on the user provided string that follows that prefix.  For
736example you can do a numerical calculation use <code>%[fx:...]</code> to
737evaluate the given <a href="fx.html">FX</a> expressions:</p>
738
739<pre class="highlight"><code>%[fx:<var>expression</var>]
740</code></pre>
741
742<p>Use <code>pixel:</code> or <code>hex:</code> to evaluate a pixel color as defined by the <a
743href="fx.html">FX</a>
744expression:</p>
745
746<pre class="highlight"><code>%[pixel:<var>expression</var>]
747</code></pre>
748
749<p>Use <a href="../www/command-line-options.html#define">-define</a> to specify the color compliance (e.g. <code>-define pixel:compliance=css</code>)</p>.
750
751<h3>Specific Profile Percent Escape Prefixes</h3>
752
753<p>You can also use the following special formatting syntax to print EXIF
754mage meta-data that was included in the image read in:</p>
755
756<pre class="highlight"><code>%[EXIF:<var>tag</var>]
757</code></pre>
758
759<p>Choose <var>tag</var> from the following:</p>
760
761<pre class="pre-scrollable highlight"><code>
762*  (print all EXIF tags, in keyword=data format)
763!  (print all EXIF tags, in tag_number data format)
764#hhhh (print data for EXIF tag #hhhh)
765ImageWidth
766ImageLength
767BitsPerSample
768Compression
769PhotometricInterpretation
770FillOrder
771DocumentName
772ImageDescription
773Make
774Model
775StripOffsets
776Orientation
777SamplesPerPixel
778RowsPerStrip
779StripByteCounts
780XResolution
781YResolution
782PlanarConfiguration
783ResolutionUnit
784TransferFunction
785Software
786DateTime
787Artist
788WhitePoint
789PrimaryChromaticities
790TransferRange
791JPEGProc
792JPEGInterchangeFormat
793JPEGInterchangeFormatLength
794YCbCrCoefficients
795YCbCrSubSampling
796YCbCrPositioning
797ReferenceBlackWhite
798CFARepeatPatternDim
799CFAPattern
800BatteryLevel
801Copyright
802ExposureTime
803FNumber
804IPTC/NAA
805EXIFOffset
806InterColorProfile
807ExposureProgram
808SpectralSensitivity
809GPSInfo
810ISOSpeedRatings
811OECF
812EXIFVersion
813DateTimeOriginal
814DateTimeDigitized
815ComponentsConfiguration
816CompressedBitsPerPixel
817ShutterSpeedValue
818ApertureValue
819BrightnessValue
820ExposureBiasValue
821MaxApertureValue
822SubjectDistance
823MeteringMode
824LightSource
825Flash
826FocalLength
827MakerNote
828UserComment
829SubSecTime
830SubSecTimeOriginal
831SubSecTimeDigitized
832FlashPixVersion
833ColorSpace
834EXIFImageWidth
835EXIFImageLength
836InteroperabilityOffset
837FlashEnergy
838SpatialFrequencyResponse
839FocalPlaneXResolution
840FocalPlaneYResolution
841FocalPlaneResolutionUnit
842SubjectLocation
843ExposureIndex
844SensingMethod
845FileSource
846SceneType
847</code></pre>
848<br/>
849<p>Surround the format specification with quotation marks to prevent your
850shell from misinterpreting any spaces and square brackets.</p>
851
852<p>The following special formatting syntax can be used to print IPTC
853information contained in the file:</p>
854
855<pre class="highlight"><code>%[IPTC:<var>dataset</var>:<var>record</var>]
856</code></pre>
857
858<p>Select <var>dataset</var> and <var>record</var> from the following:</p>
859
860<pre class="pre-scrollable highlight:">
861  Envelope Record
862  1:00  Model Version
863  1:05  Destination
864  1:20  File Format
865  1:22  File Format Version
866  1:30  Service Identifier
867  1:40  Envelope Number
868  1:50  Product ID
869  1:60  Envelope Priority
870  1:70  Date Sent
871  1:80  Time Sent
872  1:90  Coded Character Set
873  1:100  UNO (Unique Name of Object)
874  1:120  ARM Identifier
875  1:122  ARM Version
876
877Application Record
878  2:00  Record Version
879  2:03  Object Type Reference
880  2:05  Object Name (Title)
881  2:07  Edit Status
882  2:08  Editorial Update
883  2:10  Urgency
884  2:12  Subject Reference
885  2:15  Category
886  2:20  Supplemental Category
887  2:22  Fixture Identifier
888  2:25  Keywords
889  2:26  Content Location Code
890  2:27  Content Location Name
891  2:30  Release Date
892  2:35  Release Time
893  2:37  Expiration Date
894  2:38  Expiration Time
895  2:40  Special Instructions
896  2:42  Action Advised
897  2:45  Reference Service
898  2:47  Reference Date
899  2:50  Reference Number
900  2:55  Date Created
901  2:60  Time Created
902  2:62  Digital Creation Date
903  2:63  Digital Creation Time
904  2:65  Originating Program
905  2:70  Program Version
906  2:75  Object Cycle
907  2:80  By-Line (Author)
908  2:85  By-Line Title (Author Position) [Not used in Photoshop 7]
909  2:90  City
910  2:92  Sub-Location
911  2:95  Province/State
912  2:100  Country/Primary Location Code
913  2:101  Country/Primary Location Name
914  2:103  Original Transmission Reference
915  2:105  Headline
916  2:110  Credit
917  2:115  Source
918  2:116  Copyright Notice
919  2:118  Contact
920  2:120  Caption/Abstract
921  2:122  Caption Writer/Editor
922  2:125  Rasterized Caption
923  2:130  Image Type
924  2:131  Image Orientation
925  2:135  Language Identifier
926  2:150  Audio Type
927  2:151  Audio Sampling Rate
928  2:152  Audio Sampling Resolution
929  2:153  Audio Duration
930  2:154  Audio Outcue
931  2:200  ObjectData Preview File Format
932  2:201  ObjectData Preview File Format Version
933  2:202  ObjectData Preview Data
934
935Pre-ObjectData Descriptor Record
936  7:10   Size Mode
937  7:20   Max Subfile Size
938  7:90   ObjectData Size Announced
939  7:95   Maximum ObjectData Size
940
941ObjectData Record
942  8:10   Subfile
943
944Post ObjectData Descriptor Record
945  9:10   Confirmed ObjectData Size
946</code></pre>
947</div>
948  </div>
949  </main><!-- /.container -->
950  <footer class="magick-footer">
951    <div class="container-fluid">
952      <a href="../www/security-policy.html">Security</a> •
953      <a href="../www/news.html">News</a>
954
955      <a href="escape.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../images/wand.ico"/></a>
956
957      <a href="../www/links.html">Related</a> •
958      <a href="../www/sitemap.html">Sitemap</a>
959   <br/>
960     <a href="../www/support.html">Sponsor</a> •
961     <a href="../www/cite.html">Cite</a> •
962     <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
963     <a href="../www/https://imagemagick.org/script/contact.php">Contact Us</a>
964   <br/>
965     <a href="https://github.com/imagemagick/imagemagick" target="_blank" rel="noopener" aria-label="GitHub"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 499.36" width="2%" height="2%" role="img" focusable="false"><title>GitHub</title><path fill="currentColor" fill-rule="evenodd" d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z"/></svg></a> •
966     <a href="https://twitter.com/imagemagick" target="_blank" rel="noopener" aria-label="Twitter"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 416.32" width="2%" height="2%" role="img" focusable="false"><title>Twitter</title><path fill="currentColor" d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92"/></svg></a>
967    <br/>
968    <small>© 1999-2021 ImageMagick Studio LLC</small>
969    </div>
970  </footer>
971
972  <!-- Javascript assets -->
973  <script src="assets/magick.js" ></script>
974  </body>
975</html>
976<!-- Magick Cache 13th February 2021 11:14 -->