blob: 7f0df65573166de559c4eb1952c264b14165a80f [file] [log] [blame]
Cristy594d2772015-11-15 10:47:42 -05001
2
3
4
cristy29dc8652015-05-12 16:26:21 +00005<!DOCTYPE html>
cristyd2432012015-05-04 23:15:15 +00006<html lang="en">
cristyad41c0c2012-10-31 00:49:28 +00007<head>
Cristy912a9222016-06-17 15:37:28 -04008 <meta charset="utf-8" />
Cristy3b0b58d2016-11-06 07:40:23 -05009 <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
10 <meta http-equiv="x-ua-compatible" content="ie=edge" />
Cristy6549abb2016-11-10 08:25:55 -050011 <title>Format and Print Image Properties @ ImageMagick</title>
Cristy594d2772015-11-15 10:47:42 -050012 <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
13 <meta name="application-name" content="ImageMagick"/>
14 <meta name="description" content="ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves."/>
Cristy364a72f2016-11-04 22:38:41 -040015 <meta name="application-url" content="https://www.imagemagick.org"/>
Cristy594d2772015-11-15 10:47:42 -050016 <meta name="generator" content="PHP"/>
17 <meta name="keywords" content="format, print, image, properties, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/>
18 <meta name="rating" content="GENERAL"/>
19 <meta name="robots" content="INDEX, FOLLOW"/>
20 <meta name="generator" content="ImageMagick Studio LLC"/>
21 <meta name="author" content="ImageMagick Studio LLC"/>
22 <meta name="revisit-after" content="2 DAYS"/>
23 <meta name="resource-type" content="document"/>
Cristyfe36f992016-12-29 20:24:13 -050024 <meta name="copyright" content="Copyright (c) 1999-2017 ImageMagick Studio LLC"/>
Cristy594d2772015-11-15 10:47:42 -050025 <meta name="distribution" content="Global"/>
26 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
Cristy912a9222016-06-17 15:37:28 -040027 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
Cristy49380402017-06-29 11:24:55 -040028 <link rel="canonical" href="https://www.imagemagick.org/script/escape.html" />
29 <link rel="icon" href="../images/wand.png" />
30 <link rel="shortcut icon" href="../images/wand.ico" />
Cristybc232422016-11-22 07:46:18 -050031 <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:900,400,400italic,700,700italic,300,300italic|Open+Sans:300italic,400italic,700italic,300,400,600,700" />
Cristy49380402017-06-29 11:24:55 -040032 <link rel="stylesheet" href="css/magick.css" />
cristyad41c0c2012-10-31 00:49:28 +000033</head>
cristyd2432012015-05-04 23:15:15 +000034<body>
Cristyc4c66d82017-06-29 14:41:05 -040035<div class="magick-header">
cristyd2432012015-05-04 23:15:15 +000036 <div class="container">
Cristy6549abb2016-11-10 08:25:55 -050037 <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
Cristy594d2772015-11-15 10:47:42 -050038 style="display:block"
39 data-ad-client="ca-pub-3129977114552745"
40 data-ad-slot="6345125851"
41 data-ad-format="auto"></ins>
cristy29f2c972015-07-28 13:37:46 +000042 <script>
Cristy542697a2015-10-12 20:10:32 -040043 (adsbygoogle = window.adsbygoogle || []).push({});
cristyd2432012015-05-04 23:15:15 +000044 </script>
Cristy49380402017-06-29 11:24:55 -040045 <nav class="nav magick-nav">
46 <a class="nav-link " href="../index.html">Home</a>
47 <a class="nav-link " href="download.html">Download</a>
48 <a class="nav-link " href="command-line-tools.html">Tools</a>
49 <a class="nav-link " href="command-line-processing.html">Command-line</a>
50 <a class="nav-link " href="resources.html">Resources</a>
51 <a class="nav-link " href="develop.html">Develop</a>
52 <a class="nav-link " href="https://www.imagemagick.org/script/search.php">Search</a>
53 <a class="nav-link float-right" href="https://www.imagemagick.org/discourse-server/">Community</a>
cristyd2432012015-05-04 23:15:15 +000054 </nav>
55 </div>
56</div>
57<div class="container">
Cristy49380402017-06-29 11:24:55 -040058<div class="magick-main">
cristyd2432012015-05-04 23:15:15 +000059<div class="magick-header">
Cristy594d2772015-11-15 10:47:42 -050060<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="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>
cristyad41c0c2012-10-31 00:49:28 +000061
cristyd2432012015-05-04 23:15:15 +000062<div class="table-responsive">
63<table class="table table-striped">
64<tr>
cristy37b3d442015-02-28 14:00:30 +000065 <td><b>Profile Data</b></td>
66 <td>Such as EXIF: data, containing focal lengths, exposures, dates, and in
67 come cases GPS locations.
68 </td></tr>
cristyd2432012015-05-04 23:15:15 +000069<tr>
cristy37b3d442015-02-28 14:00:30 +000070 <td><b>Attributes</b></td>
71 <td>These are directly involved with image data, and more commonly
72 modified as part of normal image processing. These include
73 width, height, depth, image type (colorspace), timing delays, and
74 background color. Most specific percent escapes is to access this
75 information.
76 </td></tr>
cristyd2432012015-05-04 23:15:15 +000077<tr>
cristy37b3d442015-02-28 14:00:30 +000078 <td><b>Properties</b></td>
Cristy542697a2015-10-12 20:10:32 -040079 <td>These are stored as a table of free form strings, and are (if possible)
cristy37b3d442015-02-28 14:00:30 +000080 saved with the image (especially in MIFF and PNG image file formats).
81 These include: Labels, Captions, Comments.
82 </td></tr>
cristyd2432012015-05-04 23:15:15 +000083<tr>
cristy37b3d442015-02-28 14:00:30 +000084 <td><b>Artifacts</b></td>
85 <td>These are various operational (expert) settings that are saved for
86 use by various operators, or by the user for future use. It is just
87 a table of free-form strings. They are not saved with the image when
88 written. See Artifacts and Options below for details.
89 </td></tr>
cristyd2432012015-05-04 23:15:15 +000090<tr>
cristy37b3d442015-02-28 14:00:30 +000091 <td><b>Options</b></td>
92 <td>Also operational (expert) settings that are saved for
93 use by various operators, but are set globally for use by a whole
94 image list (also not saved). See Artifacts and Options below.
95 </td></tr>
cristyd2432012015-05-04 23:15:15 +000096</table></div>
cristy37b3d442015-02-28 14:00:30 +000097
Cristy49380402017-06-29 11:24:55 -040098<h3>Percent Escape Handling</h3>
cristy37b3d442015-02-28 14:00:30 +000099
100<p>If you request a percent escape such as <code>%[key]</code> the setting
101is looked for in the following order until the first match has been
102found...</p>
103
104<ol>
105<li>Handle special prefixes such as 'artifact:' 'option:' 'exif:', or
106 'fx:'. This includes and calculations and or globs of those prefixes such
107 as 'exif:*' or 'artifact:*' (see below).</li>
108
109<li>If <code>key</code> contains a glob pattern (but no known prefix)
110 search free-form properties table.</li>
111
112<li>If <code>key</code> is a special image 'attribute' name (see list
113 above) return the associated or calculated image attribute.</li>
114
115<li>Search for setting as a free-form 'property'</li>
116<li>Search for setting as a free-form 'artifact'</li>
117<li>Search for setting as a free-form 'option'</li>
118
119<li>Replace escape with empty string, and perhaps produce a warning.</li>
120</ol>
121
122<p>Remember, all long name forms of percent escapes are handled in a is case
123insensitive manner. </p>
124
125<p><b>As of IM v6.8.0-5</b> you can now access the Artifact and Option
126free-form string tables directly, allowing you to override the above sequence,
127and avoid accessing an attribute or property of the same name.</p>
128
Cristy49380402017-06-29 11:24:55 -0400129<pre><code>
cristyd2432012015-05-04 23:15:15 +0000130%[artifact:<var>setting</var>]
131%[option:<var>setting</var>]
Cristy49380402017-06-29 11:24:55 -0400132</code></pre>
cristy37b3d442015-02-28 14:00:30 +0000133
134
Cristy49380402017-06-29 11:24:55 -0400135<h3>Single Letter Attribute Percent Escapes</h3>
cristy37b3d442015-02-28 14:00:30 +0000136
137<p>Here are common single letter escapes (short form) is used to report the most
138common attributes and properties of an image, such as: the image filename
139filename, type, width, height. </p>
140
cristyd2432012015-05-04 23:15:15 +0000141<div class="table-responsive">
Cristy49380402017-06-29 11:24:55 -0400142<table class="table table-sm table-striped">
cristyd2432012015-05-04 23:15:15 +0000143 <tr>
144 <td>\n</td>
145 <td>newline</td>
146 </tr>
147 <tr>
148 <td>\r</td>
149 <td>carriage return</td>
150 </tr>
151 <tr>
152 <td>&lt;</td>
153 <td>less-than character.</td>
154 </tr>
155 <tr>
156 <td>&gt;</td>
157 <td>greater-than character.</td>
158 </tr>
159 <tr>
160 <td>&amp;</td>
161 <td>ampersand character.</td>
162 </tr>
163 <tr>
164 <td>%%</td>
165 <td>a percent sign</td>
166 </tr>
167 <tr>
168 <td>%b</td>
169 <td>file size of image read in</td>
170 </tr>
171 <tr>
172 <td>%c</td>
173 <td>comment meta-data property</td>
174 </tr>
175 <tr>
176 <td>%d</td>
177 <td>directory component of path</td>
178 </tr>
179 <tr>
180 <td>%e</td>
181 <td>filename extension or suffix</td>
182 </tr>
183 <tr>
184 <td>%f</td>
185 <td>filename (including suffix)</td>
186 </tr>
187 <tr>
188 <td>%g</td>
189 <td>layer canvas page geometry (equivalent to "%Wx%H%X%Y")</td>
190 </tr>
191 <tr>
192 <td>%h</td>
193 <td>current image height in pixels</td>
194 </tr>
195 <tr>
196 <td>%i</td>
197 <td>image filename (note: becomes output filename for "info:")</td>
198 </tr>
199 <tr>
200 <td>%k</td>
201 <td>CALCULATED: number of unique colors</td>
202 </tr>
203 <tr>
204 <td>%l</td>
205 <td>label meta-data property</td>
206 </tr>
207 <tr>
208 <td>%m</td>
209 <td>image file format (file magic)</td>
210 </tr>
211 <tr>
212 <td>%n</td>
213 <td>number of images in current image sequence</td>
214 </tr>
215 <tr>
216 <td>%o</td>
217 <td>output filename (used for delegates)</td>
218 </tr>
219 <tr>
220 <td>%p</td>
221 <td>index of image in current image list</td>
222 </tr>
223 <tr>
224 <td>%q</td>
225 <td>quantum depth (compile-time constant)</td>
226 </tr>
227 <tr>
228 <td>%r</td>
229 <td>image class and colorspace</td>
230 </tr>
231 <tr>
232 <td>%s</td>
233 <td>scene number (from input unless re-assigned)</td>
234 </tr>
235 <tr>
236 <td>%t</td>
237 <td>filename without directory or extension (suffix)</td>
238 </tr>
239 <tr>
240 <td>%u</td>
241 <td>unique temporary filename (used for delegates)</td>
242 </tr>
243 <tr>
244 <td>%w</td>
245 <td>current width in pixels</td>
246 </tr>
247 <tr>
248 <td>%x</td>
249 <td>x resolution (density)</td>
250 </tr>
251 <tr>
252 <td>%y</td>
253 <td>y resolution (density)</td>
254 </tr>
255 <tr>
256 <td>%z</td>
257 <td>image depth (as read in unless modified, image save depth)</td>
258 </tr>
259 <tr>
260 <td>%A</td>
Cristy542697a2015-10-12 20:10:32 -0400261 <td>image transparency channel enabled (true/false)</td>
cristyd2432012015-05-04 23:15:15 +0000262 </tr>
263 <tr>
264 <td>%C</td>
265 <td>image compression type</td>
266 </tr>
267 <tr>
268 <td>%D</td>
269 <td>image GIF dispose method</td>
270 </tr>
271 <tr>
272 <td>%G</td>
273 <td>original image size (%wx%h; before any resizes)</td>
274 </tr>
275 <tr>
276 <td>%H</td>
277 <td>page (canvas) height</td>
278 </tr>
279 <tr>
280 <td>%M</td>
281 <td>Magick filename (original file exactly as given, including read mods)</td>
282 </tr>
283 <tr>
284 <td>%O</td>
285 <td>page (canvas) offset ( = %X%Y )</td>
286 </tr>
287 <tr>
288 <td>%P</td>
289 <td>page (canvas) size ( = %Wx%H )</td>
290 </tr>
291 <tr>
292 <td>%Q</td>
293 <td>image compression quality ( 0 = default )</td>
294 </tr>
295 <tr>
296 <td>%S</td>
297 <td>?? scenes ??</td>
298 </tr>
299 <tr>
300 <td>%T</td>
301 <td>image time delay (in centi-seconds)</td>
302 </tr>
303 <tr>
304 <td>%U</td>
305 <td>image resolution units</td>
306 </tr>
307 <tr>
308 <td>%W</td>
309 <td>page (canvas) width</td>
310 </tr>
311 <tr>
312 <td>%X</td>
313 <td>page (canvas) x offset (including sign)</td>
314 </tr>
315 <tr>
316 <td>%Y</td>
317 <td>page (canvas) y offset (including sign)</td>
318 </tr>
319 <tr>
320 <td>%Z</td>
321 <td>unique filename (used for delegates)</td>
322 </tr>
323 <tr>
324 <td>%@</td>
325 <td>CALCULATED: trim bounding box (without actually trimming)</td>
326 </tr>
327 <tr>
328 <td>%#</td>
329 <td>CALCULATED: 'signature' hash of image values</td>
330 </tr>
331</table></div>
cristy37b3d442015-02-28 14:00:30 +0000332
333<p>Here is a sample command and its output for an image with filename
334<code>bird.miff</code> and whose width is 512 and height is 480.</p>
335
Cristy49380402017-06-29 11:24:55 -0400336<pre><code>
Cristy594d2772015-11-15 10:47:42 -0500337-> identify -format "%m:%f %wx%h" bird.miff
cristy37b3d442015-02-28 14:00:30 +0000338MIFF:bird.miff 512x480
Cristy49380402017-06-29 11:24:55 -0400339</code></pre>
cristy37b3d442015-02-28 14:00:30 +0000340
341<p>Note that all single letter percent escapes can also be used using long
342form (from IM version 6.7.6-9, see next). For example <code>%[f]</code> is
Cristy542697a2015-10-12 20:10:32 -0400343equivalent to the <code>%f</code> short form. </p>
cristy37b3d442015-02-28 14:00:30 +0000344
345<p><b>WARNING</b>: short form percent escapes are NOT performed when the percent
346is after a number. For example, <code>10%x10</code> does not expand the
347<code>%x</code> as a percent escape. If you specifically want to expand the
348'x', use the long form which overrides this special case. EG:
349<code>10%[x]10</code>. </p>
350
351<p>Also be warned that calculated attributes can take some time to generate,
352especially for large images.</p>
353
Cristy49380402017-06-29 11:24:55 -0400354<h3>Long Form Attribute Percent Escapes</h3>
cristy37b3d442015-02-28 14:00:30 +0000355
356<p>In addition to the above specific and calculated attributes are recognized
357when enclosed in braces (long form):</p>
358
cristyd2432012015-05-04 23:15:15 +0000359<div class="table-responsive">
Cristy49380402017-06-29 11:24:55 -0400360<table class="table table-sm table-striped">
cristyd2432012015-05-04 23:15:15 +0000361 <tr>
362 <td>%[base]</td>
363 <td>base filename, no suffixes (as %t)</td>
364 </tr>
365 <tr>
Cristy6549abb2016-11-10 08:25:55 -0500366 <td>%[caption]</td>
367 <td>caption meta-data property</td>
368 </tr>
369 <tr>
370 <td>%[caption:pointsize]</td>
371 <td>returns the pointsize computed during caption: processing (as of IM 6.9.1-0)</td>
372 </tr>
373 <tr>
cristyd2432012015-05-04 23:15:15 +0000374 <td>%[channels]</td>
375 <td>??? channels in use - colorspace ???</td>
376 </tr>
377 <tr>
Cristybc232422016-11-22 07:46:18 -0500378 <td>%[colors]</td>
379 <td>Number of unique colors in the image (as of IM 7.0.3.8)</td>
380 </tr>
381 <tr>
cristyd2432012015-05-04 23:15:15 +0000382 <td>%[colorspace]</td>
383 <td>Colorspace of Image Data (excluding transparency)</td>
384 </tr>
385 <tr>
Cristybc232422016-11-22 07:46:18 -0500386 <td>%[compression]</td>
387 <td>Image compression type (as of IM 7.0.3.8)</td>
388 </tr>
389 <tr>
cristyd2432012015-05-04 23:15:15 +0000390 <td>%[copyright]</td>
391 <td>ImageMagick Copyright String</td>
392 </tr>
393 <tr>
394 <td>%[depth]</td>
395 <td>depth of image for write (as input unless changed)</td>
396 </tr>
397 <tr>
398 <td>%[deskew:angle]</td>
399 <td>The deskew angle in degrees of rotation</td>
400 </tr>
401 <tr>
402 <td>%[directory]</td>
403 <td>directory part of filename (as %d)</td>
404 </tr>
405 <tr>
406 <td>%[distortion]</td>
Cristy594d2772015-11-15 10:47:42 -0500407 <td>how well an image resembles a reference image (<a href="command-line-options.html#compare" >-compare</a>)</td>
cristyd2432012015-05-04 23:15:15 +0000408 </tr>
409 <tr>
410 <td>%[entropy]</td>
411 <td>CALCULATED: entropy of the image</td>
412 </tr>
413 <tr>
414 <td>%[extension]</td>
Cristy542697a2015-10-12 20:10:32 -0400415 <td>extension part of filename (as %e)</td>
cristyd2432012015-05-04 23:15:15 +0000416 </tr>
417 <tr>
418 <td>%[gamma]</td>
419 <td>value of image gamma</td>
420 </tr>
421 <tr>
422 <td>%[group]</td>
423 <td>??? window group ???</td>
424 </tr>
425 <tr>
426 <td>%[height]</td>
427 <td>original height of image (when it was read in)</td>
428 </tr>
429 <tr>
Cristybc232422016-11-22 07:46:18 -0500430 <td>%[interlace]</td>
431 <td>Image interlace mode (as of IM 7.0.3.8)</td>
432 </tr>
433 <tr>
cristyd2432012015-05-04 23:15:15 +0000434 <td>%[kurtosis]</td>
435 <td>CALCULATED: kurtosis statistic of image</td>
436 </tr>
437 <tr>
438 <td>%[label]</td>
439 <td>label meta-data property</td>
440 </tr>
Cristy6549abb2016-11-10 08:25:55 -0500441 <tr>
442 <td>%[label:pointsize]</td>
443 <td>returns the pointsize computed during label: processing (as of IM 6.9.1-0)</td>
444 </tr>
cristyd2432012015-05-04 23:15:15 +0000445 <tr>
446 <td>%[magick]</td>
447 <td>coder used to read image (not the file suffix)</td>
448 </tr>
449 <tr>
450 <td>%[max]</td>
451 <td>CALCULATED: maximum value statistic of image</td>
452 </tr>
453 <tr>
454 <td>%[mean]</td>
455 <td>CALCULATED: average value statistic of image</td>
456 </tr>
457 <tr>
458 <td>%[min]</td>
459 <td>CALCULATED: minimum value statistic of image</td>
460 </tr>
461 <tr>
462 <td>%[name]</td>
463 <td>The original name of the image</td>
464 </tr>
465 <tr>
466 <td>%[opaque]</td>
467 <td>CALCULATED: is image fully-opaque?</td>
468 </tr>
469 <tr>
470 <td>%[orientation]</td>
471 <td>image orientation</td>
472 </tr>
473 <tr>
474 <td>%[page]</td>
475 <td>Virtual canvas (page) geometry</td>
476 </tr>
477 <tr>
478 <td>%[profile:icc]</td>
479 <td>ICC profile info</td>
480 </tr>
481 <tr>
482 <td>%[profile:icm]</td>
483 <td>ICM profile info</td>
484 </tr>
485 <tr>
486 <td>%[profiles]</td>
487 <td>list of any embedded profiles</td>
488 </tr>
489 <tr>
Cristybc232422016-11-22 07:46:18 -0500490 <td>%[quality]</td>
491 <td>Image quality value (as of IM 7.0.3.8)</td>
492 </tr>
493 <tr>
494 <td>%[rendering-intent]</td>
495 <td>Image rendering intent (as of IM 7.0.3.8)</td>
496 </tr>
497 <tr>
cristyd2432012015-05-04 23:15:15 +0000498 <td>%[resolution.x]</td>
499 <td>X density (resolution) without units</td>
500 </tr>
501 <tr>
502 <td>%[resolution.y]</td>
503 <td>Y density (resolution) without units</td>
504 </tr>
505 <tr>
506 <td>%[scene]</td>
507 <td>original scene number of image in input file</td>
508 </tr>
509 <tr>
510 <td>%[size]</td>
511 <td>original size of image (when it was read in)</td>
512 </tr>
513 <tr>
514 <td>%[skewness]</td>
515 <td>CALCULATED: skewness statistic of image</td>
516 </tr>
517 <tr>
518 <td>%[standard-deviation]</td>
519 <td>CALCULATED: standard deviation statistic of image</td>
520 </tr>
521 <tr>
522 <td>%[type]</td>
523 <td>CALCULATED: image type</td>
524 </tr>
525 <tr>
526 <td>%[unique]</td>
527 <td>unique temporary filename ???</td>
528 </tr>
529 <tr>
530 <td>%[units]</td>
531 <td>image resolution units</td>
532 </tr>
533 <tr>
534 <td>%[version]</td>
535 <td>Version Information of this running ImageMagick</td>
536 </tr>
537 <tr>
538 <td>%[width]</td>
539 <td>original width of image (when it was read in)</td>
540 </tr>
541 <tr>
542 <td>%[zero]</td>
543 <td>zero (unique filename for delegate use)</td>
544 </tr>
545</table></div>
cristy37b3d442015-02-28 14:00:30 +0000546
Cristy49380402017-06-29 11:24:55 -0400547<h3>Properties</h3>
cristy37b3d442015-02-28 14:00:30 +0000548
549<p>All other long forms of percent escapes (not single letter long form) are
550handled in a case insensitive manner. Such escapes will will attempt to look
551up that name specific data sources. </p>
552
553<p>The primary search space (if not a specific attribute listed above) is
554a free-form property string. Such strings are associated and saved with
Cristy594d2772015-11-15 10:47:42 -0500555images, and are typically set using either the <a href="command-line-options.html#set" >-set</a>
Cristy542697a2015-10-12 20:10:32 -0400556CLI option (or API equivalent), or from special convenience options
Cristy594d2772015-11-15 10:47:42 -0500557(such as <a href="command-line-options.html#label"
558>-label</a>, <a href="command-line-options.html#comment"
559>-comment</a>, <a href="command-line-options.html#caption"
560>-caption</a>). </p>
cristy37b3d442015-02-28 14:00:30 +0000561
562<p>These convenience options are globally saved (as 'global options' so thay can
563be set before images are read), and later are transfered to the property of
564individual images, only when they are read in. At that time any internal
565percent escape present is then handled. </p>
566
Cristy594d2772015-11-15 10:47:42 -0500567<p>To change a property of an image already in memory, you need to use <a
568href="command-line-options.html#set" >-set</a>.
cristy37b3d442015-02-28 14:00:30 +0000569</p>
570
571<p>Note that properties, like attributes (and profiles), are saved with
572images when write, if the image file format allows. </p>
573
574
Cristy49380402017-06-29 11:24:55 -0400575<h3>Artifacts and Options</h3>
cristy37b3d442015-02-28 14:00:30 +0000576
577<p>The previous percent escapes are associated with the primary Attributes and
578Properties. Which is the original and primary focus of such percent escapes.
579</p>
580
581<p>However there are many operational settings that are used by various
582ImageMagick operators that can be useful to set and later access. These
583consist of per-image Artifacts, and Global options (associated with a list of
584images, typically the current image list).</p>
585
586<p>Note that the major difference between an artifact and a property is that
587artifacts, being an internal operational setting, is not saved with images (if
588such is possible). </p>
589
590<p>For example when you use <code>-define 'distort:viewport=100x100'</code> you
Cristy594d2772015-11-15 10:47:42 -0500591are in fact generating a global option, which the <a href="command-line-options.html#distort"
592>-distort</a> operator will use to modify its behavior (distorted output
cristy37b3d442015-02-28 14:00:30 +0000593image 'view'). </p>
594
595<p>An Option is essentually a Artifact that has been stored globally as part
596of a list of images (specifically a 'Wand' of images). As such they are
597identical, in that a Option, is simply a global Artifact for all the
598associated images. </p>
599
600<p>As such you can use <code>-set 'option:distort:viewport' '100x100'</code> to
601achieve the same result of setting a Artifact for the disort operation to use.
602</p>
603
604<p><b>Internal Handling of a Global Option...</b></p>
605
606<p>The Core library ('MagickCore') does not generally directly understand
607Global Options. As such, continuing the previous example, the
608<code>DistortImages()</code> function only looks up an artifact to discover if
609a 'viewport' has been provided to it. </p>
610
611<p>How Global Options are used when a library function requests an Artifact is
612one of the key differences between IMv6 and IMv7.</p>
613
614<p>In <b>ImageMagick version 6</b>... before each operator, any global Options
615are copied to per-image Artifacts, for every image in the current image list.
616This allows various operators to find its operational 'defines' or Artifacts.
617</p>
618
619<p>In <b>ImageMagick version 7</b>... sets a link back to the global options
620data, so that if a specific per-image Artifact is not found , then it will
Cristy542697a2015-10-12 20:10:32 -0400621look for a equivalent global Option for that image list. directly. This
cristy37b3d442015-02-28 14:00:30 +0000622saves coping these free-form options into artifacts repeatally, and means you
Cristy542697a2015-10-12 20:10:32 -0400623can now separately define a global option for a list, and a individual
cristy37b3d442015-02-28 14:00:30 +0000624overriding artifact for a specific image in that list. </p>
625
626<p>Note that many API's that do not use Wands (PerlMagick for example using
627arrays of images rather than a Wand). In these API's you will not have Global
628Options, only per-image Artifacts. </p>
629
Cristy542697a2015-10-12 20:10:32 -0400630<p>In summery a Global Option, if available, is equivalent to a per-image
cristy37b3d442015-02-28 14:00:30 +0000631Artifact. </p>
632
633
Cristy49380402017-06-29 11:24:55 -0400634<h3>Glob-Pattern Listing of Properties, Artifacts and Options</h3>
cristy37b3d442015-02-28 14:00:30 +0000635
cristyd2432012015-05-04 23:15:15 +0000636<p>The <var>setting</var> can contain a glob pattern. As such you can
cristy37b3d442015-02-28 14:00:30 +0000637now list all free-form string properties, artifacts, and options, (but not
638specific image attributes) using...</p>
639
Cristy49380402017-06-29 11:24:55 -0400640<pre><code>
cristyd2432012015-05-04 23:15:15 +0000641convert ... \
642 -print "__Properties__\n%[*]" \
643 -print "__Artifacts__\n%[artifact:*]" \
644 -print "__Options__\n%[option:*]" \
645 ...
Cristy49380402017-06-29 11:24:55 -0400646</code></pre>
cristy37b3d442015-02-28 14:00:30 +0000647
cristy37b3d442015-02-28 14:00:30 +0000648<p> The format of glob patterns are very specific and as such is generally
649only used to list specific settings, such as when debugging, rather than being
650used for image processing use. </p>
651
652
Cristy49380402017-06-29 11:24:55 -0400653<h3>Calculated Percent Escape Prefixes</h3>
cristy37b3d442015-02-28 14:00:30 +0000654
655<p>There are some special prefixes (before the first ':') which performs
656calculations based on the user provided string that follows that prefix. For
657example you can do a numerical calculation use <code>%[fx:...]</code> to
658evaluate the given <a href="fx.html">FX</a> expressions:</p>
659
Cristy49380402017-06-29 11:24:55 -0400660<pre><code>
cristyd2432012015-05-04 23:15:15 +0000661%[fx:<var>expression</var>]
Cristy49380402017-06-29 11:24:55 -0400662</code></pre>
cristy37b3d442015-02-28 14:00:30 +0000663
Cristyd07f4fe2017-06-02 20:36:40 -0400664<p>Use <code>pixel:</code> or <code>hex:</code> to evaluate a pixel color as defined by the <a
Cristy594d2772015-11-15 10:47:42 -0500665href="fx.html">FX</a>
cristy37b3d442015-02-28 14:00:30 +0000666expression:</p>
667
Cristy49380402017-06-29 11:24:55 -0400668<pre><code>
cristyd2432012015-05-04 23:15:15 +0000669%[pixel:<var>expression</var>]
Cristy49380402017-06-29 11:24:55 -0400670</code></pre>
cristy37b3d442015-02-28 14:00:30 +0000671
Cristy49380402017-06-29 11:24:55 -0400672<h3>Specific Profile Percent Escape Prefixes</h3>
cristy37b3d442015-02-28 14:00:30 +0000673
674<p>You can also use the following special formatting syntax to print EXIF
675mage meta-data that was included in the image read in:</p>
676
Cristy49380402017-06-29 11:24:55 -0400677<pre><code>
cristyd2432012015-05-04 23:15:15 +0000678%[EXIF:<var>tag</var>]
Cristy49380402017-06-29 11:24:55 -0400679</code></pre>
cristy37b3d442015-02-28 14:00:30 +0000680
cristyd2432012015-05-04 23:15:15 +0000681<p>Choose <var>tag</var> from the following:</p>
cristy37b3d442015-02-28 14:00:30 +0000682
Cristy49380402017-06-29 11:24:55 -0400683<pre class="pre-scrollable"><code>
cristyd2432012015-05-04 23:15:15 +0000684* (print all EXIF tags, in keyword=data format)
cristy37b3d442015-02-28 14:00:30 +0000685! (print all EXIF tags, in tag_number data format)
686#hhhh (print data for EXIF tag #hhhh)
687ImageWidth
688ImageLength
689BitsPerSample
690Compression
691PhotometricInterpretation
692FillOrder
693DocumentName
694ImageDescription
695Make
696Model
697StripOffsets
698Orientation
699SamplesPerPixel
700RowsPerStrip
701StripByteCounts
702XResolution
703YResolution
704PlanarConfiguration
705ResolutionUnit
706TransferFunction
707Software
708DateTime
709Artist
710WhitePoint
711PrimaryChromaticities
712TransferRange
713JPEGProc
714JPEGInterchangeFormat
715JPEGInterchangeFormatLength
716YCbCrCoefficients
717YCbCrSubSampling
718YCbCrPositioning
719ReferenceBlackWhite
720CFARepeatPatternDim
721CFAPattern
722BatteryLevel
723Copyright
724ExposureTime
725FNumber
726IPTC/NAA
727EXIFOffset
728InterColorProfile
729ExposureProgram
730SpectralSensitivity
731GPSInfo
732ISOSpeedRatings
733OECF
734EXIFVersion
735DateTimeOriginal
736DateTimeDigitized
737ComponentsConfiguration
738CompressedBitsPerPixel
739ShutterSpeedValue
740ApertureValue
741BrightnessValue
742ExposureBiasValue
743MaxApertureValue
744SubjectDistance
745MeteringMode
746LightSource
747Flash
748FocalLength
749MakerNote
750UserComment
751SubSecTime
752SubSecTimeOriginal
753SubSecTimeDigitized
754FlashPixVersion
755ColorSpace
756EXIFImageWidth
757EXIFImageLength
758InteroperabilityOffset
759FlashEnergy
760SpatialFrequencyResponse
761FocalPlaneXResolution
762FocalPlaneYResolution
763FocalPlaneResolutionUnit
764SubjectLocation
765ExposureIndex
766SensingMethod
767FileSource
768SceneType
Cristy49380402017-06-29 11:24:55 -0400769</code></pre>
Cristy594d2772015-11-15 10:47:42 -0500770<br/>
cristy37b3d442015-02-28 14:00:30 +0000771<p>Surround the format specification with quotation marks to prevent your
772shell from misinterpreting any spaces and square brackets.</p>
773
774<p>The following special formatting syntax can be used to print IPTC
775information contained in the file:</p>
776
Cristy49380402017-06-29 11:24:55 -0400777<pre><code>
cristyd2432012015-05-04 23:15:15 +0000778%[IPTC:<var>dataset</var>:<var>record</var>]
Cristy49380402017-06-29 11:24:55 -0400779</code></pre>
cristy37b3d442015-02-28 14:00:30 +0000780
cristyd2432012015-05-04 23:15:15 +0000781<p>Select <var>dataset</var> and <var>record</var> from the following:</p>
cristy37b3d442015-02-28 14:00:30 +0000782
cristyd2432012015-05-04 23:15:15 +0000783<pre class="pre-scrollable:">
784 Envelope Record
cristy37b3d442015-02-28 14:00:30 +0000785 1:00 Model Version
786 1:05 Destination
787 1:20 File Format
788 1:22 File Format Version
789 1:30 Service Identifier
790 1:40 Envelope Number
791 1:50 Product ID
792 1:60 Envelope Priority
793 1:70 Date Sent
794 1:80 Time Sent
795 1:90 Coded Character Set
796 1:100 UNO (Unique Name of Object)
797 1:120 ARM Identifier
798 1:122 ARM Version
799
800Application Record
801 2:00 Record Version
802 2:03 Object Type Reference
803 2:05 Object Name (Title)
804 2:07 Edit Status
805 2:08 Editorial Update
806 2:10 Urgency
807 2:12 Subject Reference
808 2:15 Category
809 2:20 Supplemental Category
810 2:22 Fixture Identifier
811 2:25 Keywords
812 2:26 Content Location Code
813 2:27 Content Location Name
814 2:30 Release Date
815 2:35 Release Time
816 2:37 Expiration Date
817 2:38 Expiration Time
818 2:40 Special Instructions
819 2:42 Action Advised
820 2:45 Reference Service
821 2:47 Reference Date
822 2:50 Reference Number
823 2:55 Date Created
824 2:60 Time Created
825 2:62 Digital Creation Date
826 2:63 Digital Creation Time
827 2:65 Originating Program
828 2:70 Program Version
829 2:75 Object Cycle
830 2:80 By-Line (Author)
831 2:85 By-Line Title (Author Position) [Not used in Photoshop 7]
832 2:90 City
833 2:92 Sub-Location
834 2:95 Province/State
835 2:100 Country/Primary Location Code
836 2:101 Country/Primary Location Name
837 2:103 Original Transmission Reference
838 2:105 Headline
839 2:110 Credit
840 2:115 Source
841 2:116 Copyright Notice
842 2:118 Contact
843 2:120 Caption/Abstract
844 2:122 Caption Writer/Editor
845 2:125 Rasterized Caption
846 2:130 Image Type
847 2:131 Image Orientation
848 2:135 Language Identifier
849 2:150 Audio Type
850 2:151 Audio Sampling Rate
851 2:152 Audio Sampling Resolution
852 2:153 Audio Duration
853 2:154 Audio Outcue
854 2:200 ObjectData Preview File Format
855 2:201 ObjectData Preview File Format Version
856 2:202 ObjectData Preview Data
857
858Pre-ObjectData Descriptor Record
859 7:10 Size Mode
860 7:20 Max Subfile Size
861 7:90 ObjectData Size Announced
862 7:95 Maximum ObjectData Size
863
864ObjectData Record
865 8:10 Subfile
866
867Post ObjectData Descriptor Record
868 9:10 Confirmed ObjectData Size
Cristy49380402017-06-29 11:24:55 -0400869</code></pre>
cristy37b3d442015-02-28 14:00:30 +0000870</div>
cristyd2432012015-05-04 23:15:15 +0000871 <footer class="magick-footer">
cristy29f2c972015-07-28 13:37:46 +0000872 <p><a href="support.html">Donate</a>
873 <a href="sitemap.html">Sitemap</a>
cristyd2432012015-05-04 23:15:15 +0000874 <a href="links.html">Related</a>
Cristye0779712016-07-30 17:25:22 -0400875 <a href="security-policy.html">Security</a>
cristy29f2c972015-07-28 13:37:46 +0000876 <a href="architecture.html">Architecture</a>
cristyd2432012015-05-04 23:15:15 +0000877</p>
878 <p><a href="escape.html#">Back to top</a>
cristyea2793e2015-05-31 16:52:26 +0000879 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
Cristy6549abb2016-11-10 08:25:55 -0500880 <a href="https://www.imagemagick.org/script/contact.php">Contact Us</a></p>
Cristyfe36f992016-12-29 20:24:13 -0500881 <p><small>© 1999-2017 ImageMagick Studio LLC</small></p>
cristyd2432012015-05-04 23:15:15 +0000882 </footer>
883</div><!-- /.container -->
884
Cristyb7f455a2017-03-03 19:30:34 -0500885 <script src="https://localhost/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
Cristy1f1f3a02016-06-01 07:25:42 -0400886 <script src="../js/magick.html"></script>
cristy37b3d442015-02-28 14:00:30 +0000887</div>
cristyad41c0c2012-10-31 00:49:28 +0000888</body>
cristy5a367e42015-05-05 12:39:18 +0000889</html>
Cristy49380402017-06-29 11:24:55 -0400890<!-- Magick Cache 29th June 2017 10:58 -->