Debian Codegraph @

www/command-line-options/index.html

raw symbols ◀ ▶
Source reconstructed at patch state 2 of 4 — not the installed (fully patched) source.
4 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 | Command-line Options</title>
11 <meta name="description" content="Influence the default behavior of ImageMagick tools with command-line options.">
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 | Command-line Options">
54 <meta property="og:description" content="Influence the default behavior of ImageMagick tools with command-line options.">
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/command-line-options/">
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 | Command-line Options">
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 | Command-line Options",
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 <!-- Google Custom Search -->
117 <script async src="https://localhost/cse.js?cx=8720b81722164487b"></script>
118 <script async src="https://localhost/pagead/js/adsbygoogle.js?client=ca-pub-3129977114552745" crossorigin="anonymous"></script>
119 </head>
120
121 <body>
122 <script>
123 function setTheme(theme) {
124 localStorage.setItem('theme', theme);
125 updateThemeIcon(theme);
126 document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? getSystemTheme() : theme);
127 }
128 function getSystemTheme() {
129 return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
130 }
131 function updateThemeIcon(theme) {
132 const iconMap = {
133 light: '☀️',
134 dark: '🌙',
135 auto: '🌓'
136 };
137 document.getElementById('currentThemeIcon').textContent = iconMap[theme] || '🌓';
138 }
139 document.addEventListener('DOMContentLoaded', () => {
140 const savedTheme = localStorage.getItem('theme') || 'auto';
141 setTheme(savedTheme);
142 });
143 </script>
144 <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
145 <div class="container-fluid">
146 <a class="navbar-brand fw-bold" href="../index-2.html" title="ImageMagick">ImageMagick</a>
147 <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">
148 <span class="navbar-toggler-icon"></span>
149 </button>
150
151 <div class="collapse navbar-collapse" id="magick-navbars">
152 <ul class="navbar-nav me-auto">
153 <li class="nav-item">
154 <a class="nav-link "" href="../download/index.html">Download</a>
155 </li>
156 <li class="nav-item">
157 <a class="nav-link "" href="../command-line-tools/index.html">Tools</a>
158 </li>
159 <li class="nav-item">
160 <a class="nav-link "" href="../command-line-processing/index.html">CLI</a>
161 </li>
162 <li class="nav-item">
163 <a class="nav-link "" href="../develop/index.html">Develop</a>
164 </li>
165 <li class="nav-item">
166 <a class="nav-link" rel="noopener noreferrer" target="_blank" href="https://github.com/ImageMagick/ImageMagick/discussions">Community</a>
167 </li>
168 </ul>
169 <ul class="navbar-nav ms-auto">
170 <li class="nav-item ms-3">
171 <form class="d-flex form-inline" action="https://imagemagick.org/command-line-options/">
172 <input class="form-control me-2" type="text" name="q" placeholder="Search site..." aria-label="Search">
173 <button class="btn btn-outline-warning" type="submit" name="sa">Search</button>
174 </form>
175 </li>
176 <li class="nav-item dropdown ms-3">
177 <a class="nav-link dropdown-toggle" href="#" id="themeDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
178 <span id="currentThemeIcon">🌓</span>
179 </a>
180 <ul class="dropdown-menu dropdown-menu-end" aria-labelledby="themeDropdown">
181 <li><a class="dropdown-item" href="#" onclick="setTheme('light')">☀️ Light</a></li>
182 <li><a class="dropdown-item" href="#" onclick="setTheme('dark')">🌙 Dark</a></li>
183 <li><a class="dropdown-item" href="#" onclick="setTheme('auto')">🌓 Auto</a></li>
184 </ul>
185 </li>
186 </ul>
187 </div>
188 </div>
189 </nav>
190
191 <div class="col-lg-8 mx-auto text-body-secondary pt-5 pt-lg-5">
192 <header class="d-flex align-items-center pb-3 mb-5 border-bottom">
193 <div class="mt-3 ms-3">
194 <a href="../index-2.html" class="text-decoration-none">
195 <h1 class="fs-2 mb-1 display-5">Command-line Options</h1>
196 </a>
197 <h2 class="fs-5 text-muted h4">ImageMagick</h2>
198 </div>
199 </header>
200
201 <main role="main" class="container">
202 <div class="row g-5">
203 <div class="col-md-9">
204 <div>
205 <br/>
206 <div class="btn-group">
207 <button class="btn btn-secondary dropdown-toggle" type="button" id="defaultDropdown" data-bs-toggle="dropdown" data-bs-auto-close="true" aria-expanded="false">
208 Select CLI Option
209 </button>
210 <ul class="dropdown-menu overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" aria-labelledby="defaultDropdown">
211 <li><a class="dropdown-divider" href="#"><b>A</b></a></li>
212 <li><a class="dropdown-item" href="#adaptive-blur">adaptive-blur</a></li>
213 <li><a class="dropdown-item" href="#adaptive-resize">adaptive-resize</a></li>
214 <li><a class="dropdown-item" href="#adaptive-sharpen">adaptive-sharpen</a></li>
215 <li><a class="dropdown-item" href="#adjoin">adjoin</a></li>
216 <li><a class="dropdown-item" href="#affine">affine</a></li>
217 <li><a class="dropdown-item" href="#alpha">alpha</a></li>
218 <li><a class="dropdown-item" href="#annotate">annotate</a></li>
219 <li><a class="dropdown-item" href="#antialias">antialias</a></li>
220 <li><a class="dropdown-item" href="#append">append</a></li>
221 <li><a class="dropdown-item" href="#attenuate">attenuate</a></li>
222 <li><a class="dropdown-item" href="#authenticate">authenticate</a></li>
223 <li><a class="dropdown-item" href="#auto-gamma">auto-gamma</a></li>
224 <li><a class="dropdown-item" href="#auto-level">auto-level</a></li>
225 <li><a class="dropdown-item" href="#auto-orient">auto-orient</a></li>
226 <li><a class="dropdown-item" href="#auto-threshold">auto-threshold</a></li>
227 <li><a class="dropdown-divider" href="#"><b>B</b></a></li>
228 <li><a class="dropdown-item" href="#backdrop">backdrop</a></li>
229 <li><a class="dropdown-item" href="#background">background</a></li>
230 <li><a class="dropdown-item" href="#bench">bench</a></li>
231 <li><a class="dropdown-item" href="#bias">bias</a></li>
232 <li><a class="dropdown-item" href="#bilateral-blur">bilateral-blur</a></li>
233 <li><a class="dropdown-item" href="#black-point-compensation">black-point-compensation</a></li>
234 <li><a class="dropdown-item" href="#black-threshold">black-threshold</a></li>
235 <li><a class="dropdown-item" href="#blend">blend</a></li>
236 <li><a class="dropdown-item" href="#blue-primary">blue-primary</a></li>
237 <li><a class="dropdown-item" href="#blue-shift">blue-shift</a></li>
238 <li><a class="dropdown-item" href="#blur">blur</a></li>
239 <li><a class="dropdown-item" href="#border">border</a></li>
240 <li><a class="dropdown-item" href="#bordercolor">bordercolor</a></li>
241 <li><a class="dropdown-item" href="#borderwidth">borderwidth</a></li>
242 <li><a class="dropdown-item" href="#brightness-contrast">brightness-contrast</a></li>
243 <li><a class="dropdown-divider" href="#"><b>C</b></a></li>
244 <li><a class="dropdown-item" href="#cache">cache</a></li>
245 <li><a class="dropdown-item" href="#canny">canny</a></li>
246 <li><a class="dropdown-item" href="#caption">caption</a></li>
247 <li><a class="dropdown-item" href="#cdl">cdl</a></li>
248 <li><a class="dropdown-item" href="#channel">channel</a></li>
249 <li><a class="dropdown-item" href="#channel-fx">channel-fx</a></li>
250 <li><a class="dropdown-item" href="#charcoal">charcoal</a></li>
251 <li><a class="dropdown-item" href="#chop">chop</a></li>
252 <li><a class="dropdown-item" href="#clahe">clahe</a></li>
253 <li><a class="dropdown-item" href="#clamp">clamp</a></li>
254 <li><a class="dropdown-item" href="#clip">clip</a></li>
255 <li><a class="dropdown-item" href="#clip-mask">clip-mask</a></li>
256 <li><a class="dropdown-item" href="#clip-path">clip-path</a></li>
257 <li><a class="dropdown-item" href="#clone">clone</a></li>
258 <li><a class="dropdown-item" href="#clut">clut</a></li>
259 <li><a class="dropdown-item" href="#coalesce">coalesce</a></li>
260 <li><a class="dropdown-item" href="#colorize">colorize</a></li>
261 <li><a class="dropdown-item" href="#colormap">colormap</a></li>
262 <li><a class="dropdown-item" href="#color-matrix">color-matrix</a></li>
263 <li><a class="dropdown-item" href="#colors">colors</a></li>
264 <li><a class="dropdown-item" href="#colorspace">colorspace</a></li>
265 <li><a class="dropdown-item" href="#color-threshold">color-threshold</a></li>
266 <li><a class="dropdown-item" href="#combine">combine</a></li>
267 <li><a class="dropdown-item" href="#comment">comment</a></li>
268 <li><a class="dropdown-item" href="#compare">compare</a></li>
269 <li><a class="dropdown-item" href="#complex">complex</a></li>
270 <li><a class="dropdown-item" href="#compose">compose</a></li>
271 <li><a class="dropdown-item" href="#composite">composite</a></li>
272 <li><a class="dropdown-item" href="#compress">compress</a></li>
273 <li><a class="dropdown-item" href="#connected-components">connected-components</a></li>
274 <li><a class="dropdown-item" href="#contrast">contrast</a></li>
275 <li><a class="dropdown-item" href="#contrast-stretch">contrast-stretch</a></li>
276 <li><a class="dropdown-item" href="#convolve">convolve</a></li>
277 <li><a class="dropdown-item" href="#copy">copy</a></li>
278 <li><a class="dropdown-item" href="#crop">crop</a></li>
279 <li><a class="dropdown-item" href="#cycle">cycle</a></li>
280 <li><a class="dropdown-divider" href="#"><b>D</b></a></li>
281 <li><a class="dropdown-item" href="#debug">debug</a></li>
282 <li><a class="dropdown-item" href="#decipher">decipher</a></li>
283 <li><a class="dropdown-item" href="#deconstruct">deconstruct</a></li>
284 <li><a class="dropdown-item" href="#define">define</a></li>
285 <li><a class="dropdown-item" href="#delay">delay</a></li>
286 <li><a class="dropdown-item" href="#delete">delete</a></li>
287 <li><a class="dropdown-item" href="#density">density</a></li>
288 <li><a class="dropdown-item" href="#depth">depth</a></li>
289 <li><a class="dropdown-item" href="#descend">descend</a></li>
290 <li><a class="dropdown-item" href="#deskew">deskew</a></li>
291 <li><a class="dropdown-item" href="#despeckle">despeckle</a></li>
292 <li><a class="dropdown-item" href="#direction">direction</a></li>
293 <li><a class="dropdown-item" href="#displace">displace</a></li>
294 <li><a class="dropdown-item" href="#display">display</a></li>
295 <li><a class="dropdown-item" href="#dispose">dispose</a></li>
296 <li><a class="dropdown-item" href="#dissimilarity-threshold">dissimilarity-threshold</a></li>
297 <li><a class="dropdown-item" href="#dissolve">dissolve</a></li>
298 <li><a class="dropdown-item" href="#distort">distort</a></li>
299 <li><a class="dropdown-item" href="#distribute-cache">distribute-cache</a></li>
300 <li><a class="dropdown-item" href="#dither">dither</a></li>
301 <li><a class="dropdown-item" href="#draw">draw</a></li>
302 <li><a class="dropdown-item" href="#duplicate">duplicate</a></li>
303 <li><a class="dropdown-divider" href="#"><b>E</b></a></li>
304 <li><a class="dropdown-item" href="#edge">edge</a></li>
305 <li><a class="dropdown-item" href="#emboss">emboss</a></li>
306 <li><a class="dropdown-item" href="#encipher">encipher</a></li>
307 <li><a class="dropdown-item" href="#encoding">encoding</a></li>
308 <li><a class="dropdown-item" href="#endian">endian</a></li>
309 <li><a class="dropdown-item" href="#enhance">enhance</a></li>
310 <li><a class="dropdown-item" href="#equalize">equalize</a></li>
311 <li><a class="dropdown-item" href="#evaluate">evaluate</a></li>
312 <li><a class="dropdown-item" href="#evaluate-sequence">evaluate-sequence</a></li>
313 <li><a class="dropdown-item" href="#exit">exit</a></li>
314 <li><a class="dropdown-item" href="#extent">extent</a></li>
315 <li><a class="dropdown-item" href="#extract">extract</a></li>
316 <li><a class="dropdown-divider" href="#"><b>F</b></a></li>
317 <li><a class="dropdown-item" href="#family">family</a></li>
318 <li><a class="dropdown-item" href="#features">features</a></li>
319 <li><a class="dropdown-item" href="#fft">fft</a></li>
320 <li><a class="dropdown-item" href="#fill">fill</a></li>
321 <li><a class="dropdown-item" href="#filter">filter</a></li>
322 <li><a class="dropdown-item" href="#flatten">flatten</a></li>
323 <li><a class="dropdown-item" href="#flip">flip</a></li>
324 <li><a class="dropdown-item" href="#floodfill">floodfill</a></li>
325 <li><a class="dropdown-item" href="#flop">flop</a></li>
326 <li><a class="dropdown-item" href="#font">font</a></li>
327 <li><a class="dropdown-item" href="#foreground">foreground</a></li>
328 <li><a class="dropdown-item" href="#format">format</a></li>
329 <li><a class="dropdown-item" href="#format_identify">format[identify]</a></li>
330 <li><a class="dropdown-item" href="#frame">frame</a></li>
331 <li><a class="dropdown-item" href="#frame_import_">frame[import]</a></li>
332 <li><a class="dropdown-item" href="#function">function</a></li>
333 <li><a class="dropdown-item" href="#fuzz">fuzz</a></li>
334 <li><a class="dropdown-item" href="#fx">fx</a></li>
335 <li><a class="dropdown-divider" href="#"><b>G</b></a></li>
336 <li><a class="dropdown-item" href="#gamma">gamma</a></li>
337 <li><a class="dropdown-item" href="#gaussian-blur">gaussian-blur</a></li>
338 <li><a class="dropdown-item" href="#geometry">geometry</a></li>
339 <li><a class="dropdown-item" href="#gravity">gravity</a></li>
340 <li><a class="dropdown-item" href="#grayscale">grayscale</a></li>
341 <li><a class="dropdown-item" href="#green-primary">green-primary</a></li>
342 <li><a class="dropdown-divider" href="#"><b>H</b></a></li>
343 <li><a class="dropdown-item" href="#hald-clut">hald-clut</a></li>
344 <li><a class="dropdown-item" href="#help">help</a></li>
345 <li><a class="dropdown-item" href="#highlight-color">highlight-color</a></li>
346 <li><a class="dropdown-item" href="#hough-lines">hough-lines</a></li>
347 <li><a class="dropdown-divider" href="#"><b>I</b></a></li>
348 <li><a class="dropdown-item" href="#iconGeometry">iconGeometry</a></li>
349 <li><a class="dropdown-item" href="#iconic">iconic</a></li>
350 <li><a class="dropdown-item" href="#identify">identify</a></li>
351 <li><a class="dropdown-item" href="#ift">ift</a></li>
352 <li><a class="dropdown-item" href="#illuminant">illuminant</a></li>
353 <li><a class="dropdown-item" href="#immutable">immutable</a></li>
354 <li><a class="dropdown-item" href="#implode">implode</a></li>
355 <li><a class="dropdown-item" href="#insert">insert</a></li>
356 <li><a class="dropdown-item" href="#intensity">intensity</a></li>
357 <li><a class="dropdown-item" href="#intent">intent</a></li>
358 <li><a class="dropdown-item" href="#interlace">interlace</a></li>
359 <li><a class="dropdown-item" href="#interline-spacing">interline-spacing</a></li>
360 <li><a class="dropdown-item" href="#interpolate">interpolate</a></li>
361 <li><a class="dropdown-item" href="#interpolative-resize">interpolative-resize</a></li>
362 <li><a class="dropdown-item" href="#interword-spacing">interword-spacing</a></li>
363 <li><a class="dropdown-item" href="#integral">integral</a></li>
364 <li><a class="dropdown-divider" href="#"><b>K</b></a></li>
365 <li><a class="dropdown-item" href="#kerning">kerning</a></li>
366 <li><a class="dropdown-item" href="#kmeans">kmeans</a></li>
367 <li><a class="dropdown-item" href="#kuwahara">kuwahara</a></li>
368 <li><a class="dropdown-divider" href="#"><b>L</b></a></li>
369 <li><a class="dropdown-item" href="#label">label</a></li>
370 <li><a class="dropdown-item" href="#lat">lat</a></li>
371 <li><a class="dropdown-item" href="#layers">layers</a></li>
372 <li><a class="dropdown-item" href="#level">level</a></li>
373 <li><a class="dropdown-item" href="#level-colors">level-colors</a></li>
374 <li><a class="dropdown-item" href="#limit">limit</a></li>
375 <li><a class="dropdown-item" href="#linear-stretch">linear-stretch</a></li>
376 <li><a class="dropdown-item" href="#linewidth">linewidth</a></li>
377 <li><a class="dropdown-item" href="#liquid-rescale">liquid-rescale</a></li>
378 <li><a class="dropdown-item" href="#list">list</a></li>
379 <li><a class="dropdown-item" href="#log">log</a></li>
380 <li><a class="dropdown-item" href="#loop">loop</a></li>
381 <li><a class="dropdown-item" href="#lowlight-color">lowlight-color</a></li>
382 <li><a class="dropdown-divider" href="#"><b>M</b></a></li>
383 <li><a class="dropdown-item" href="#magnify">magnify</a></li>
384 <li><a class="dropdown-item" href="#map">map</a></li>
385 <li><a class="dropdown-item" href="#map_stream_">map[stream]</a></li>
386 <li><a class="dropdown-item" href="#mattecolor">mattecolor</a></li>
387 <li><a class="dropdown-item" href="#median">median</a></li>
388 <li><a class="dropdown-item" href="#mean-shift">mean-shift</a></li>
389 <li><a class="dropdown-item" href="#metric">metric</a></li>
390 <li><a class="dropdown-item" href="#mode">mode</a></li>
391 <li><a class="dropdown-item" href="#modulate">modulate</a></li>
392 <li><a class="dropdown-item" href="#moments">moments</a></li>
393 <li><a class="dropdown-item" href="#monitor">monitor</a></li>
394 <li><a class="dropdown-item" href="#monochrome">monochrome</a></li>
395 <li><a class="dropdown-item" href="#morph">morph</a></li>
396 <li><a class="dropdown-item" href="#morphology">morphology</a></li>
397 <li><a class="dropdown-item" href="#mosaic">mosaic</a></li>
398 <li><a class="dropdown-item" href="#motion-blur">motion-blur</a></li>
399 <li><a class="dropdown-divider" href="#"><b>N</b></a></li>
400 <li><a class="dropdown-item" href="#name">name</a></li>
401 <li><a class="dropdown-item" href="#negate">negate</a></li>
402 <li><a class="dropdown-item" href="#noise">noise</a></li>
403 <li><a class="dropdown-item" href="#normalize">normalize</a></li>
404 <li><a class="dropdown-divider" href="#"><b>O</b></a></li>
405 <li><a class="dropdown-item" href="#opaque">opaque</a></li>
406 <li><a class="dropdown-item" href="#ordered-dither">ordered-dither</a></li>
407 <li><a class="dropdown-item" href="#orient">orient</a></li>
408 <li><a class="dropdown-divider" href="#"><b>P</b></a></li>
409 <li><a class="dropdown-item" href="#page">page</a></li>
410 <li><a class="dropdown-item" href="#paint">paint</a></li>
411 <li><a class="dropdown-item" href="#path">path</a></li>
412 <li><a class="dropdown-item" href="#pause_animate_">pause[animate]</a></li>
413 <li><a class="dropdown-item" href="#pause_import_">pause[import]</a></li>
414 <li><a class="dropdown-item" href="#perceptible">perceptible</a></li>
415 <li><a class="dropdown-item" href="#ping">ping</a></li>
416 <li><a class="dropdown-item" href="#pointsize">pointsize</a></li>
417 <li><a class="dropdown-item" href="#polaroid">polaroid</a></li>
418 <li><a class="dropdown-item" href="#poly">poly</a></li>
419 <li><a class="dropdown-item" href="#posterize">posterize</a></li>
420 <li><a class="dropdown-item" href="#precision">precision</a></li>
421 <li><a class="dropdown-item" href="#preview">preview</a></li>
422 <li><a class="dropdown-item" href="#print">print</a></li>
423 <li><a class="dropdown-item" href="#process">process</a></li>
424 <li><a class="dropdown-item" href="#profile">profile</a></li>
425 <li><a class="dropdown-divider" href="#"><b>Q</b></a></li>
426 <li><a class="dropdown-item" href="#quality">quality</a></li>
427 <li><a class="dropdown-item" href="#quantize">quantize</a></li>
428 <li><a class="dropdown-item" href="#quiet">quiet</a></li>
429 <li><a class="dropdown-divider" href="#"><b>R</b></a></li>
430 <li><a class="dropdown-item" href="#raise">raise</a></li>
431 <li><a class="dropdown-item" href="#random-threshold">random-threshold</a></li>
432 <li><a class="dropdown-item" href="#range-threshold">range-threshold</a></li>
433 <li><a class="dropdown-item" href="#read">read</a></li>
434 <li><a class="dropdown-item" href="#read-mask">read-mask</a></li>
435 <li><a class="dropdown-item" href="#red-primary">red-primary</a></li>
436 <li><a class="dropdown-item" href="#regard-warnings">regard-warnings</a></li>
437 <li><a class="dropdown-item" href="#region">region</a></li>
438 <li><a class="dropdown-item" href="#remap">remap</a></li>
439 <li><a class="dropdown-item" href="#remote">remote</a></li>
440 <li><a class="dropdown-item" href="#render">render</a></li>
441 <li><a class="dropdown-item" href="#repage">repage</a></li>
442 <li><a class="dropdown-item" href="#resample">resample</a></li>
443 <li><a class="dropdown-item" href="#reshape">reshape</a></li>
444 <li><a class="dropdown-item" href="#resize">resize</a></li>
445 <li><a class="dropdown-item" href="#respect-parentheses">respect-parentheses</a></li>
446 <li><a class="dropdown-item" href="#reverse">reverse</a></li>
447 <li><a class="dropdown-item" href="#roll">roll</a></li>
448 <li><a class="dropdown-item" href="#rotate">rotate</a></li>
449 <li><a class="dropdown-item" href="#rotational-blur">rotational-blur</a></li>
450 <li><a class="dropdown-divider" href="#"><b>S</b></a></li>
451 <li><a class="dropdown-item" href="#sample">sample</a></li>
452 <li><a class="dropdown-item" href="#sampling-factor">sampling-factor</a></li>
453 <li><a class="dropdown-item" href="#scale">scale</a></li>
454 <li><a class="dropdown-item" href="#scene">scene</a></li>
455 <li><a class="dropdown-item" href="#screen">screen</a></li>
456 <li><a class="dropdown-item" href="#script">script</a></li>
457 <li><a class="dropdown-item" href="#seed">seed</a></li>
458 <li><a class="dropdown-item" href="#segment">segment</a></li>
459 <li><a class="dropdown-item" href="#selective-blur">selective-blur</a></li>
460 <li><a class="dropdown-item" href="#separate">separate</a></li>
461 <li><a class="dropdown-item" href="#sepia-tone">sepia-tone</a></li>
462 <li><a class="dropdown-item" href="#set">set</a></li>
463 <li><a class="dropdown-item" href="#shade">shade</a></li>
464 <li><a class="dropdown-item" href="#shadow">shadow</a></li>
465 <li><a class="dropdown-item" href="#shared-memory">shared-memory</a></li>
466 <li><a class="dropdown-item" href="#sharpen">sharpen</a></li>
467 <li><a class="dropdown-item" href="#shave">shave</a></li>
468 <li><a class="dropdown-item" href="#shear">shear</a></li>
469 <li><a class="dropdown-item" href="#sigmoidal-contrast">sigmoidal-contrast</a></li>
470 <li><a class="dropdown-item" href="#silent">silent</a></li>
471 <li><a class="dropdown-item" href="#similarity-threshold">similarity-threshold</a></li>
472 <li><a class="dropdown-item" href="#size">size</a></li>
473 <li><a class="dropdown-item" href="#sketch">sketch</a></li>
474 <li><a class="dropdown-item" href="#smush">smush</a></li>
475 <li><a class="dropdown-item" href="#snaps">snaps</a></li>
476 <li><a class="dropdown-item" href="#solarize">solarize</a></li>
477 <li><a class="dropdown-item" href="#sort-pixels">sort-pixels</a></li>
478 <li><a class="dropdown-item" href="#sparse-color">sparse-color</a></li>
479 <li><a class="dropdown-item" href="#splice">splice</a></li>
480 <li><a class="dropdown-item" href="#spread">spread</a></li>
481 <li><a class="dropdown-item" href="#statistic">statistic</a></li>
482 <li><a class="dropdown-item" href="#stegano">stegano</a></li>
483 <li><a class="dropdown-item" href="#stereo">stereo</a></li>
484 <li><a class="dropdown-item" href="#storage-type">storage-type</a></li>
485 <li><a class="dropdown-item" href="#stretch">stretch</a></li>
486 <li><a class="dropdown-item" href="#strip">strip</a></li>
487 <li><a class="dropdown-item" href="#stroke">stroke</a></li>
488 <li><a class="dropdown-item" href="#strokewidth">strokewidth</a></li>
489 <li><a class="dropdown-item" href="#style">style</a></li>
490 <li><a class="dropdown-item" href="#subimage-search">subimage-search</a></li>
491 <li><a class="dropdown-item" href="#swap">swap</a></li>
492 <li><a class="dropdown-item" href="#swirl">swirl</a></li>
493 <li><a class="dropdown-item" href="#synchronize">synchronize</a></li>
494 <li><a class="dropdown-divider" href="#"><b>T</b></a></li>
495 <li><a class="dropdown-item" href="#taint">taint</a></li>
496 <li><a class="dropdown-item" href="#text-font">text-font</a></li>
497 <li><a class="dropdown-item" href="#texture">texture</a></li>
498 <li><a class="dropdown-item" href="#threshold">threshold</a></li>
499 <li><a class="dropdown-item" href="#thumbnail">thumbnail</a></li>
500 <li><a class="dropdown-item" href="#tile">tile</a></li>
501 <li><a class="dropdown-item" href="#tile-offset">tile-offset</a></li>
502 <li><a class="dropdown-item" href="#tint">tint</a></li>
503 <li><a class="dropdown-item" href="#title">title</a></li>
504 <li><a class="dropdown-item" href="#transform">transform</a></li>
505 <li><a class="dropdown-item" href="#transparent">transparent</a></li>
506 <li><a class="dropdown-item" href="#transparent-color">transparent-color</a></li>
507 <li><a class="dropdown-item" href="#transpose">transpose</a></li>
508 <li><a class="dropdown-item" href="#transverse">transverse</a></li>
509 <li><a class="dropdown-item" href="#treedepth">treedepth</a></li>
510 <li><a class="dropdown-item" href="#trim">trim</a></li>
511 <li><a class="dropdown-item" href="#type">type</a></li>
512 <li><a class="dropdown-divider" href="#"><b>U</b></a></li>
513 <li><a class="dropdown-item" href="#undercolor">undercolor</a></li>
514 <li><a class="dropdown-item" href="#unique-colors">unique-colors</a></li>
515 <li><a class="dropdown-item" href="#units">units</a></li>
516 <li><a class="dropdown-item" href="#unsharp">unsharp</a></li>
517 <li><a class="dropdown-item" href="#update">update</a></li>
518 <li><a class="dropdown-divider" href="#"><b>V</b></a></li>
519 <li><a class="dropdown-item" href="#verbose">verbose</a></li>
520 <li><a class="dropdown-item" href="#version">version</a></li>
521 <li><a class="dropdown-item" href="#view">view</a></li>
522 <li><a class="dropdown-item" href="#vignette">vignette</a></li>
523 <li><a class="dropdown-item" href="#virtual-pixel">virtual-pixel</a></li>
524 <li><a class="dropdown-item" href="#visual">visual</a></li>
525 <li><a class="dropdown-divider" href="#"><b>W</b></a></li>
526 <li><a class="dropdown-item" href="#watermark">watermark</a></li>
527 <li><a class="dropdown-item" href="#wave">wave</a></li>
528 <li><a class="dropdown-item" href="#wavelet-denoise">wavelet-denoise</a></li>
529 <li><a class="dropdown-item" href="#weight">weight</a></li>
530 <li><a class="dropdown-item" href="#white-balance">white-balance</a></li>
531 <li><a class="dropdown-item" href="#white-point">white-point</a></li>
532 <li><a class="dropdown-item" href="#white-threshold">white-threshold</a></li>
533 <li><a class="dropdown-item" href="#window">window</a></li>
534 <li><a class="dropdown-item" href="#window-group">window-group</a></li>
535 <li><a class="dropdown-item" href="#word-break">word-break</a></li>
536 <li><a class="dropdown-item" href="#write">write</a></li>
537 <li><a class="dropdown-item" href="#write-mask">write-mask</a></li>
538 </ul>
539 </div>
540 <p>&nbsp;</p>
541 <p class="lead">Below is list of command-line options recognized by the ImageMagick <a href="../command-line-tools/index.html">command-line tools</a>. If you want a description of a particular option, click on the option name in the navigation bar above and you will go right to it. Unless otherwise noted, each option is recognized by the commands: <a href="../magick/index.html">magick</a> and <a href="../mogrify/index.html">mogrify</a>.</p>
542
543 <div style="mx-auto my-3 text-center">
544 <h2><a class="anchor" id="adaptive-blur"></a>-adaptive-blur <var>radius</var>[x<var>sigma</var>]</h2>
545 </div>
546
547 <p class="lead">Adaptively blur pixels, with decreasing effect near edges.</p>
548
549 <p>A Gaussian operator of the given radius and standard deviation (<var>sigma</var>) is used. If <var>sigma</var> is not given it defaults to 1.</p>
550
551 <p>The <var>sigma</var> value is the important argument, and
552 determines the actual amount of blurring that will take place. </p>
553
554 <p>The <var>radius</var> is only used to determine the size of the
555 array which holds the calculated Gaussian distribution. It should be an
556 integer. If not given, or set to zero, IM will calculate the largest possible
557 radius that will provide meaningful results for the Gaussian distribution.
558 </p>
559
560 <div style="mx-auto my-3 text-center">
561 <h2><a class="anchor" id="adaptive-resize"></a>-adaptive-resize <var>geometry</var></h2>
562 </div>
563
564 <p class="lead">Resize the image using data-dependent triangulation.</p>
565
566 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument. The <a href="#adaptive-resize">-adaptive-resize</a>
567 option defaults to data-dependent triangulation. Use the <a
568 href="#filter">-filter</a> to choose a different resampling algorithm.
569 Offsets, if present in the geometry string, are ignored, and the <a
570 href="#gravity">-gravity</a> option has no effect.</p>
571
572 <div style="mx-auto my-3 text-center">
573 <h2><a class="anchor" id="adaptive-sharpen"></a>-adaptive-sharpen <var>radius</var>[x<var>sigma</var>]</h2>
574 </div>
575
576 <p class="lead">Adaptively sharpen pixels, with increasing effect near edges.</p>
577
578 <p>A Gaussian operator of the given radius and standard deviation
579 (<var>sigma</var>) is used. If <var>sigma</var> is not given it
580 defaults to 1.</p>
581 <p>The <var>sigma</var> value is the important argument, and
582 determines the actual amount of blurring that will take place. </p>
583
584 <p>The <var>radius</var> is only used to determine the size of the
585 array which holds the calculated Gaussian distribution. It should be an
586 integer. If not given, or set to zero, IM will calculate the largest possible
587 radius that will provide meaningful results for the Gaussian distribution.
588 </p>
589
590 <div style="mx-auto my-3 text-center">
591 <h2><a class="anchor" id="adjoin"></a>-adjoin</h2>
592 </div>
593
594 <p class="lead">Join images into a single multi-image file.</p>
595
596 <p>This option is enabled by default. An attempt is made to save all images of
597 an image sequence into the given output file. However, some formats, such as
598 JPEG and PNG, do not support more than one image per file, and in that case
599 ImageMagick is forced to write each image as a separate file. As such, if
600 more than one image needs to be written, the filename given is modified by
601 adding a <a href="#scene">-scene</a> number before the suffix, in order to
602 make distinct names for each image. </p>
603
604 <p>Use <a href="#adjoin">+adjoin</a> to force each image to be written to
605 separate files, whether or not the file format allows multiple images per file
606 (for example, GIF, MIFF, and TIFF). </p>
607
608 <p>Including a C-style integer format string in the output filename will
609 automagically enable <a href="#adjoin">+adjoin</a> and are used to specify
610 where the <a href="#scene">-scene</a> number is placed in the filenames. These
611 strings, such as '<code>%d</code>' or '<code>%03d</code>', are familiar to those
612 who have used the standard <code>printf()</code>' C-library function. As an
613 example, the command</p>
614
615 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><pre><samp>$ magick logo: rose: -morph 15 my%02dmorph.jpg</samp></pre></pre>
616
617 <p>will create a sequence of 17 images (the two given plus 15 more created by
618 <a href="#morph">-morph</a>), named: my00morph.jpg, my01morph.jpg,
619 my02morph.jpg, ..., my16morph.jpg. </p>
620
621 <p>In summary, ImageMagick tries to write all images to one file, but will
622 save to multiple files, if any of the following conditions exist...</p>
623 <ol>
624 <li>the output image's file format does not allow multi-image files,</li>
625 <li>the <a href="#adjoin">+adjoin</a> option is given, or</li>
626 <li>a printf() integer format string (eg: "%d") is present in the output
627 filename.</li>
628 </ol>
629
630
631 <div style="mx-auto my-3 text-center">
632 <h2><a class="anchor" id="affine"></a>-affine
633 <var>s<sub>x</sub></var>,<var>r<sub>x</sub></var>,<var>r<sub>y</sub></var>,<var>s<sub>y</sub></var>[,<var>t<sub>x</sub></var>,<var>t<sub>y</sub></var>]</h2>
634 </div>
635
636 <p class="lead">Set the drawing transformation matrix for combined rotating and scaling.</p>
637
638 <p>This option sets a transformation matrix, for use by subsequent <a
639 href="#draw">-draw</a> or <a href="#transform">-transform</a> options. </p>
640
641 <p>The matrix entries are entered as comma-separated numeric values either in
642 quotes or without spaces. </p>
643
644 <p>Internally, the transformation matrix has 3x3 elements, but three of them
645 are omitted from the input because they are constant. The new (transformed)
646 coordinates (<var>x'</var>, <var>y'</var>) of a pixel at
647 position (<var>x</var>, <var>y</var>) in the original
648 image are calculated using the following matrix equation.</p>
649
650 <p class="text-center"><img class="img-fluid img-thumbnail" alt="affine transformation" src="../image/affine.png"/> </p>
651
652 <p> The size of the resulting image is that of the smallest rectangle that
653 contains the transformed source image. The parameters
654 <var>t<sub>x</sub></var> and <var>t<sub>y</sub></var>
655 subsequently shift the image pixels so that those that are moved out of the
656 image area are cut off.</p>
657
658 <p>The transformation matrix complies with the left-handed pixel coordinate
659 system: positive <var>x</var> and <var>y</var> directions
660 are rightward and downward, resp.; positive rotation is clockwise.</p>
661
662 <p> If the translation coefficients <var>t<sub>x</sub></var> and
663 <var>t<sub>y</sub></var> are omitted they default to 0,0. Therefore,
664 four parameters suffice for rotation and scaling without translation.</p>
665
666 <p>Scaling by the factors <var>s<sub>x</sub></var> and
667 <var>s<sub>y</sub></var> in the <var>x</var> and <var>y</var> directions,
668 respectively, is accomplished with the following.</p>
669
670 <p>See <a href="#transform">-transform</a>, and the <a
671 href="#distort">-distort</a> method <code>Affineprojection</code> for more
672 information </p>
673
674
675 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><code>-affine <var>s<sub>x</sub></var>,0,0,<var>s<sub>y</sub></var>
676 </code></pre>
677
678 <p>Translation by a displacement (<var>t<sub>x</sub></var>, <var>t<sub>y</sub></var>) is accomplished like so:</p>
679
680 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><code>-affine 1,0,0,1,<var>t<sub>x</sub></var>,<var>t<sub>y</sub></var>
681 </code></pre>
682
683 <p>Rotate clockwise about the origin (the upper left-hand corner) by an angle
684 <var>a</var> by letting <var>c</var> = cos(<var>a</var>), <var>s</var>
685 = sin(<var>a</var>), and using the following.</p>
686
687 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><code>-affine <var>c</var>,<var>s</var>,-<var>s</var>,<var>c</var>
688 </code></pre>
689
690 <p>The cumulative effect of a sequence of <a href="#affine" >-affine</a>
691 transformations can be accomplished by instead by a single <a href="#affine"
692 >-affine</a> operation using the matrix equal to the product of the matrices
693 of the individual transformations.</p>
694
695 <p>An attempt is made to detect near-singular transformation matrices. If the
696 matrix determinant has a sufficiently small absolute value it is rejected.</p>
697
698 <div style="mx-auto my-3 text-center">
699 <h2><a class="anchor" id="alpha"></a>-alpha <var>type</var></h2>
700 </div>
701
702 <p class="lead">Gives control of the alpha/matte channel of an image.</p>
703
704 <p>Used to set a flag on an image indicating whether or not to use existing alpha
705 channel data, to create an alpha channel, or to perform other operations on the alpha channel. Choose the argument <var>type</var> from the list below.</p>
706
707 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
708 <dl class="row">
709 <dt class="col-md-4">activate</dt>
710 <dd class="col-md-8">
711 Enable the image's transparency channel. Note normally Set
712 should be used instead of this, unless you specifically need to
713 preserve existing (but specifically turned Off) transparency
714 channel. </dd>
715
716 <dt class="col-md-4">associate</dt>
717 <dd class="col-md-8">
718 associate the alpha channel with the image.</dd>
719
720 <dt class="col-md-4">background</dt>
721 <dd class="col-md-8">
722 Set any fully-transparent pixel to the background color, while leaving
723 it fully-transparent. This can make some image file formats, such as
724 PNG, smaller as the RGB values of transparent pixels are more uniform,
725 and thus can compress better.
726 </dd>
727
728 <dt class="col-md-4">copy</dt>
729 <dd class="col-md-8">
730 Turns 'On' the alpha/matte channel, then copies the
731 grayscale intensity of the image, into the alpha channel, converting
732 a grayscale mask into a transparent shaped mask ready to be colored
733 appropriately. The color channels are not modified. </dd>
734
735 <dt class="col-md-4">deactivate</dt>
736 <dd class="col-md-8">
737 Disables the image's transparency channel. Does not delete or change the
738 existing data, just turns off the use of that data.</dd>
739
740 <dt class="col-md-4">disassociate</dt>
741 <dd class="col-md-8">
742 disassociate the alpha channel from the image.</dd>
743
744 <dt class="col-md-4">extract</dt>
745 <dd class="col-md-8">
746 Copies the alpha channel values into all the color channels and turns
747 'Off' the image's transparency, so as to generate
748 a grayscale mask of the image's shape. The alpha channel data is left
749 intact just deactivated. This is the inverse of 'Copy'.
750 </dd>
751
752 <dt class="col-md-4">off</dt>
753 <dd class="col-md-8">
754 disable the alpha channel.
755 </dd>
756
757 <dt class="col-md-4">off-if-opaque</dt>
758 <dd class="col-md-8">
759 disable the alpha channel if and only if its entirely opaque.
760 </dd>
761
762 <dt class="col-md-4">on</dt>
763 <dd class="col-md-8">
764 enable the alpha channel.
765 </dd>
766
767 <dt class="col-md-4">opaque</dt>
768 <dd class="col-md-8">
769 Enables the alpha/matte channel and forces it to be fully opaque.
770 </dd>
771
772 <dt class="col-md-4">remove</dt>
773 <dd class="col-md-8">
774 Composite the image over the background color.
775 </dd>
776
777 <dt class="col-md-4">set</dt>
778 <dd class="col-md-8">
779 Activates the alpha/matte channel. If it was previously turned off
780 then it also resets the channel to opaque. If the image already had
781 the alpha channel turned on, it will have no effect.</dd>
782
783 <dt class="col-md-4">shape</dt>
784 <dd class="col-md-8">
785 As per 'Copy' but also colors the resulting shape mask with
786 the current background color. That is the RGB color channels is
787 replaced, with appropriate alpha shape.
788 </dd>
789
790 <dt class="col-md-4">transparent</dt>
791 <dd class="col-md-8">
792 Activates the alpha/matte channel and forces it to be fully
793 transparent. This effectively creates a fully transparent image the
794 same size as the original and with all its original RGB data still
795 intact, but fully transparent. </dd>
796
797 </dl>
798 </div>
799 <br/>
800
801 <p>Note that while the obsolete <code>+matte</code> operation was the
802 same as "<code><a href="#alpha" >-alpha</a> Off</code>", the <code>
803 >-matte</code> operation was the same as "<code><a href="#alpha" >-alpha</a>
804 Set</code>" and not "<code><a href="#alpha" >-alpha</a> On</code>". </p>
805
806 <div style="mx-auto my-3 text-center">
807 <h2><a class="anchor" id="annotate"></a>-annotate <var>degrees</var> <var>text</var></h2>
808 <h2><a class="anchor"></a>-annotate <var>Xdegrees</var>x<var>Ydegrees</var> <var>text</var></h2>
809 <h2><a class="anchor"></a>-annotate <var>Xdegrees</var>x<var>Ydegrees</var>{+-}<var>t<sub>x</sub></var>{+-}<var>t<sub>y</sub></var> <var>text</var></h2>
810 <h2><a class="anchor"></a>-annotate {+-}<var>t<sub>x</sub></var>{+-}<var>t<sub>y</sub></var> <var>text</var></h2>
811 </div>
812
813 <p class="lead">Annotate an image with text</p>
814
815 <p>This is a convenience for annotating an image with text. For more precise
816 control over text annotations, use <a href="#draw">-draw</a>.</p>
817
818
819 <p>The values <var>Xdegrees</var> and <var>Ydegrees</var>
820 control the shears applied to the text, while <var>t<sub>x</sub></var> and <var>t<sub>y</sub></var> are offsets that give the location of the text relative any <a href="#gravity" >-gravity</a> setting and defaults to the upper left corner of the image.</p>
821
822 <p>Using <a href="#annotate">-annotate</a> <var>degrees</var>
823 or <a href="#annotate">-annotate</a> <var>degrees</var>x<var>degrees</var> produces an unsheared rotation of the text. The
824 direction of the rotation is positive, which means a clockwise rotation if <var>degrees</var> is positive. (This conforms to the usual mathematical
825 convention once it is realized that the positive <var>y</var>–direction is
826 conventionally considered to be <var>downward</var> for images.)</p>
827
828 <p>The new (transformed) coordinates (<var>x'</var>, <var>y'</var>) of a pixel at position (<var>x</var>, <var>y</var>) in the image are calculated using the following matrix
829 equation.</p>
830
831 <p class="text-center"><img class="img-fluid img-thumbnail" alt="annotate transformation" src="../image/annotate.png"/></p>
832
833 <p>If <var>t<sub>x</sub></var> and <var>t<sub>y</sub></var> are omitted, they default to 0. This makes the
834 bottom-left of the text becomes the upper-left corner of the image, which is
835 probably undesirable. Adding a <a href="#gravity" >-gravity</a> option in this
836 case leads to nice results.</p>
837
838 <p>Text is any UTF-8 encoded character sequence. If <var>text</var>
839 is of the form '@mytext.txt', the text is read from the file
840 <code>mytext.txt</code>. Text in a file is taken literally; no embedded
841 formatting characters are recognized.</p>
842
843 <div style="mx-auto my-3 text-center">
844 <h2><a class="anchor" id="antialias"></a>-antialias</h2>
845 </div>
846
847 <p class="lead">Enable/Disable of the rendering of anti-aliasing pixels when drawing fonts and lines.</p>
848
849 <p>By default, objects (e.g. text, lines, polygons, etc.) are antialiased when
850 drawn. Use <a href="#antialias">+antialias</a> to disable the addition of
851 antialiasing edge pixels. This will then reduce the number of colors added to
852 an image to just the colors being directly drawn. That is, no mixed colors
853 are added when drawing such objects. </p>
854
855 <div style="mx-auto my-3 text-center">
856 <h2><a class="anchor" id="append"></a>-append</h2>
857 </div>
858
859 <p class="lead">Join current images vertically or horizontally.</p>
860
861 <p>This option creates a single longer image, by joining all the current
862 images in sequence top-to-bottom. Use <a href="#append">+append</a> to
863 stack images left-to-right. </p>
864
865 <p>If they are not of the same width, narrower images are padded with the
866 current <a href="#background">-background</a> color setting, and their
867 position relative to each other can be controlled by the current <a
868 href="#gravity">-gravity</a> setting. </p>
869
870 <p>For more flexible options, including the ability to add space between images,
871 use <a href="#smush">-smush</a>.</p>
872
873 <div style="mx-auto my-3 text-center">
874 <h2><a class="anchor" id="attenuate"></a>-attenuate <var>value</var></h2>
875 </div>
876
877 <p class="lead">Lessen (or intensify) when adding noise to an image.</p>
878
879 <p>If unset the value is equivalent to 1.0, or a maximum noise addition</p>
880
881 <div style="mx-auto my-3 text-center">
882 <h2><a class="anchor" id="authenticate"></a>-authenticate <var>password</var></h2>
883 </div>
884
885 <p class="lead">Decrypt a PDF with a password.</p>
886
887 <p>Use this option to supply a <var>password</var> for decrypting
888 a PDF that has been encrypted using Microsoft Crypto API (MSC API). The
889 encrypting using the MSC API is not supported.</p>
890
891 <p>For a different encryption method, see <a href="#encipher">-encipher</a>
892 and <a href="#decipher">-decipher</a>. </p>
893
894
895 <div style="mx-auto my-3 text-center">
896 <h2><a class="anchor" id="auto-gamma"></a>-auto-gamma</h2>
897 </div>
898
899 <p class="lead">Automagically adjust gamma level of image.</p>
900
901 <p>This calculates the mean values of an image, then applies a calculated <a
902 href="#gamma" >-gamma</a> adjustment so that the mean color in the
903 image will get a value of 50%. </p>
904
905 <p>This means that any solid 'gray' image becomes 50% gray. </p>
906
907 <p>This works well for real-life images with little or no extreme dark and
908 light areas, but tend to fail for images with large amounts of bright sky or
909 dark shadows. It also does not work well for diagrams or cartoon like images.
910 </p>
911
912 <p>It uses the <a href="#channel" >-channel</a> setting, (including the
913 '<var>sync</var>' flag for channel synchronization), to determine which color
914 values is used and modified. As the default <a href="#channel"
915 >-channel</a> setting is '<var>RGB,sync</var>', channels are modified
916 together by the same gamma value, preserving colors. </p>
917
918
919
920 <div style="mx-auto my-3 text-center">
921 <h2><a class="anchor" id="auto-level"></a>-auto-level</h2>
922 </div>
923
924 <p class="lead">Automagically adjust color levels of image.</p>
925
926 <p>This is a 'perfect' image normalization operator. It finds the exact
927 minimum and maximum color values in the image and then applies a <a
928 href="#level" >-level</a> operator to stretch the values to the full range of
929 values. </p>
930
931 <p>The operator is not typically used for real-life images, image scans, or
932 JPEG format images, as a single 'out-rider' pixel can set a bad min/max values
933 for the <a href="#level" >-level</a> operation. On the other hand it is the
934 right operator to use for color stretching gradient images being used to
935 generate Color lookup tables, distortion maps, or other 'mathematically'
936 defined images. </p>
937
938 <p>The operator is very similar to the <a href="#normalize">-normalize</a>, <a
939 href="#contrast-stretch" >-contrast-stretch</a>, and <a href="#linear-stretch"
940 >-linear-stretch</a> operators, but without 'histogram binning' or 'clipping'
941 problems that these operators may have. That is <a href="#auto-level"
942 >-auto-level</a> is the perfect or ideal version these operators. </p>
943
944 <p>It uses the <a href="#channel" >-channel</a> setting, (including the
945 special '<var>sync</var>' flag for channel synchronization), to determine
946 which color values are used and modified. As the default <a
947 href="#channel" >+channel</a> setting is '<var>RGB,sync</var>', the
948 '<var>sync</var>' ensures that the color channels will are modified
949 together by the same gamma value, preserving colors, and ignoring
950 transparency. </p>
951
952
953 <div style="mx-auto my-3 text-center">
954 <h2><a class="anchor" id="auto-orient"></a>-auto-orient</h2>
955 </div>
956
957 <p class="lead">Adjusts an image so that its orientation is suitable for viewing (i.e. top-left orientation).</p>
958
959 <p>This operator reads and resets the EXIF image profile setting 'Orientation'
960 and then performs the appropriate 90 degree rotation on the image to orient
961 the image, for correct viewing. </p>
962
963 <p>This EXIF profile setting is usually set using a gravity sensor in digital
964 camera, however photos taken directly downward or upward may not have an
965 appropriate value. Also images that have been orientation 'corrected' without
966 reseting this setting, may be 'corrected' again resulting in a incorrect
967 result. If the EXIF profile was previously stripped, the <a
968 href="#auto-orient" >-auto-orient</a> operator will do nothing. </p>
969
970 <div style="mx-auto my-3 text-center">
971 <h2><a class="anchor" id="auto-threshold"></a>-auto-threshold <var>method</var></h2>
972 </div>
973
974 <p class="lead">Automatically perform image thresholding.</p>
975
976 <p>Here are the valid methods:</p>
977
978 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
979 <dl class="row">
980 <dt class="col-md-4">Undefined</dt><dd class="col-md-8">0: No method specified (equivalent to '<code>OTSU</code>').</dd>
981 <dt class="col-md-4">Kapur</dt><dd class="col-md-8">maximum entropy thresholding.</dd>
982 <dt class="col-md-4">OTSU</dt><dd class="col-md-8">cluster-based image thresholding.</dd>
983 <dt class="col-md-4">Triangle</dt><dd class="col-md-8">a geometric thresholding method.</dd>
984 </dl>
985 </div>
986
987 <p>The computed threshold is returned as the <code>auto-threshold:verbose</code> image property. To instead print to your device, use <code>-define auto-threshold:verbose=true</code>.</p>
988
989 <div style="mx-auto my-3 text-center">
990 <h2><a class="anchor" id="average"></a>-average</h2>
991 </div>
992
993 <p class="lead">Average a set of images.</p>
994
995 <p>An error results if the images are not identically sized.</p>
996
997
998 <div style="mx-auto my-3 text-center">
999 <h2><a class="anchor" id="backdrop"></a>-backdrop</h2>
1000 </div>
1001
1002 <p class="lead">Display the image centered on a backdrop.</p>
1003
1004 <p>This backdrop covers the entire workstation screen and is useful for hiding
1005 other X window activity while viewing the image. The color of the backdrop is
1006 specified as the background color. The color is specified using the format
1007 described under the <a href="#fill">-fill</a> option.</p>
1008
1009 <div style="mx-auto my-3 text-center">
1010 <h2><a class="anchor" id="background"></a>-background <var>color</var></h2>
1011 </div>
1012
1013 <p class="lead">Set the background color.</p>
1014
1015 <p>The color is specified using the format described under the <a
1016 href="#fill">-fill</a> option. The default background color (if none is
1017 specified or found in the image) is white.</p>
1018
1019 <div style="mx-auto my-3 text-center">
1020 <h2><a class="anchor" id="bench"></a>-bench <var>iterations</var></h2>
1021 </div>
1022
1023 <p class="lead">Measure performance.</p>
1024
1025 <p>Repeat the entire command for the given number of <var>iterations</var> and report the user-time and elapsed time. For instance,
1026 consider the following command and its output. Modify the benchmark with the
1027 -duration to run the benchmark for a fixed number of seconds and -concurrent
1028 to run the benchmark in parallel (requires the OpenMP feature).</p>
1029
1030 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><samp>$ magick logo: -resize 200% -bench 5 logo.png
1031 Performance[1]: 5i 1.344ips 1.000e 3.710u 0:03.720
1032 Performance[2]: 5i 1.634ips 0.549e 3.890u 0:03.060
1033 Performance[3]: 5i 2.174ips 0.618e 3.190u 0:02.300
1034 Performance[4]: 5i 1.678ips 0.555e 3.810u 0:02.980
1035 Performance[4]: 5i 0.875657ips 6.880u 0:05.710
1036 </samp></pre>
1037
1038 <p>In this example, 5 iterations were completed at 2.174 iterations per
1039 second, using 3 threads and 3.190 seconds of the user allotted time, for
1040 a total elapsed time of 2.300 seconds.</p>
1041
1042 <div style="mx-auto my-3 text-center">
1043 <h2><a class="anchor" id="bias"></a>-bias <var>value</var>{<var>%</var>}</h2>
1044 </div>
1045
1046 <p class="lead">Add bias when convolving an image.</p>
1047
1048 <p>This option shifts the output of <a href="#convolve">-convolve</a> so that
1049 positive and negative results are relative to the specified bias value. </p>
1050
1051 <p>This is important for non-HDRI compilations of ImageMagick when dealing
1052 with convolutions that contain negative as well as positive values. This is
1053 especially the case with convolutions involving high pass filters or edge
1054 detection. Without an output bias, the negative values are clipped at
1055 zero.</p>
1056
1057 <p>When using an ImageMagick with the HDRI compile-time setting, <a href="#bias">-bias</a>is not needed, as ImageMagick is able to store/handle any
1058 negative results without clipping to the color value range
1059 (0..QuantumRange).</p>
1060
1061 <p>See the discussion on HDRI implementations of ImageMagick on the page <a
1062 href="../high-dynamic-range/index.html" >High Dynamic-Range Images</a>. For more
1063 about HDRI go the ImageMagick <a
1064 href="https://usage.imagemagick.org/basics/#hdri" >Usage</a> pages or this
1065 <a
1066 href="http://en.wikipedia.org/wiki/High_dynamic_range_imaging">Wikipedia</a>
1067 entry. </p>
1068
1069 <div style="mx-auto my-3 text-center">
1070 <h2><a class="anchor" id="bilateral-blur"></a>-bilateral-blur <var>width</var>{x<var>height</var>}{<var>+intensity-sigma</var>}{<var>+spatial-sigma</var>}</h2>
1071 </div>
1072
1073 <p class="lead">A non-linear, edge-preserving, and noise-reducing
1074 smoothing filter for images. It replaces the intensity of each pixel with a
1075 weighted average of intensity values from nearby pixels. This weight is
1076 based on a Gaussian distribution. The weights depend not only on Euclidean
1077 distance of pixels, but also on the radiometric differences (e.g., range
1078 differences, such as color intensity, depth distance, etc.). This preserves
1079 sharp edges.</p>
1080
1081 <p>The intensity sigma is in the intensity space. A larger value means
1082 that farther colors within the pixel neighborhood (see spatial-sigma)
1083 will be mixed together, resulting in larger areas of semi-equal color.</p>
1084
1085 <p>The spatial sigma is in the coordinate space. A larger value means that
1086 farther pixels influence each other as long as their colors are close
1087 enough (see intensity-sigma ). When the neighborhood diameter is greater
1088 than zero, it specifies the neighborhood size regardless of
1089 spatial-sigma. Otherwise, the neighborhood diameter is proportional to
1090 spatial-sigma.</p>
1091 <p>The default value for the intensity and spatial sigmas are <var>0.75*diameter</var> and <var>0.25*diameter</var> respectively.</p>
1092
1093
1094 <div style="mx-auto my-3 text-center">
1095 <h2><a class="anchor" id="black-point-compensation"></a>-black-point-compensation</h2>
1096 </div>
1097
1098 <p class="lead">Use black point compensation.</p>
1099
1100 <div style="mx-auto my-3 text-center">
1101 <h2><a class="anchor" id="black-threshold"></a>-black-threshold <var>value</var>{<var>%</var>}</h2>
1102 </div>
1103
1104 <p class="lead">Force to black all pixels below the threshold while leaving all pixels at or above the threshold unchanged.</p>
1105
1106 <p> The threshold value can be given as a percentage or as an absolute integer
1107 value within [0, <var>QuantumRange</var>] corresponding to the
1108 desired <a href="#channel">channel</a> value. See <a href="#threshold">-threshold</a>
1109 for more details on thresholds and resulting values. </p>
1110
1111
1112 <div style="mx-auto my-3 text-center">
1113 <h2><a class="anchor" id="blend"></a>-blend <var>geometry</var></h2>
1114 </div>
1115
1116 <p class="lead">Blend an image into another by the given absolute value or percent.</p>
1117
1118 <p>Blend will average the images together ('plus') according to the
1119 percentages given and each pixels transparency. If only a single percentage
1120 value is given it sets the weight of the composite or 'source' image, while
1121 the background image is weighted by the exact opposite amount. That is a
1122 <code>-blend 30%</code> merges 30% of the 'source' image with 70% of the
1123 'destination' image. Thus it is equivalent to <code>-blend 30x70%</code>.</p>
1124
1125
1126 <div style="mx-auto my-3 text-center">
1127 <h2><a class="anchor" id="blue-primary"></a>-blue-primary <var>x</var>,<var>y</var></h2>
1128 </div>
1129
1130 <p class="lead">Set the blue chromaticity primary point.</p>
1131
1132 <div style="mx-auto my-3 text-center">
1133 <h2><a class="anchor" id="blue-shift"></a>-blue-shift <var>factor</var></h2>
1134 </div>
1135
1136 <p class="lead">Simulate a scene at nighttime in the moonlight. Start with a factor of 1.5</p>
1137
1138 <div style="mx-auto my-3 text-center">
1139
1140 <div style="mx-auto my-3 text-center">
1141 <h2><a class="anchor" id="blur"></a>-blur <var>radius</var><br />-blur <var>radius</var>{x<var>sigma</var>}</h2>
1142 </div>
1143
1144 <p class="lead">Reduce image noise and reduce detail levels.</p>
1145
1146 <p>Convolve the image with a Gaussian or normal distribution using the given
1147 <var >Sigma</var> value. The formula is:</p>
1148
1149 <p class="text-center"><img class="img-fluid img-thumbnail" alt="gaussian distribution" width="243px" height="42px" src="../image/gaussian-blur.png"/></p>
1150
1151 <p>The <var>sigma</var> value is the important argument, and
1152 determines the actual amount of blurring that will take place. </p>
1153
1154 <p>The <var>radius</var> is only used to determine the size of the
1155 array which holds the calculated Gaussian distribution. It should be an
1156 integer. If not given, or set to zero, IM will calculate the largest possible
1157 radius that will provide meaningful results for the Gaussian distribution.
1158 </p>
1159
1160 <p>The larger the <var >Radius</var> the slower the
1161 operation is. However too small a <var >Radius</var>, and severe
1162 aliasing effects may result. As a guideline, <var >Radius</var>
1163 should be at least twice the <var >Sigma</var> value, though three
1164 times will produce a more accurate result. </p>
1165
1166 <p>This option differs from <a href="#gaussian-blur">-gaussian-blur</a> simply
1167 by taking advantage of the separability properties of the distribution. Here
1168 we apply a single-dimensional Gaussian matrix in the horizontal direction,
1169 then repeat the process in the vertical direction.</p>
1170
1171 <p>The <a href="#virtual-pixel">-virtual-pixel</a> setting will determine how
1172 pixels which are outside the image proper are blurred into the final result.
1173 </p>
1174
1175
1176 <div style="mx-auto my-3 text-center">
1177 <h2><a class="anchor" id="border"></a>-border <var>geometry</var></h2>
1178 </div>
1179
1180 <p class="lead">Surround the image with a border of color. </p>
1181
1182 <p>Set the width and height using the <var>size</var> portion of the
1183 <var>geometry</var> argument. See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument. Offsets are
1184 ignored. </p>
1185
1186 <p>As of IM 6.7.8-8, the <var>geometry</var> arguments behave as follows:</p>
1187
1188 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
1189 <dl class="row">
1190 <dt class="col-md-4"><var>value</var></dt>
1191 <dd class="col-md-8">value is added to both left/right and top/bottom</dd>
1192 <dt class="col-md-4"><var>value-x</var><code>x</code></dt>
1193 <dd class="col-md-8">value-x is added only to left/right and top/bottom are unchanged</dd>
1194 <dt class="col-md-4"><code>x</code><var>value-y</var></dt>
1195 <dd class="col-md-8">value-y is added only to top/bottom and left/right are unchanged</dd>
1196 <dt class="col-md-4"><var>value-x</var><code>x</code><var>value-y</var></dt>
1197 <dd class="col-md-8">value-x is added to left/right and value-y added to top/bottom</dd>
1198 <dt class="col-md-4"><var>value-x</var><code>x</code>0</dt>
1199 <dd class="col-md-8">value-x is added only to left/right and top/bottom are unchanged</dd>
1200 <dt class="col-md-4">0<code>x</code><var>value-y</var></dt>
1201 <dd class="col-md-8">value-y is added only to top/bottom and left/right are unchanged</dd>
1202 <dt class="col-md-4"><var>value</var>%</dt>
1203 <dd class="col-md-8">value % of width is added to left/right and value % of height is added to top/bottom</dd>
1204 <dt class="col-md-4"><var>value-x</var><code>x</code>%</dt>
1205 <dd class="col-md-8">value-x % of width is added to left/right and to top/bottom</dd>
1206 <dt class="col-md-4">x<var>value-y</var>%</dt>
1207 <dd class="col-md-8">value-y % of height is added to top/bottom and to left/right</dd>
1208 <dt class="col-md-4"><var>value-x</var>%<code>x</code><var>value-y</var>%</dt>
1209 <dd class="col-md-8">value-x % of width is added to left/right and value-y % of height is added to top/bottom</dd>
1210 <dt class="col-md-4"><var>value-x</var>%<code>x</code>0%</dt>
1211 <dd class="col-md-8">value-x % of width is added to left/right and top/bottom are unchanged</dd>
1212 <dt class="col-md-4">0%<code>x</code><var>value-y</var>%</dt>
1213 <dd class="col-md-8">value-y % of height is added to top/bottom and left/right are unchanged</dd>
1214 </dl>
1215 </div>
1216
1217 <p>Set the border color by preceding with the <a
1218 href="#bordercolor">-bordercolor</a> setting.</p>
1219
1220 <p>The <a href="#border">-border</a> operation is affected by the current <a
1221 href="#compose">-compose</a> setting and assumes that this is using the default
1222 '<code>Over</code>' composition method. It generates an image of the appropriate
1223 size colors by the current <a href="#bordercolor">-bordercolor</a> before
1224 overlaying the original image in the center of this net image. This means that
1225 with the default compose method of '<code>Over</code>' any transparent parts may
1226 be replaced by the current <a href="#bordercolor">-bordercolor</a> setting.</p>
1227 <p>See also the <a href="#frame">-frame</a> option, which has more
1228 functionality.</p>
1229
1230 <div style="mx-auto my-3 text-center">
1231 <h2><a class="anchor" id="bordercolor"></a>-bordercolor <var>color</var></h2>
1232 </div>
1233
1234 <p class="lead">Set the border color.</p>
1235
1236 <p>The color is specified using the format described under the <a href="#fill">-fill</a> option.</p>
1237
1238 <p>The default border color is <code>#DFDFDF</code>, <span style="background-color: #dfdfdf;">this shade of gray</span>.</p>
1239
1240 <div style="mx-auto my-3 text-center">
1241 <h2><a class="anchor" id="borderwidth"></a>-borderwidth <var>geometry</var> </h2>
1242 </div>
1243
1244 <p class="lead">Set the border width.</p>
1245
1246 <div style="mx-auto my-3 text-center">
1247 <h2><a class="anchor" id="brightness-contrast"></a>-brightness-contrast <var>brightness</var><br />-brightness-contrast <var>brightness</var>{x<var>contrast</var>}{<var>%</var>}</h2>
1248 </div>
1249
1250 <p class="lead">Adjust the brightness and/or contrast of the image.</p>
1251
1252 <p>Brightness and Contrast values apply changes to the input image. They are
1253 not absolute settings. A brightness or contrast value of zero means no change.
1254 The range of values is -100 to +100 on each. Positive values increase the
1255 brightness or contrast and negative values decrease the brightness or contrast.
1256 To control only contrast, set the brightness=0. To control only brightness,
1257 set contrast=0 or just leave it off.</p>
1258
1259 <p>You may also use <a href="#fill">-channel</a> to control which channels to
1260 apply the brightness and/or contrast change. The default is to apply the same
1261 transformation to all channels.</p>
1262
1263 <p>Brightness and Contrast arguments are converted to offset and slope of a
1264 linear transform and applied
1265 using <a href="#fill">-function polynomial "slope,offset"</a>.</p>
1266
1267 <p>The slope varies from 0 at contrast=-100 to almost vertical at
1268 contrast=+100. For brightness=0 and contrast=-100, the result are totally
1269 midgray. For brightness=0 and contrast=+100, the result will approach but
1270 not quite reach a threshold at midgray; that is the linear transformation
1271 is a very steep vertical line at mid gray.</p>
1272
1273 <p>Negative slopes, i.e. negating the image, are not possible with this
1274 function. All achievable slopes are zero or positive.</p>
1275
1276 <p>The offset varies from -0.5 at brightness=-100 to 0 at brightness=0 to +0.5
1277 at brightness=+100. Thus, when contrast=0 and brightness=100, the result is
1278 totally white. Similarly, when contrast=0 and brightness=-100, the result is
1279 totally black.</p>
1280
1281 <p>As the range of values for the arguments are -100 to +100, adding the '%'
1282 symbol is no different than leaving it off.</p>
1283
1284 <div style="mx-auto my-3 text-center">
1285 <h2><a class="anchor" id="cache"></a>-cache <var>threshold</var></h2>
1286 </div>
1287
1288 <p class="lead">(This option has been replaced by the <a href='#limit'>-limit</a> option).</p>
1289
1290 <div style="mx-auto my-3 text-center">
1291 <h2><a class="anchor" id="canny"></a>-canny <var>radius</var><br/>-canny <var>radius</var>{x<var>sigma</var>}{<var>+lower-percent</var>}{<var>+upper-percent</var>}</h2>
1292 </div>
1293
1294 <p class="lead">Canny edge detector uses a multi-stage algorithm to detect a wide range of edges in the image.</p>
1295
1296 <p>The thresholds range from 0 to 100% (e.g. -canny 0x1+10%+30%) with {<var>+lower-percent</var>} &lt; {<var>+upper-percent</var>}. If {<var>+upper-percent</var>} is increased but {<var>+lower-percent</var>} remains the same, lesser edge components will be detected, but their lengths will be the same. If {<var>+lower-percent</var>} is increased but {<var>+upper-percent</var>} is the same, the same number of edge components will be detected but their lengths will be shorter. The default thresholds are shown.</p>
1297 <p>The <var>radius</var>{x<var>sigma</var>} controls a gaussian blur applied to the input image to reduce noise and smooth the edges.</p>
1298 <p>The <var>sigma</var> value is the important argument, and
1299 determines the actual amount of blurring that will take place. </p>
1300
1301 <p>The <var>radius</var> is only used to determine the size of the
1302 array which holds the calculated Gaussian distribution. It should be an
1303 integer. If not given, or set to zero, IM will calculate the largest possible
1304 radius that will provide meaningful results for the Gaussian distribution.
1305 </p>
1306
1307 <div style="mx-auto my-3 text-center">
1308 <h2><a class="anchor" id="caption"></a>-caption <var>string</var></h2>
1309 </div>
1310
1311 <p class="lead">Assign a caption to an image.</p>
1312
1313 <p>This option sets the caption meta-data of an image read in after this
1314 option has been given. To modify a caption of images already in memory use
1315 "<code><a href="#set">-set</a> caption</code>". </p>
1316
1317 <p>The caption can contain special format characters listed in the <a
1318 href="../escape/index.html">Format and
1319 Print Image Properties</a>. These attributes are expanded when the caption
1320 is finally assigned to the individual images. </p>
1321
1322 <p>If the first character of <var>string</var> is <var>@</var>, the image caption is read from a file titled by the
1323 remaining characters in the string. Comments read in from a file are literal;
1324 no embedded formatting characters are recognized.</p>
1325
1326 <p>Caption meta-data is not visible on the image itself. To do that use the
1327 <a href="#annotate">-annotate</a> or <a href="#draw">-draw</a> options
1328 instead.</p>
1329
1330 <p>For example,</p>
1331
1332 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><code>-caption "%m:%f %wx%h" bird.miff
1333 </code></pre>
1334
1335 <p>produces an image caption of <code>MIFF:bird.miff 512x480</code> (assuming
1336 that the image <code>bird.miff</code> has a width of 512 and a height of
1337 480.</p>
1338
1339
1340 <div style="mx-auto my-3 text-center">
1341 <h2><a class="anchor" id="cdl"></a>-cdl <var>filename</var></h2>
1342 </div>
1343
1344 <p class="lead">Color correct with a color decision list.</p>
1345
1346 <p>Here is an example color correction collection:</p>
1347
1348 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
1349 &lt;ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2"&gt;
1350 &lt;ColorCorrection id="cc06668"&gt;
1351 &lt;SOPNode&gt;
1352 &lt;Slope&gt; 0.9 1.2 0.5 &lt;/Slope&gt;
1353 &lt;Offset&gt; 0.4 -0.5 0.6 &lt;/Offset&gt;
1354 &lt;Power&gt; 1.0 0.8 1.5 &lt;/Power&gt;
1355 &lt;/SOPNode&gt;
1356 &lt;SATNode&gt;
1357 &lt;Saturation&gt; 0.85 &lt;/Saturation&gt;
1358 &lt;/SATNode&gt;
1359 &lt;/ColorCorrection&gt;
1360 &lt;/ColorCorrectionCollection&gt;
1361 </code></pre>
1362
1363 <div style="mx-auto my-3 text-center">
1364 <h2><a class="anchor" id="channel"></a>-channel <var>type</var></h2>
1365 </div>
1366
1367 <p class="lead">Specify those image color channels to which subsequent operators are limited.</p>
1368
1369 <p>Choose from: <code>Red</code>, <code>Green</code>, <code>Blue</code>,
1370 <code>Alpha</code>, <code>Gray</code>, <code>Cyan</code>, <code>Magenta</code>,
1371 <code>Yellow</code>, <code>Black</code>, <code>Opacity</code>,
1372 <code>Index</code>, <code>RGB</code>, <code>RGBA</code>, <code>CMYK</code>, or
1373 <code>CMYKA</code>.</p>
1374
1375 <p>The channels above can also be specified as a comma-separated list or can be
1376 abbreviated as a concatenation of the letters '<code>R</code>', '<code>G</code>',
1377 '<code>B</code>', '<code>A</code>', '<code>O</code>', '<code>C</code>',
1378 '<code>M</code>', '<code>Y</code>', '<code>K</code>'.</p>
1379
1380 <p>The numerals 0 to 31 may also be used to specify channels, where 0 to 5 are: <br />
1381 <ul>
1382 '<code>0</code>' equals <code>Red</code> or <code>Cyan</code> <br />
1383 '<code>1</code>' equals <code>Green</code> or <code>Magenta</code> <br />
1384 '<code>2</code>' equals <code>Blue</code> or <code>Yellow</code> <br />
1385 '<code>3</code>' equals <code>Black</code> <br />
1386 '<code>4</code>' equals <code>Alpha</code> or <code>Opacity</code> <br />
1387 '<code>5</code>' equals <code>Index</code></p>
1388 </ul>
1389
1390 <p>For example, to only select the <code>Red</code> and <code>Blue</code> channels
1391 you can use any of the following:</p>
1392 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary">
1393 <code>-channel Red,Blue</code>
1394 <code>-channel R,B</code>
1395 <code>-channel RB</code>
1396 <code>-channel 0,2</code>
1397 </pre>
1398
1399 <p>All the channels that are present in an image can be specified using the
1400 special channel type <code>All</code>. Not all operators are 'channel capable',
1401 but generally any operators that are generally 'grey-scale' image operators,
1402 will understand this setting. See individual operator documentation. </p>
1403
1404 <p>On top of the normal channel selection an extra flag can be specified,
1405 '<code>Sync</code>'. This is turned on by default and if set means that
1406 operators that understand this flag should perform: cross-channel
1407 synchronization of the channels. If not specified, then most grey-scale
1408 operators will apply their image processing operations to each individual
1409 channel (as specified by the rest of the <a href="#channel">-channel</a>
1410 setting) completely independently from each other. </p>
1411
1412 <p>For example for operators such as <a href="#auto-level">-auto-level</a> and
1413 <a href="#auto-gamma">-auto-gamma</a> the color channels are modified
1414 together in exactly the same way so that colors will remain in-sync. Without
1415 it being set, then each channel is modified separately and
1416 independently, which may produce color distortion. </p>
1417
1418 <p>The <a href="#morphology">-morphology</a> '<code>Convolve</code>' method
1419 and the <a href="#compose">-compose</a> mathematical methods, also understands
1420 the '<code>Sync</code>' flag to modify the behavior of pixel colors according
1421 to the alpha channel (if present). That is to say it will modify the image
1422 processing with the understanding that fully-transparent colors should not
1423 contribute to the final result. </p>
1424
1425 <p>Basically, by default, operators work with color channels in synchronous, and
1426 treats transparency as special, unless the <a href="#channel">-channel</a>
1427 setting is modified so as to remove the effect of the '<code>Sync</code>' flag.
1428 How each operator does this depends on that operators current implementation.
1429 Not all operators understands this flag at this time, but that is changing.
1430 </p>
1431
1432 <p>To print a complete list of channel types, use <a href="#list">-list
1433 channel</a>.</p>
1434
1435 <p>By default, ImageMagick sets <a href="#channel">-channel</a> to the value
1436 '<code>RGBK,sync</code>', which specifies that operators act on all color
1437 channels except the transparency channel, and that all the color channels are
1438 to be modified in exactly the same way, with an understanding of transparency
1439 (depending on the operation being applied). The 'plus' form <a
1440 href="#channel" >+channel</a> will reset the value back to this default. </p>
1441
1442 <p>Options that are affected by the <a href="#channel" >-channel</a> setting
1443 include the following.
1444
1445 <a href="#auto-gamma">-auto-gamma</a>,
1446 <a href="#auto-level">-auto-level</a>,
1447 <a href="#black-threshold">-black-threshold</a>,
1448 <a href="#blur">-blur</a>,
1449 <a href="#clamp">-clamp</a>,
1450 <a href="#clut">-clut</a>,
1451 <a href="#combine">-combine</a>,
1452 <a href="#composite">-composite</a> (Mathematical compose methods only),
1453 <a href="#convolve">-convolve</a>,
1454 <a href="#contrast-stretch">-contrast-stretch</a>,
1455 <a href="#evaluate">-evaluate</a>,
1456 <a href="#function">-function</a>,
1457 <a href="#fx">-fx</a>,
1458 <a href="#gaussian-blur">-gaussian-blur</a>,
1459 <a href="#hald-clut">-hald-clut</a>,
1460 <a href="#motion-blur">-motion-blur</a>,
1461 <a href="#morphology">-morphology</a>,
1462 <a href="#negate">-negate</a>,
1463 <a href="#normalize">-normalize</a>,
1464 <a href="#ordered-dither">-ordered-dither</a>,
1465 <a href="#rotational-blur">-rotational-blur</a>,
1466 <a href="#random-threshold">-random-threshold</a>,
1467 <a href="#range-threshold">-range-threshold</a>,
1468 <a href="#separate">-separate</a>,
1469 <a href="#threshold">-threshold</a>, and
1470 <a href="#white-threshold">-white-threshold</a>.
1471 </p>
1472
1473 <p>Warning, some operators behave differently when the <a href="#channel"
1474 >+channel</a> default setting is in effect, versus ANY user defined <a
1475 href="#channel" >-channel</a> setting (including the equivalent of the
1476 default). These operators have yet to be made to understand the newer 'Sync'
1477 flag. </p>
1478
1479 <p>For example <a href="#threshold">-threshold</a> will by default grayscale
1480 the image before thresholding, if no <a href="#channel" >-channel</a> setting
1481 has been defined. This is not 'Sync' flag controlled, yet. </p>
1482
1483 <p>Also some operators such as <a href="#blur">-blur</a>, <a
1484 href="#gaussian-blur">-gaussian-blur</a>, will modify their handling of the
1485 color channels if the '<code>alpha</code>' channel is also enabled by <a
1486 href="#channel" >-channel</a>. Generally this done to ensure that
1487 fully-transparent colors are treated as being fully-transparent, and thus any
1488 underlying 'hidden' color has no effect on the final results. Typically
1489 resulting in 'halo' effects. The newer <a href="#morphology">-morphology</a>
1490 convolution equivalents however does have a understanding of the 'Sync' flag
1491 and will thus handle transparency correctly by default. </p>
1492
1493 <p>As an alpha channel is optional within images, some operators will read the
1494 color channels of an image as a greyscale alpha mask, when the image has no
1495 alpha channel present, and the <a href="#channel" >-channel</a> setting tells
1496 the operator to apply the operation using alpha channels. The <a
1497 href="#clut">-clut</a> operator is a good example of this. </p>
1498
1499 <div style="mx-auto my-3 text-center">
1500 <h2><a class="anchor" id="channel-fx"></a>-channel-fx <var>expression</var></h2>
1501 </div>
1502
1503 <p class="lead">Exchange, extract, or copy one or more image channels.</p>
1504
1505 <p>The expression consists of one or more channels, either mnemonic or numeric (e.g. red or 0, green or 1, etc.), separated by certain operation symbols as follows:</p>
1506
1507 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>&lt;=&gt; exchange two channels (e.g. red&lt;=&gt;blue)
1508 =&gt; copy one channel to another channel (e.g. red=&gt;green)
1509 = assign a constant value to a channel (e.g. red=50%)
1510 , write new image with channels in the specified order (e.g. red, green)
1511 ; add a new output image for the next set of channel operations (e.g. red; green; blue)
1512 | move to the next input image for the source of channel data (e.g. | gray=>alpha)
1513 </code></pre>
1514
1515 <p>For example, to create 3 grayscale images from the red, green, and blue channels of an image, use:</p>
1516
1517 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><code>-channel-fx "red; green; blue"</code></pre>
1518
1519 <p>A channel without an operation symbol implies separate (i.e, semicolon).</p>
1520
1521 <p>Here we take an sRGB image and a grayscale image and inject the grayscale image into the alpha channel:</p>
1522 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick wizard.png mask.pgm -channel-fx '| gray=>alpha' wizard-alpha.png
1523 </samp></pre>
1524 <p>Use a similar command to define a read mask:</p>
1525 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><pre><samp>$ magick wizard.png mask.pgm -channel-fx '| gray=>read-mask' wizard-mask.png</samp></pre></pre>
1526
1527 <p>In this example, we compute the mean RGB value for all opaque pixels of an image:</p>
1528 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><pre><samp>$ magick wizard-alpha.png -channel-fx "alpha=>read-mask" -channel rgb -format "%[fx:mean]\n" info:</samp></pre></pre>
1529
1530 <p>Let's create two meta channels and populate them with a copy of the gray pixels:</p>
1531 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><pre><samp>$ magick gray.pgm -channel-fx "gray=>meta, gray=>meta1" gray.tif</samp></pre></pre>
1532 <p>Notice we save the results into a TIFF image file. Not all formats support multipectral images. TIFF, MIFF, MPC, and FTXT do.</p>
1533
1534 <p>Add <code>-debug pixel</code> prior to the <code>-channel-fx</code> option to track the channel morphology.</p>
1535
1536 <div style="mx-auto my-3 text-center">
1537 <h2><a class="anchor" id="charcoal"></a>-charcoal <var>factor</var></h2>
1538 </div>
1539
1540 <p class="lead">Simulate a charcoal drawing.</p>
1541
1542 <div style="mx-auto my-3 text-center">
1543 <h2><a class="anchor" id="chop"></a>-chop <var>geometry</var></h2>
1544 </div>
1545
1546 <p class="lead">Remove pixels from the interior of an image.</p>
1547
1548 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument. The <var>width</var>
1549 and <var>height</var> given in the of the <var>size</var>
1550 portion of the <var>geometry</var> argument give the number of
1551 columns and rows to remove. The <var>offset</var> portion of
1552 the <var>geometry</var> argument is influenced by
1553 a <a href="#gravity">-gravity</a> setting, if present.</p>
1554
1555 <p>The <a href="#chop">-chop</a> option removes entire rows and columns,
1556 and moves the remaining corner blocks leftward and upward to close the gaps.</p>
1557
1558 <p>While it can remove internal rows and columns of pixels, it is more
1559 typically used with as <a href="#gravity">-gravity</a> setting and zero
1560 offsets so as to remove a single edge from an image. Compare this to <a
1561 href="#shave" >-shave</a> which removes equal numbers of pixels from opposite
1562 sides of the image. </p>
1563
1564 <p>Using <a href="#chop">-chop</a> effectively undoes the results of a <a
1565 href="#splice">-splice</a> that was given the same <var>geometry</var> and <a href="#gravity">-gravity</a> settings. </p>
1566
1567 <div style="mx-auto my-3 text-center">
1568 <h2><a class="anchor" id="clahe"></a>-clahe <var>width</var>x<var>height</var>&#123%}{+}<var>number-bins</var>{+}<var>clip-limit</var>{!}</h2>
1569 </div>
1570
1571 <p class="lead">Contrast limited adaptive histogram equalization.</p>
1572 <p> The image is divided into tiles of <var>width</var> and <var>height</var> pixels. Append <code>%</code> to define the width and height as percentages of the image's dimensions. The tile size should be larger than the size of features to be preserved and respects the aspect ratio of the image. Add <code>!</code> to force an exact tile width and height. <var>number-bins</var> is the number of histogram bins per tile (min 2, max 65536). The number of histogram bins should be smaller than the number of pixels in a single tile. <var>clip-limit</var> is the contrast limit for localized changes in contrast. A clip-limit of 2 to 3 is a good starting place (e.g. -clahe 50x50%+128+3). Very large values will let the histogram equalization do whatever it wants to do, that is result in maximal local contrast. The value 1 will result in the original image. Note, if the number of bins and the clip-limit are omitted, they default to 128 and no clipping respectively.</p>
1573
1574
1575 <div style="mx-auto my-3 text-center">
1576 <h2><a class="anchor" id="clamp"></a>-clamp</h2>
1577 </div>
1578
1579 <p class="lead">Set each pixel whose value is below zero to zero and any the pixel whose value is above the quantum range to the quantum range (e.g. 65535) otherwise the pixel value remains unchanged.</p>
1580
1581 <div style="mx-auto my-3 text-center">
1582 <h2><a class="anchor" id="clip"></a>-clip</h2>
1583 </div>
1584
1585 <p class="lead">Apply the clipping path if one is present.</p>
1586
1587 <p>If a clipping path is present, it is applied to subsequent operations.</p>
1588
1589 <p>For example, in the command</p>
1590
1591 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick cockatoo.tif -clip -negate negated.tif
1592 </samp></pre>
1593
1594 <p>only the pixels within the clipping path are negated.</p>
1595
1596 <p>The <a href="#clip">-clip</a> feature requires SVG support. If the SVG
1597 delegate library is not present, the option is ignored.</p>
1598
1599 <p>Use <a href="#clip">+clip</a> to disable clipping for subsequent operations.</p>
1600
1601 <div style="mx-auto my-3 text-center">
1602 <h2><a class="anchor" id="clip-mask"></a>-clip-mask</h2>
1603 </div>
1604
1605 <p class="lead">Clip the image as defined by this mask.</p>
1606
1607 <p>Use the alpha channel of the current image as a mask. Any areas that is
1608 white is not modified by any of the 'image processing operators' that follow,
1609 until the mask is removed. Pixels in the black areas of the clip mask are
1610 modified per the requirements of the operator. </p>
1611
1612 <p>In some ways this is similar to (though not the same) as defining
1613 a rectangular <a href="#region" >-region</a>, or using the negative of the
1614 mask (third) image in a three image <a href="#composite" >-composite</a>,
1615 operation. </p>
1616
1617 <p>Use <a href="#clip-mask">+clip-mask</a> to disable clipping for subsequent operations.</p>
1618
1619 <div style="mx-auto my-3 text-center">
1620 <h2><a class="anchor" id="clip-path"></a>-clip-path <var>id</var></h2>
1621 </div>
1622
1623 <p class="lead">Clip along a named path from the 8BIM profile.</p>
1624
1625 <p>This is identical to <a href="#clip">-clip</a> except choose a specific clip path in the event the image has more than one path available. ImageMagick supports UTF-8 encoding. If your named path is in a different encoding, use `iconv` to convert the clip path name to that encoding otherwise the path name will not match.</p>
1626
1627 <p>Use <a href="#clip-path">+clip-path</a> to disable clipping for subsequent operations.</p>
1628
1629 <div style="mx-auto my-3 text-center">
1630 <h2><a class="anchor" id="clone"></a>-clone <var>index(s)</var></h2>
1631 </div>
1632
1633 <p class="lead">Make a clone of an image (or images).</p>
1634
1635 <p>Inside parenthesis (where the operator is normally used) it will make a
1636 clone of the images from the last 'pushed' image sequence, and adds them to
1637 the end of the current image sequence. If used outside parentheses, an error is raised. </p>
1638
1639 <p>Specify the image by its index in the sequence. The first image is index
1640 0. Negative indexes are relative to the end of the sequence; for
1641 example, <code>−1</code>
1642 represents the last image of the sequence. Specify a range of images with a
1643 dash (e.g. <code>0−4</code>). Separate multiple indexes with commas but no
1644 spaces (e.g. <code>0,2,5</code>). A value of '<code>0−−1</code> will
1645 effectively clone all the images. </p>
1646
1647 <p>The <a href="#clone">+clone</a> will simply make a copy of the last image
1648 in the image sequence, and is thus equivalent to using an argument of
1649 '<code>−1</code>'. </p>
1650
1651 <div style="mx-auto my-3 text-center">
1652 <h2><a class="anchor" id="clut"></a>-clut</h2>
1653 </div>
1654
1655 <p class="lead">Replace the channel values in the first image using each corresponding channel in the second image as a <b>c</b>olor <b>l</b>ook<b>u</b>p <b>t</b>able.</p>
1656
1657 <p>The second (LUT) image is ordinarily a gradient image containing the
1658 histogram mapping of how each channel should be modified. Typically it is a
1659 either a single row or column image of replacement color values. If larger
1660 than a single row or column, values are taken from a diagonal line from
1661 top-left to bottom-right corners.</p>
1662
1663 <p>The lookup is further controlled by the <a
1664 href="#interpolate">-interpolate</a> setting, which is especially handy for an
1665 LUT which is not the full length needed by the ImageMagick installed Quality
1666 (Q) level. Good settings for this are '<code>bilinear</code>' and
1667 '<code>catrom</code>'. Catom can return a useful second-order continuity.</p>
1668
1669 <p>This operator is especially suited to replacing a grayscale image with a
1670 specific color gradient from the CLUT image. </p>
1671
1672 <p>Only the channel values defined by the <a href="#channel">-channel</a>
1673 setting will have their values replaced. In particular, since the default <a
1674 href="#channel">-channel</a> setting is <code>RGBA</code>, this means that
1675 transparency (alpha/matte channel) is affected, unless the <a
1676 href="#channel">-channel</a> setting is modified, e.g., <code>RGB</code>. When the alpha channel is not set, it is ignored by the <a href="#clut" >-clut</a> operator.</p>
1677
1678 <p>If either the image being modified, or the lookup image, contains no
1679 transparency (i.e. <a href="#alpha" >-alpha</a> is turned 'off') but the <a
1680 href="#channel">-channel</a> setting includes alpha replacement, then it is
1681 assumed that image represents a grayscale gradient which is used for the
1682 replacement alpha values. That is you can use a grayscale CLUT image to
1683 adjust a existing images alpha channel, or you can color a grayscale image
1684 using colors form CLUT containing the desired colors, including transparency.
1685 </p>
1686
1687 <p>See also <a href="#hald-clut" >-hald-clut</a> which replaces colors
1688 according to the lookup of the full color RGB value from a 2D representation
1689 of a 3D color cube. </p>
1690
1691
1692 <div style="mx-auto my-3 text-center">
1693 <h2><a class="anchor" id="coalesce"></a>-coalesce</h2>
1694 </div>
1695
1696 <p class="lead">Fully define the look of each frame of a GIF animation sequence, to form a 'film strip' animation.</p>
1697
1698 <p>Overlay each image in an image sequence according to
1699 its <a href="#dispose">-dispose</a> meta-data, to reproduce the look of
1700 an animation at each point in the animation sequence. All images should be
1701 the same size, and are assigned appropriate GIF disposal settings for the
1702 animation to continue working as expected as a GIF animation. Such frames
1703 are more easily viewed and processed than the highly optimized GIF overlay
1704 images. </p>
1705
1706 <p>The animation can be re-optimized after processing using
1707 the <a href="#layers">-layers</a> method '<code>optimize</code>', although
1708 there is no guarantee that the restored GIF animation optimization is
1709 better than the original. </p>
1710
1711
1712 <div style="mx-auto my-3 text-center">
1713 <h2><a class="anchor" id="colorize"></a>-colorize <var>value</var></h2>
1714 </div>
1715
1716 <p class="lead">Colorize the image by an amount specified by <var>value</var> using the color specified by the most recent <a href="#fill" >-fill</a> setting.</p>
1717
1718 <p>Specify the amount of colorization as a percentage. Separate colorization
1719 values can be applied to the red, green, and blue channels of the image with
1720 a comma-delimited list of colorization
1721 values (e.g., <code>-colorize 0,0,50</code>).</p>
1722
1723 <div style="mx-auto my-3 text-center">
1724 <h2><a class="anchor" id="colormap"></a>-colormap <var>type</var></h2>
1725 </div>
1726
1727 <p class="lead">Define the colormap type.</p>
1728
1729 <p>The <var>type</var> can be <code>shared</code> or <code>private</code>.</p>
1730
1731 <p>This option only applies when the default X server visual
1732 is <code>PseudoColor</code> or <code>GrayScale</code>. Refer
1733 to <a href="#visual">-visual</a> for more details. By default,
1734 a shared colormap is allocated. The image shares colors with
1735 other X clients. Some image colors could be approximated,
1736 therefore your image may look very different than intended.
1737 If <code>private</code> is chosen, the image colors appear exactly
1738 as they are defined. However, other clients may go <var>technicolor</var>
1739 when the image colormap is installed.</p>
1740
1741 <div style="mx-auto my-3 text-center">
1742 <h2><a class="anchor" id="colors"></a>-colors <var>value</var></h2>
1743 </div>
1744
1745 <p class="lead">Set the preferred number of colors in the image.</p>
1746
1747 <p>The actual number of colors in the image may be less than your request,
1748 but never more. Note that this a color reduction option. Images with fewer
1749 unique colors than specified by <var>value</var> will have any
1750 duplicate or unused colors removed. The ordering of an existing color
1751 palette may be altered. When converting an image from color to grayscale,
1752 it is more efficient to convert the image to the gray colorspace before
1753 reducing the number of colors. Refer to
1754 the <a href="../quantize/index.html">
1755 color reduction algorithm</a> for more details.</p>
1756
1757 <div style="mx-auto my-3 text-center">
1758 <h2><a class="anchor" id="color-matrix"></a>-color-matrix <var>matrix</var></h2>
1759 </div>
1760
1761 <p class="lead">Apply color correction to the image.</p>
1762
1763 <p>This option permits saturation changes, hue rotation, luminance to alpha,
1764 and various other effects. Although variable-sized transformation matrices
1765 can be used, typically one uses a 5x5 matrix for an RGBA image and a 6x6
1766 for CMYKA (or RGBA with offsets). The matrix is similar to
1767 <a href="https://code.tutsplus.com/manipulate-visual-effects-with-the-colormatrixfilter-and-convolutionfilter--active-3221t">that used by Adobe Flash</a>except Imagemagick's offsets are in column 6 rather than 5
1768 (in support of CMYKA images) and Imagemagick's offsets are normalized
1769 (divide Flash offsets by 255).</p>
1770
1771 <p>As an example, to add contrast to an image with offsets, try this command:</p>
1772
1773 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick kittens.jpg -color-matrix \
1774 " 1.5 0.0 0.0 0.0, 0.0, -0.157 \
1775 0.0 1.5 0.0 0.0, 0.0, -0.157 \
1776 0.0 0.0 1.5 0.0, 0.0, -0.157 \
1777 0.0 0.0 0.0 1.0, 0.0, 0.0 \
1778 0.0 0.0 0.0 0.0, 1.0, 0.0 \
1779 0.0 0.0 0.0 0.0, 0.0, 1.0" kittens.png
1780 </samp></pre>
1781 <div style="mx-auto my-3 text-center">
1782 <h2><a class="anchor" id="colorspace"></a>-colorspace <var>value</var></h2>
1783 </div>
1784
1785 <p class="lead">Set the image colorspace.</p>
1786
1787 <p>Choices are:</p>
1788
1789 <div class="overflow-auto" style="max-height:75svh;">
1790 <table class="table table-sm table-hover table-striped table-responsive">
1791 <tr>
1792 <td>Adobe98</td>
1793 <td>CIELab</td>
1794 <td>DisplayP3</td>
1795 <td>HSL</td>
1796 </tr>
1797 <tr>
1798 <td>CAT02LMS</td>
1799 <td>CMY</td>
1800 <td>CMYK</td>
1801 <td>Gray</td>
1802 </tr>
1803 <tr>
1804 <td>HCL</td>
1805 <td>HCLp</td>
1806 <td>HSB</td>
1807 <td>HSI</td>
1808 </tr>
1809 <tr>
1810 <td>HSV</td>
1811 <td>HWB</td>
1812 <td>Jzazbz</td>
1813 <td>Lab</td>
1814 </tr>
1815 <tr>
1816 <td>LCH</td>
1817 <td>LCHab</td>
1818 <td>LCHuv</td>
1819 <td>LinearGray</td>
1820 </tr>
1821 <tr>
1822 <td>LMS</td>
1823 <td>Log</td>
1824 <td>Luv</td>
1825 <td>OHTA</td>
1826 </tr>
1827 <tr>
1828 <td>Oklab</td>
1829 <td>Oklch</td>
1830 <td>ProPhoto</td>
1831 <td>Rec601YCbCr</td>
1832 </tr>
1833 <tr>
1834 <td>Rec709YCbCr</td>
1835 <td>RGB</td>
1836 <td>scRGB</td>
1837 <td>sRGB</td>
1838 </tr>
1839 <tr>
1840 <td>Transparent</td>
1841 <td>xyY</td>
1842 <td>XYZ</td>
1843 <td>YCbCr</td>
1844 </tr>
1845 <tr>
1846 <td>YDbDr</td>
1847 <td>YCC</td>
1848 <td>YIQ</td>
1849 <td>YPbPr</td>
1850 </tr>
1851 <tr>
1852 <td>YUV</td>
1853 <td></td>
1854 <td></td>
1855 <td></td>
1856 </tr>
1857 </table>
1858 </div>
1859
1860 <p>To print a complete list of colorspaces, use <a href="#list">-list colorspace</a>.</p>
1861
1862 <p>For a more accurate color conversion to or from the linear RGB, CMYK, or grayscale colorspaces, use the <a href="#profile">-profile</a> option. Note, ImageMagick assumes the sRGB colorspace if the image format does not indicate otherwise. For colorspace conversion, the gamma function is first removed to produce linear RGB.</p>
1863
1864 <div class="overflow-auto" style="max-height:75svh;">
1865 <table class="table table-sm table-hover table-striped table-responsive">
1866 <caption>Conversion of RGB to Other Color Spaces</caption>
1867 <tr><th valign="middle">CMY</th></tr>
1868 <tr><td valign="middle">C=<var>QuantumRange</var>−R</td></tr>
1869 <tr><td valign="middle">M=<var>QuantumRange</var>−G</td></tr>
1870 <tr><td valign="middle">Y=<var>QuantumRange</var>−B</td></tr>
1871 <tr><th valign="middle">CMYK — starts with CMY from above</th></tr>
1872 <tr><td valign="middle">K=min(C,Y,M)</td></tr>
1873 <tr><td valign="middle">C=<var>QuantumRange</var>*(C−K)/(<var>QuantumRange</var>−K)</td></tr>
1874 <tr><td valign="middle">M=<var>QuantumRange</var>*(M−K)/(<var>QuantumRange</var>−K)</td></tr>
1875 <tr><td valign="middle">Y=<var>QuantumRange</var>*(Y−K)/(<var>QuantumRange</var>−K)</td></tr>
1876
1877 <tr><th valign="middle">Gray</th></tr>
1878 <tr><td valign="middle">Gray = 0.212656*R+0.715158*G+0.072186*B</td></tr>
1879
1880 <tr><th valign="middle">HSB — Hue, Saturation, Brightness; like a cone peak downward</th></tr>
1881 <tr><td valign="middle">H=angle around perimeter (0 to 360 deg); H=0 is red; increasing angles toward green</td></tr>
1882 <tr><td valign="middle">S=distance from axis outward</td></tr>
1883 <tr><td valign="middle">B=distance along axis from bottom upward; B=max(R,G,B); <var>intensity-like</var></td></tr>
1884
1885 <tr><th valign="middle">HSL — Hue, Saturation, Lightness; like a double cone end-to-end with peaks at very top and bottom</th></tr>
1886 <tr><td valign="middle">H=angle around perimeter (0 to 360 deg); H=0 is red; increasing angles toward green</td></tr>
1887 <tr><td valign="middle">S=distance from axis outward</td></tr>
1888 <tr><td valign="middle">L=distance along axis from bottom upward; L=0.5*max(R,G,B) + 0.5*min(R,G,B); <var>intensity-like</var></td></tr>
1889
1890 <tr><th valign="middle">HWB — Hue, Whiteness, Blackness</th></tr>
1891 <tr><td valign="middle">Hue (complicated equation)</td></tr>
1892 <tr><td valign="middle">Whiteness (complicated equation)</td></tr>
1893 <tr><td valign="middle">Blackness (complicated equation)</td></tr>
1894
1895 <tr><th valign="middle">LAB</th></tr>
1896 <tr><td valign="middle">L (complicated equation relating X,Y,Z)</td></tr>
1897 <tr><td valign="middle">A (complicated equation relating X,Y,Z)</td></tr>
1898 <tr><td valign="middle">B (complicated equation relating X,Y,Z)</td></tr>
1899 <tr><th valign="middle">LinearGray</th></tr>
1900 <tr><td valign="middle">LinearGray = 0.298839*R+0.586811*G+0.114350*B</td></tr>
1901
1902 <tr><th valign="middle">LOG</th></tr>
1903 <tr><td valign="middle">I1 (complicated equation involving logarithm of R)</td></tr>
1904 <tr><td valign="middle">I2 (complicated equation involving logarithm of G)</td></tr>
1905 <tr><td valign="middle">I3 (complicated equation involving logarithm of B)</td></tr>
1906
1907 <tr><th valign="middle">OHTA — approximates principal components transformation</th></tr>
1908 <tr><td valign="middle">I1=0.33333*R+0.33334*G+0.33333*B; <var>intensity-like</var></td></tr>
1909 <tr><td valign="middle">I2=(0.50000*R+0.00000*G−0.50000*B)*(<var>QuantumRange</var>+1)/2</td></tr>
1910 <tr><td valign="middle">I3=(−0.25000*R+0.50000*G−0.25000*B)*(<var>QuantumRange</var>+1)/2</td></tr>
1911
1912 <tr><th valign="middle">Rec601Luma</th></tr>
1913 <tr><td valign="middle">Gray = 0.298839*R+0.586811*G+0.114350*B</td></tr>
1914
1915 <tr><th valign="middle">Rec601YCbCr</th></tr>
1916 <tr><td valign="middle">Y=0.2988390*R+0.5868110*G+0.1143500*B; <var>intensity-like</var></td></tr>
1917 <tr><td valign="middle">Cb=(−0.168736*R-0.331264*G+0.500000*B)*(<var>QuantumRange</var>+1)/2</td></tr>
1918 <tr><td valign="middle">Cr=(0.500000*R−0.418688*G−0.081312*B)*(<var>QuantumRange</var>+1)/2</td></tr>
1919
1920 <tr><th valign="middle">Rec709Luma</th></tr>
1921 <tr><td valign="middle">Gray=0.212656*R+0.715158*G+0.072186*B</td></tr>
1922
1923 <tr><th valign="middle">Rec709YCbCr</th></tr>
1924 <tr><td valign="middle">Y=0.212656*R+0.715158*G+0.072186*B; <var>intensity-like</var></td></tr>
1925 <tr><td valign="middle">Cb=(−0.114572*R−0.385428*G+0.500000*B)+(<var>QuantumRange</var>+1)/2</td></tr>
1926 <tr><td valign="middle">Cr=(0.500000*R−0.454153*G−0.045847*B)+(<var>QuantumRange</var>+1)/2</td></tr>
1927 <tr><th valign="middle">sRGB</th></tr>
1928 <tr><td valign="middle">if R ≤ .0.0031308 then Rs=R/12.92 else Rs=1.055 R ^ (1.0 / 2.4) - 0.055</td></tr>
1929 <tr><td valign="middle">if G ≤ .0.0031308 then Gs=B/12.92 else Gs=1.055 R ^ (1.0 / 2.4) - 0.055</td></tr>
1930 <tr><td valign="middle">if B ≤ .0.0031308 then Bs=B/12.92 else Bs=1.055 R ^ (1.0 / 2.4) - 0.055</td></tr>
1931
1932 <tr><th valign="middle">XYZ</th></tr>
1933 <tr><td valign="middle">X=0.4124564*R+0.3575761*G+0.1804375*B</td></tr>
1934 <tr><td valign="middle">Y=0.2126729*R+0.7151522*G+0.0721750*B</td></tr>
1935 <tr><td valign="middle">Z=0.0193339*R+0.1191920*G+0.9503041*B</td></tr>
1936
1937 <tr><th valign="middle">YCC</th></tr>
1938 <tr><td valign="middle">Y=(0.298839*R+0.586811*G+0.114350*B) (with complicated scaling); <var>intensity-like</var></td></tr>
1939 <tr><td valign="middle">C1=(−0.298839*R−0.586811*G+0.88600*B) (with complicated scaling)</td></tr>
1940 <tr><td valign="middle">C2=(0.70100*R−0.586811*G−0.114350*B) (with complicated scaling)</td></tr>
1941
1942 <tr><th valign="middle">YCbCr</th></tr>
1943 <tr><td valign="middle">Y=0.2988390*R+0.5868110*G+0.1143500*B; <var>intensity-like</var></td></tr>
1944 <tr><td valign="middle">Cb=(−0.168736*R−0.331264*G+0.500000*B)*(<var>QuantumRange</var>+1)/2</td></tr>
1945 <tr><td valign="middle">Cr=(0.500000*R−0.418688*G−0.081312*B)*(<var>QuantumRange</var>+1)/2</td></tr>
1946
1947 <tr><th valign="middle">YIQ</th></tr>
1948 <tr><td valign="middle">Y=0.298839*R+0.586811*G+0.114350*B; <var>intensity-like</var></td></tr>
1949 <tr><td valign="middle">I=(0.59600*R−0.27400*G−0.32200*B)*(<var>QuantumRange</var>+1)/2</td></tr>
1950 <tr><td valign="middle">Q=(0.21100*R−0.52300*G+0.31200*B)*(<var>QuantumRange</var>+1)/2</td></tr>
1951
1952 <tr><th valign="middle">YPbPr</th></tr>
1953 <tr><td valign="middle">Y=0.2988390*R+0.5868110*G+0.1143500*B; <var>intensity-like</var></td></tr>
1954 <tr><td valign="middle">Pb=(−0.168736*R−0.331264*G+0.500000*B)*(<var>QuantumRange</var>+1)/2</td></tr>
1955 <tr><td valign="middle">Pr=(0.500000*R−0.418688*G−0.081312*B)*(<var>QuantumRange</var>+1)/2</td></tr>
1956
1957 <tr><th valign="middle">YUV</th></tr>
1958 <tr><td valign="middle">Y=0.298839*R+0.586811*G+0.114350*B; <var>intensity-like</var></td></tr>
1959 <tr><td valign="middle">U=(−0.14740*R−0.28950*G+0.43690*B)*(<var>QuantumRange</var>+1)/2</td></tr>
1960 <tr><td valign="middle">V=(0.61500*R−0.51500*G−0.10000*B)*(<var>QuantumRange</var>+1)/2</td></tr>
1961 </table>
1962 </div>
1963
1964 <p>Note the scRGB colorspace requires HDRI support otherwise it behaves just like linear RGB.</p>
1965
1966 <p>Use the <code>Undefined</code> colorspace to identify multi-spectral images.</p>
1967
1968 <div style="mx-auto my-3 text-center">
1969 <h2><a class="anchor" id="color-threshold"></a>-color-threshold <var>start-color</var>-<var>stop-color</var></h2>
1970 </div>
1971
1972 <p>Return a binary image where all colors within the specified range are changed to white. All other colors are changed to black.</p>
1973
1974 <div style="mx-auto my-3 text-center">
1975 <h2><a class="anchor" id="combine"></a>-combine</h2>
1976 <h2>+combine <var>colorspace</var></h2>
1977 </div>
1978
1979 <p class="lead">Combine one or more images into a single image.</p>
1980
1981 <p>The channels (previously set by <a href="#channel">-channel</a>) of the
1982 combined image are taken from the grayscale values of each image in the
1983 sequence, in order. For the default -channel setting of <code>RGB</code>, this
1984 means the first image is assigned to the <code>Red</code> channel, the second
1985 to the <code>Green</code> channel, the third to the <code>Blue</code>.</p>
1986
1987 <p>This option can be thought of as the inverse to <a
1988 href="#separate">-separate</a>, so long as the channel settings are the same.
1989 Thus, in the following example, the final image should be a copy of the
1990 original. </p>
1991
1992 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick original.png -channel RGB -separate sepimage.png
1993 convert sepimage-0.png sepimage-1.png sepimage-2.png -channel RGB \
1994 -combine imagecopy.png
1995 </samp></pre>
1996
1997 <div style="mx-auto my-3 text-center">
1998 <h2><a class="anchor" id="comment"></a>-comment <var>string</var></h2>
1999 </div>
2000
2001 <p class="lead">Embed a comment in an image.</p>
2002
2003 <p>This option sets the comment meta-data of an image read in after this
2004 option has been given. To modify a comment of images already in memory use
2005 "<code><a href="#set">-set</a> comment</code>". </p>
2006
2007 <p>The comment can contain special format characters listed in the <a
2008 href="../escape/index.html">Format and
2009 Print Image Properties</a>. These attributes are expanded when the comment
2010 is finally assigned to the individual images. </p>
2011
2012 <p>If the first character of <var>string</var> is <var>@</var>, the image comment is read from a file titled by the
2013 remaining characters in the string. Comments read in from a file are literal;
2014 no embedded formatting characters are recognized.</p>
2015
2016 <p>Comment meta-data are not visible on the image itself. To do that use the
2017 <a href="#annotate">-annotate</a> or <a href="#draw">-draw</a> options
2018 instead.</p>
2019
2020 <p>For example,</p>
2021
2022 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><code>-comment "%m:%f %wx%h" bird.miff
2023 </code></pre>
2024
2025 <p>produces an image comment of <code>MIFF:bird.miff 512x480</code> (assuming
2026 that the image <code>bird.miff</code> has a width of 512 and a height of
2027 480.</p>
2028
2029 <div style="mx-auto my-3 text-center">
2030 <h2><a class="anchor" id="compare"></a>-compare</h2>
2031 </div>
2032
2033 <p class="lead">Mathematically and visually annotate the difference between an image and its reconstruction</p>
2034
2035 <p>This is a convert version of "<code>compare</code>" for two same sized images. The syntax is as follows, but other metrics are allowed.</p>
2036
2037 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick image.png reference.png -metric RMSE -compare \ <br/> difference.png
2038 </samp></pre>
2039
2040 <p>To get the metric value use the string format "%[distortion]".</p>
2041
2042 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick image.png reference.png -metric RMSE -compare -format \
2043 "%[distortion]" info:
2044 </samp></pre>
2045
2046 <div style="mx-auto my-3 text-center">
2047 <h2><a class="anchor" id="complex"></a>-complex <var>operator</var></h2>
2048 </div>
2049
2050 <p class="lead">Perform complex mathematics on an image sequence</p>
2051
2052 Choose from these operators:
2053
2054 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>add
2055 conjugate
2056 divide
2057 magnitude-phase
2058 multiply
2059 real-imaginary
2060 subtract
2061 </code></pre>
2062
2063 <p>Optionally specify the <code>divide</code> operator SNR with <code><a href="#define">-define</a> complex:snr=float</code>.</p>
2064
2065 <div style="mx-auto my-3 text-center">
2066 <h2><a class="anchor" id="compose"></a>-compose <var>operator</var></h2>
2067 </div>
2068
2069 <p class="lead">Set the type of image composition.</p>
2070
2071 <p>See <a href="../compose/index.html">Alpha Compositing</a> for
2072 a detailed discussion of alpha compositing.</p>
2073
2074 <p>This setting affects image processing operators that merge two (or more)
2075 images together in some way. This includes the operators,
2076 <a href="#composite">-compare</a>,
2077 <a href="#composite">-composite</a>,
2078 <a href="#layers">-layers</a> composite,
2079 <a href="#flatten">-flatten</a>,
2080 <a href="#mosaic">-mosaic</a>,
2081 <a href="#layers">-layers</a> merge,
2082 <a href="#border">-border</a>,
2083 <a href="#frame">-frame</a>,
2084 and <a href="#extent">-extent</a>. </p>
2085
2086 <p>It is also one of the primary options for the "<code>composite</code>"
2087 command. </p>
2088
2089
2090 <div style="mx-auto my-3 text-center">
2091 <h2><a class="anchor" id="composite"></a>-composite</h2>
2092 </div>
2093
2094 <p class="lead">Perform alpha composition on two images and an optional mask</p>
2095
2096 <p>Take the first image 'destination' and overlay the second 'source' image
2097 according to the current <a href="#compose">-compose</a> setting. The location
2098 of the 'source' or 'overlay' image is controlled according to <a
2099 href="#gravity" >-gravity</a>, and <a href="#geometry" >-geometry</a>
2100 settings. </p>
2101
2102 <p>If a third image is given this is treated as a grayscale blending 'mask' image
2103 relative to the first 'destination' image. This mask is blended with the
2104 source image. However for the '<code>displace</code>' compose method, the
2105 mask is used to provide a separate Y-displacement image instead. </p>
2106
2107 <p>If a <a href="#compose">-compose</a> method requires extra numerical
2108 arguments or flags these can be provided by setting the <a
2109 href="#set">-set</a> '<code>option:compose:args</code>'
2110 appropriately for the compose method. </p>
2111
2112 <p>Some <a href="#compose">-compose</a> methods can modify the 'destination'
2113 image outside the overlay area. It is disabled by default. You can enable this by setting the define: <a href="#define">-define</a> '<code>compose:clip-to-self=true</code>'.</p>
2114
2115 <p>The SVG compositing specification requires that color and opacity values range between zero and QuantumRange inclusive. You can permit values outside this range with this option: <a href="#set">-set</a> '<code>option:compose:clamp=false</code></p>
2116
2117
2118 <div style="mx-auto my-3 text-center">
2119 <h2><a class="anchor" id="compress"></a>-compress <var>type</var></h2>
2120 </div>
2121
2122 <p class="lead">Use pixel compression specified by <var>type</var> when writing the image.</p>
2123
2124 <p>Choices are: <code>None</code>, <code>BZip</code>, <code>Fax</code>, <code>Group4</code>, <code>JPEG</code>, <code>JPEG2000</code>, <code>Lossless</code>, <code>LZW</code>, <code>RLE</code> or <code>Zip</code>.</p>
2125
2126 <p>To print a complete list of compression types, use <a href="#list">-list
2127 compress</a>.</p>
2128
2129 <p>Specify <a href="#compress">+compress</a> to store the binary image in an
2130 uncompressed format. The default is the compression type of the specified
2131 image file.</p>
2132
2133 <p>If <code>LZW</code> compression is specified but LZW compression has not been
2134 enabled, the image data is written in an uncompressed LZW format that can be
2135 read by LZW decoders. This may result in larger-than-expected GIF files.</p>
2136
2137 <p><code>Lossless</code> refers to lossless JPEG, which is only available if the
2138 JPEG library has been patched to support it. Use of lossless JPEG is generally
2139 not recommended.</p>
2140
2141 <p>
2142 When writing an ICO file, you may request that the images be encoded in
2143 PNG format, by specifying <code>Zip</code> compression.</p>
2144
2145 <p>
2146 When writing a JNG file, specify <code>Zip</code> compression to request that
2147 the alpha channel be encoded in PNG "IDAT" format, or <code>JPEG</code>
2148 to request that it be encoded in JPG "JDAA" format.</p>
2149
2150 <p>Use the <a href="#quality">-quality</a> option to set the compression level
2151 to be used by JPEG, PNG, MIFF, and MPEG encoders.
2152 Use the <a href="#sampling-factor">-sampling-factor</a> option to set the
2153 sampling factor to be used by JPEG, MPEG, and YUV encoders for down-sampling
2154 the chroma channels.</p>
2155
2156 <div style="mx-auto my-3 text-center">
2157 <h2><a class="anchor" id="connected-components"></a>-connected-components <var>connectivity</var></h2>
2158 </div>
2159
2160 <p class="lead"><a href="../connected-components/index.html">connected-components</a> labeling detects connected regions in an image, choose from 4 or 8 way connectivity.</p>
2161
2162 <p>Use <code><a href="#define" >-define</a> connected-components:verbose=true</code> to output statistics associated with each unique label.</p>
2163
2164 <div style="mx-auto my-3 text-center">
2165 <h2><a class="anchor" id="contrast"></a>-contrast</h2>
2166 </div>
2167
2168 <p class="lead">Enhance or reduce the image contrast.</p>
2169
2170 <p>This option enhances the intensity differences between the lighter and
2171 darker elements of the image. Use <a href="#contrast">-contrast</a> to enhance
2172 the image or <a href="#contrast">+contrast</a> to reduce the image
2173 contrast.</p>
2174
2175 <p>For a more pronounced effect you can repeat the option:</p>
2176
2177 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick rose: -contrast -contrast rose_c2.png
2178 </samp></pre>
2179
2180 <div style="mx-auto my-3 text-center">
2181 <h2><a class="anchor" id="contrast-stretch"></a>-contrast-stretch <var>black-point</var><br />-contrast-stretch <var>black-point</var>{x<var>white-point</var>}{<var>%</var>}</h2>
2182 </div>
2183
2184 <p class="lead">Increase the contrast in an image by <var>stretching</var> the range of intensity values.</p>
2185
2186 <p>While performing the stretch, black-out at most <var>black-point</var> pixels and white-out at most <var>white-point</var> pixels. Or, if percent is used, black-out at most
2187 <var >black-point %</var> pixels and white-out at most <var>white-point %</var> pixels.</p>
2188
2189 <p>Prior to ImageMagick 6.4.7-0, <a href="#contrast-stretch"
2190 >-contrast-stretch</a> will black-out at most <var>black-point</var> pixels and white-out at most <var >total pixels
2191 minus white-point</var> pixels. Or, if percent is used, black-out at most <var>black-point %</var> pixels and white-out at most <var>100% minus white-point %</var> pixels.</p>
2192
2193 <p>Note that <code>-contrast-stretch 0</code> will modify the image such that
2194 the image's min and max values are stretched to 0 and <var>QuantumRange</var>, respectively, without any loss of data due to burn-out or
2195 clipping at either end. This is not the same as <a href="#normalize"
2196 >-normalize</a>, which is equivalent to <code>-contrast-stretch 2%x1%</code> (or
2197 prior to ImageMagick 6.4.7-0, <code>-contrast-stretch 2%x99%</code>).</p>
2198
2199 <p>Internally operator works by creating a histogram bin, and then uses that
2200 bin to modify the image. As such some colors may be merged together when they
2201 originally fell into the same 'bin'. </p>
2202
2203 <p>All the channels are normalized in concert by the same amount so as to
2204 preserve color integrity, when the default <a href="#channel" >+channel</a>
2205 setting is in use. Specifying any other <a href="#channel" >-channel</a>
2206 setting will normalize the RGB channels independently.</p>
2207
2208 <p>See also <a href="#auto-level" >-auto-level</a> for a 'perfect'
2209 normalization of mathematical images. </p>
2210
2211 <p>This operator is under review for re-development. </p>
2212
2213
2214 <div style="mx-auto my-3 text-center">
2215 <h2><a class="anchor" id="convolve"></a>-convolve <var>kernel</var></h2>
2216 </div>
2217
2218 <p class="lead">Convolve an image with a user-supplied convolution kernel.</p>
2219
2220 <p>The <var>kernel</var> is a matrix specified as
2221 a comma-separated list of integers (with no spaces), ordered left-to right,
2222 starting with the top row. Presently, only odd-dimensioned kernels are
2223 supported, and therefore the number of entries in the specified <var>kernel</var> must be 3<sup>2</sup>=9, 5<sup>2</sup>=25,
2224 7<sup>2</sup>=49, etc. </p>
2225
2226 <p>Note that the <a href="#convolve">-convolve</a> operator supports the
2227 <a href="index.html#bias">-bias</a> setting. This option shifts the convolution so that
2228 positive and negative results are relative to a user-specified bias value.
2229 This is important for non-HDRI compilations of ImageMagick when dealing with
2230 convolutions that contain negative as well as positive values. This is
2231 especially the case with convolutions involving high pass filters or edge
2232 detection. Without an output bias, the negative values is clipped at zero.
2233 </p>
2234
2235 <p>When using an ImageMagick with the HDRI compile-time setting, <a href="#bias">-bias</a>
2236 is not needed, as ImageMagick is able to store/handle any
2237 negative results without clipping to the color value range (0..QuantumRange).
2238 See the discussion on HDRI implementations of ImageMagick on the page <a
2239 href="../high-dynamic-range/index.html">High
2240 Dynamic-Range Images</a>. For more about HDRI go the ImageMagick <a
2241 href="https://usage.imagemagick.org/basics/#hdri">Usage</a> pages or this
2242 <a href="http://en.wikipedia.org/wiki/High_dynamic_range_imaging">Wikipedia</a>
2243 entry. </p>
2244
2245
2246 <div style="mx-auto my-3 text-center">
2247 <h2><a class="anchor" id="copy"></a>-copy <var>geometry</var> <var>offset</var></h2>
2248 </div>
2249
2250 <p class="lead">Copy pixels from one area of an image to another.</p>
2251
2252 <div style="mx-auto my-3 text-center">
2253 <h2><a class="anchor" id="crop"></a>-crop <var>geometry</var>{<var>@</var>}{<var>!</var>}</h2>
2254 </div>
2255
2256 <p class="lead">Cut out one or more rectangular regions of the image.</p>
2257
2258 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument.</p>
2259
2260 <p>The <var>width</var> and <var>height</var> of the <var>geometry</var> argument give the size of the image that remains
2261 after cropping, and <var>x</var> and <var>y</var> in the
2262 <var>offset</var> (if present) gives the location of the top left
2263 corner of the cropped image with respect to the original image. To specify the
2264 amount to be removed, use <a href="#shave">-shave</a> instead.</p>
2265
2266 <p>If the <var>x</var> and <var>y</var> offsets are
2267 present, a single image is generated, consisting of the pixels from the
2268 cropping region. The offsets specify the location of the upper left corner of
2269 the cropping region measured downward and rightward with respect to the upper
2270 left corner of the image. If the <a href="#gravity">-gravity</a> option is
2271 present with <code>NorthEast</code>, <code>East</code>, or <code>SouthEast</code>
2272 gravity, it gives the distance leftward from the right edge of the image to
2273 the right edge of the cropping region. Similarly, if the <a
2274 href="#gravity">-gravity</a> option is present with <code>SouthWest</code>,
2275 <code>South</code>, or <code>SouthEast</code> gravity, the distance is measured
2276 upward between the bottom edges.</p>
2277
2278 <p>If the <var>x</var> and <var>y</var> offsets are
2279 omitted, a set of tiles of the specified geometry, covering the entire input
2280 image, is generated. The rightmost tiles and the bottom tiles are smaller if
2281 the specified geometry extends beyond the dimensions of the input image.</p>
2282
2283 <p>You can add the <var>@</var> to the geometry argument to equally divide the image into the number of tiles generated.</p>
2284
2285 <p>By adding a exclamation character flag to the geometry argument, the
2286 cropped images virtual canvas page size and offset is set as if the
2287 geometry argument was a viewport or window. This means the canvas page size
2288 is set to exactly the same size you specified, the image offset set
2289 relative top left corner of the region cropped. </p>
2290
2291 <p>If the cropped image 'missed' the actual image on its virtual canvas, a
2292 special single pixel transparent 'missed' image is returned, and a 'crop
2293 missed' warning given. </p>
2294
2295 <p>It might be necessary to <a href="#repage" >+repage</a> the image prior to
2296 cropping the image to ensure the crop coordinate frame is relocated to the
2297 upper-left corner of the visible image.
2298
2299 Similarly you may want to use <a href="#repage" >+repage</a> after cropping to
2300 remove the page offset that will be left behind. This is especially true when
2301 you are going to write to an image format such as PNG that supports an image
2302 offset.</p>
2303
2304 <div style="mx-auto my-3 text-center">
2305 <h2><a class="anchor" id="cycle"></a>-cycle <var>amount</var></h2>
2306 </div>
2307
2308 <p class="lead">Displace image colormap by amount.</p>
2309
2310 <p><var>Amount</var> defines the number of positions each
2311 colormap entry is shifted.</p>
2312
2313
2314 <div style="mx-auto my-3 text-center">
2315 <h2><a class="anchor" id="debug"></a>-debug <var>events</var></h2>
2316 </div>
2317
2318 <p class="lead">Enable debug printout.</p>
2319
2320 <p>The <code>events</code> parameter specifies which events are to be logged. It
2321 can be either <code>None</code>, <code>All</code>, <code>Trace</code>, or
2322 a comma-separated list consisting of one or more of the following domains:
2323 <code>Accelerate</code>, <code>Annotate</code>, <code>Blob</code>, <code>Cache</code>,
2324 <code>Coder</code>, <code>Configure</code>, <code>Deprecate</code>,
2325 <code>Exception</code>, <code>Locale</code>, <code>Render</code>,
2326 <code>Resource</code>, <code>Security</code>, <code>TemporaryFile</code>,
2327 <code>Transform</code>, <code>X11</code>, or <code>User</code>. </p>
2328
2329
2330 <p>For example, to log cache and blob events, use.</p>
2331
2332 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick -debug "Cache,Blob" rose: rose.png
2333 </samp></pre>
2334
2335 <p>The <code>User</code> domain is normally empty, but developers can log user
2336 events in their private copy of ImageMagick.</p>
2337
2338 <p>To print the complete list of debug methods, use <a href="#list">-list
2339 debug</a>.</p>
2340
2341 <p>Use the <a href="#log">-log</a> option to specify the format for debugging
2342 output.</p>
2343
2344 <p>Use <a href="#debug">+debug</a> to turn off all logging.</p>
2345
2346 <p>Debugging may also be set using the <code>MAGICK_DEBUG</code> <a href="../resources/index.html#environment"
2347 >environment variable</a>. The allowed values for the <code>MAGICK_DEBUG</code>
2348 environment variable are the same as for the <a href="#debug">-debug</a>
2349 option.</p>
2350
2351
2352 <div style="mx-auto my-3 text-center">
2353 <h2><a class="anchor" id="decipher"></a>-decipher <var>filename</var></h2>
2354 </div>
2355
2356 <p class="lead">Decipher and restore pixels that were previously transformed by <a href="#encipher">-encipher</a>.</p>
2357
2358 <p>Get the passphrase from the file specified by <var>filename</var>.</p>
2359
2360 <p>For more information, see the webpage, <a href="../cipher/index.html">ImageMagick: Encipher or
2361 Decipher an Image</a>.</p>
2362
2363
2364 <div style="mx-auto my-3 text-center">
2365 <h2><a class="anchor" id="deconstruct"></a>-deconstruct</h2>
2366 </div>
2367
2368 <p class="lead">Find areas that has changed between images </p>
2369
2370 <p>Given a sequence of images all the same size, such as produced by <a
2371 href="#coalesce">-coalesce</a>, replace the second and later images, with
2372 a smaller image of just the area that changed relative to the previous image.
2373 </p>
2374
2375 <p>The resulting sequence of images can be used to optimize an animation
2376 sequence, though will not work correctly for GIF animations when parts of the
2377 animation can go from opaque to transparent. </p>
2378
2379 <p>This option is actually equivalent to the <a href="#layers">-layers</a>
2380 method '<code>compare-any</code>'. </p>
2381
2382
2383 <div style="mx-auto my-3 text-center">
2384 <h2><a class="anchor" id="define"></a>-define <var>key</var>{<var>=value</var>}<var>...</var></h2>
2385 </div>
2386
2387 <p class="lead">Add specific global settings generally used to control coders and image processing operations.</p>
2388
2389 <p>This option creates one or more definitions for coders and decoders to use
2390 while reading and writing image data. Definitions are generally used to
2391 control image file format coder modules, and image processing operations,
2392 beyond what is provided by normal means. Defined settings are listed in <a
2393 href="#verbose" >-verbose</a> information ("<code>info:</code>" output format)
2394 as "Artifacts". </p>
2395
2396 <p>If <var>value</var> is missing for a definition, an empty-valued
2397 definition of a flag is created with that name. This used to control on/off
2398 options. Use <a href="#define">+define key</a> to remove definitions
2399 previously created. Use <a href="#define">+define "*"</a> to remove all
2400 existing definitions.</p>
2401
2402 <p>The same 'artifact' settings can also be defined using the <a
2403 href="#set" >-set "option:<var>key</var>" "<var>value</var>"</a> option, which also allows the use of <a href="../escape/index.html" >Format and Print Image
2404 Properties</a> in the defined value. </p>
2405
2406 <p>The <var>option</var> and <var>key</var> are case-independent (they are
2407 converted to lowercase for use within the decoders) while the <var>value</var>
2408 is case-dependent.</p>
2409
2410 <p>Such settings are global in scope, and affect all images and operations. </p>
2411
2412 <p>See <a href="../defines/index.html">ImageMagick Defines</a> for a list of recognized defines. For example:</p>
2413
2414 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick bilevel.tif -define ps:imagemask eps3:stencil.ps
2415 </samp></pre>
2416
2417 <p>Set attributes of the image registry by prefixing the value with
2418 <code>registry:</code>. For example, to set a temporary path to put work files,
2419 use:</p>
2420
2421 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><code>-define registry:temporary-path=/data/tmp
2422 </code></pre>
2423
2424 <div style="mx-auto my-3 text-center">
2425 <h2><a class="anchor" id="delay"></a>-delay <var>ticks</var> <br />-delay <var>ticks</var>x<var>ticks-per-second</var> {<var>&lt;</var>} {<var>&gt;</var>}</h2>
2426 </div>
2427
2428 <p class="lead">Display the next image after pausing.</p>
2429
2430 <p>This option is useful for regulating the animation of image sequences
2431 <var>ticks/ticks-per-second</var> seconds must expire before the display of the
2432 next image. The default is no delay between each showing of the image
2433 sequence. The default ticks-per-second is 100.</p>
2434
2435 <p>Use <code>&gt;</code> to change the image delay <var>only</var> if its current
2436 value exceeds the given delay. <code>&lt;</code> changes the image delay
2437 <var>only</var> if current value is less than the given delay. For example, if
2438 you specify <code>30&gt;</code> and the image delay is 20, the image delay does
2439 not change. However, if the image delay is 40 or 50, the delay it is changed
2440 to 30. Enclose the given delay in quotation marks to prevent the
2441 <code>&lt;</code> or <code>&gt;</code> from being interpreted by your shell as
2442 a file redirection.</p>
2443
2444
2445 <div style="mx-auto my-3 text-center">
2446 <h2><a class="anchor" id="delete"></a>-delete <var>indexes</var></h2>
2447 </div>
2448
2449 <p class="lead">Delete the images specified by index, from the image sequence.</p>
2450
2451 <p>Specify the image by its index in the sequence. The first image is index
2452 0. Negative indexes are relative to the end of the sequence, for example, -1
2453 represents the last image of the sequence. Specify a range of images with
2454 a dash (e.g. 0-4). Separate indexes with a comma (e.g. 0,2). Use
2455 <code>+delete</code> to delete the last image in the current image sequence. Use <code>-delete 0--1</code> to delete the entire image sequence.</p>
2456
2457 <p>You can also delete images from the persistent registry, e.g., <code>-delete registry:checkers</code></p>
2458
2459
2460
2461 <div style="mx-auto my-3 text-center">
2462 <h2><a class="anchor" id="density"></a>-density <var>width</var><br />-density <var>width</var>x<var>height</var></h2>
2463 </div>
2464
2465 <p class="lead">Set the horizontal and vertical resolution of an image for rendering to devices.</p>
2466
2467 <p>This option specifies the image resolution to store while encoding a raster
2468 image or the canvas resolution while rendering (reading) vector formats such
2469 as Postscript, PDF, WMF, and SVG into a raster image. Image resolution
2470 provides the unit of measure to apply when rendering to an output device or
2471 raster image. The default unit of measure is in dots per inch (DPI). The <a
2472 href="#units">-units</a> option may be used to select dots per centimeter
2473 instead.</p>
2474
2475 <p>The default resolution is 72 dots per inch, which is equivalent to one
2476 point per pixel (Macintosh and Postscript standard). Computer screens are
2477 normally 72 or 96 dots per inch, while printers typically support 150, 300,
2478 600, or 1200 dots per inch. </p>
2479
2480 <p>If the file format supports it, this option may be used to update the
2481 stored image resolution. Note that Photoshop stores and obtains image
2482 resolution from a proprietary embedded profile. If this profile is not
2483 stripped from the image, then Photoshop will continue to treat the image using
2484 its former resolution, ignoring the image resolution specified in the standard
2485 file header.</p>
2486
2487 <p>The <a href="#density">-density</a> option sets an <var>attribute</var> and
2488 does not alter the underlying raster image. It may be used to adjust the
2489 rendered size for desktop publishing purposes by adjusting the scale applied
2490 to the pixels. To change the number of pixels in the image so that it has the
2491 same physical dimensions (in inches or centimeters), use the
2492 <a href="#resample">-resample</a> option.</p>
2493
2494 <div style="mx-auto my-3 text-center">
2495 <h2><a class="anchor" id="depth"></a>-depth <var>value</var></h2>
2496 </div>
2497
2498 <p class="lead">Depth of the image.</p>
2499
2500 <p>Color depth is the number of bits per channel for each pixel. For example, for a depth of 16 using RGB, each channel of Red, Green, and Blue can range from 0 to 2^16-1 (65535). Use this option to specify the depth of raw images formats whose depth is unknown such as GRAY, RGB, or CMYK, or to change the depth of any image after it has been read. By default, when reducing the pixel depth, higher order bits are lopped. Use <a href="#dither">-dither FloydSteinberg</a> to instead distribute the quantization error to neighboring pixels.</p>
2501
2502 <p>Use <a href="#depth">+depth</a> to return depth to its default value.</p>
2503
2504 <div style="mx-auto my-3 text-center">
2505 <h2><a class="anchor" id="descend"></a>-descend</h2>
2506 </div>
2507
2508 <p class="lead">Obtain image by descending window hierarchy.</p>
2509
2510 <div style="mx-auto my-3 text-center">
2511 <h2><a class="anchor" id="deskew"></a>-deskew <var>threshold&#123%}</var></h2>
2512 </div>
2513
2514 <p class="lead">Straighten an image. A threshold of 40% works for most images.</p>
2515
2516 <p>Use <a href="#set">-set</a> <code>option:deskew:auto-crop
2517 <var>true | false</var></code> to auto crop the image.</p>
2518
2519 <div style="mx-auto my-3 text-center">
2520 <h2><a class="anchor" id="despeckle"></a>-despeckle</h2>
2521 </div>
2522
2523 <p class="lead">Reduce the speckles within an image.</p>
2524
2525 <div style="mx-auto my-3 text-center">
2526 <h2><a class="anchor" id="direction"></a>-direction <var>type</var></h2>
2527 </div>
2528
2529 <p class="lead">Render text right-to-left or left-to-right. Requires the <a href="https://github.com/HOST-Oman/libraqm">RAQM</a> delegate library and <a href="https://en.wikipedia.org/wiki/Complex_text_layout">complex text layout</a>.</p>
2530
2531 <div style="mx-auto my-3 text-center">
2532 <h2><a class="anchor" id="displace"></a>-displace <var>horizontal-scale</var>&#123%}{!}<br />-displace <var>horizontal-scale</var>x<var>vertical-scale</var>&#123%}{!}</h2>
2533 </div>
2534
2535 <p class="lead">Shift image pixels as defined by a displacement map.</p>
2536
2537 <p>With this option, the 'overlay' image, and optionally the 'mask' image,
2538 is used as a displacement map, which is used to displace the lookup of
2539 what part of the 'background' image is seen at each point of the overlaid
2540 area. Much like the displacement map is a 'lens' that redirects light shining
2541 through it so as to present a distorted view the original 'background' image
2542 behind it. </p>
2543
2544 <p>Any perfect grey areas of the displacement map produce a zero
2545 displacement of the image. Black areas produce the given maximum negative
2546 displacement of the lookup point, while white produce a maximum positive
2547 displacement of the lookup. </p>
2548
2549 <p>Note that it is the lookup of the 'background' that is displaced, not a
2550 displacement of the image itself. As such an area of the displacement map
2551 containing 'white' will have the lookup point 'shifted' by a positive amount,
2552 and thus generating a copy of the destination image to the right/downward from
2553 the correct position. That is the image will look like it may have been
2554 'shifted' in a negative left/upward direction. Understanding this is a very
2555 important in understanding how displacement maps work. </p>
2556
2557 <p>The given arguments define the maximum amount of displacement in pixels
2558 that a particular map can produce. If the displacement scale is large enough
2559 it is also possible to lookup parts of the 'background' image that lie well
2560 outside the bounds of the displacement map itself. That is you could very
2561 easily copy a section of the original image from outside the overlay area
2562 into the overlay area. </p>
2563
2564 <p>The '%' flag makes the displacement scale relative to the size of the
2565 overlay image (100% = half width/height of image). Using '!' switches
2566 percentage arguments to refer to the destination image size instead.
2567 these flags were added as of IM v6.5.3-5.</p>
2568
2569 <p>Normally a single grayscale displacement map is provided, which with the
2570 given scaling values will determine a single direction (vector) in which
2571 displacements can occur (positively or negatively). However, if you also
2572 specify a third image which is normally used as a <var>mask</var>,
2573 the <var>composite image</var> is used for horizontal X
2574 displacement, while the <var>mask image</var> is used for vertical Y
2575 displacement. This allows you to define completely different displacement
2576 values for the X and Y directions, and allowing you to lookup any point within
2577 the <var>scale</var> bounds. In other words each pixel can lookup
2578 any other nearby pixel, producing complex 2 dimensional displacements, rather
2579 than a simple 1 dimensional vector displacements. </p>
2580
2581 <p>Alternatively rather than supplying two separate images, as of IM v6.4.4-0,
2582 you can use the 'red' channel of the overlay image to specify the horizontal
2583 or X displacement, and the 'green' channel for the vertical or Y displacement.
2584 </p>
2585
2586 <p>As of IM v6.5.3-5 any alpha channel in the overlay image is used as a
2587 mask the transparency of the destination image. However areas outside the
2588 overlaid areas will not be affected. </p>
2589
2590
2591 <div style="mx-auto my-3 text-center">
2592 <h2><a class="anchor" id="display"></a>-display <var>host:display[.screen]</var></h2>
2593 </div>
2594
2595 <p class="lead">Specifies the X server to contact.</p>
2596
2597 <p>This option is used with convert for obtaining image or font from this
2598 X server. See <var>X(1)</var>.</p>
2599
2600 <div style="mx-auto my-3 text-center">
2601 <h2><a class="anchor" id="dispose"></a>-dispose <var>method</var></h2>
2602 </div>
2603
2604 <p class="lead">Define the GIF disposal image setting for images that are being created or read in. </p>
2605
2606 <p>The layer disposal method defines the way each the displayed image is to be
2607 modified after the current 'frame' of an animation has finished being
2608 displayed (after its 'delay' period), but before the next frame on an
2609 animation is to be overlaid onto the display. </p>
2610
2611 <p>Here are the valid methods:</p>
2612
2613 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
2614 <dl class="row">
2615 <dt class="col-md-4">Undefined</dt><dd class="col-md-8">0: No disposal specified (equivalent to '<code>none</code>').</dd>
2616 <dt class="col-md-4">None</dt><dd class="col-md-8">1: Do not dispose, just overlay next frame image.</dd>
2617 <dt class="col-md-4">Background</dt><dd class="col-md-8">2: Clear the frame area with the background color.</dd>
2618 <dt class="col-md-4">Previous</dt><dd class="col-md-8">3: Clear to the image prior to this frames overlay.</dd>
2619 </dl>
2620 </div>
2621
2622 <p>You can also use the numbers given above, which is what the GIF format
2623 uses internally to represent the above settings. </p>
2624
2625 <p>To print a complete list of dispose methods, use <a href="#list">-list dispose</a>.</p>
2626
2627 <p>Use <a href="#dispose" >+dispose</a>, turn off the setting and prevent
2628 resetting the layer disposal methods of images being read in. </p>
2629
2630 <p>Use <a href="#set">-set</a> '<code>dispose</code>' method to set the image
2631 disposal method for images already in memory.</p>
2632
2633 <div style="mx-auto my-3 text-center">
2634 <h2><a class="anchor" id="dissimilarity-threshold"></a>-dissimilarity-threshold <var>value</var></h2>
2635 </div>
2636
2637 <p class="lead">Maximum RMSE for subimage match (default 0.2).</p>
2638
2639
2640 <div style="mx-auto my-3 text-center">
2641 <h2><a class="anchor" id="dissolve"></a>-dissolve <var>src_percent</var>[x<var>dst_percent</var>]</h2>
2642 </div>
2643
2644 <p class="lead">Dissolve an image into another by the given percent.</p>
2645
2646 <p>The opacity of the composite image is multiplied by the given percent, then
2647 it is composited 'over' the main image. If <var>src_percent</var>
2648 is greater than 100, start dissolving the main image so it becomes
2649 transparent at a value of '<code>200</code>'. If both percentages
2650 are given, each image are dissolved to the percentages given. </p>
2651
2652 <p>Note that dissolve percentages do not add, two opaque images dissolved
2653 '50,50', produce a 75% transparency. For a 50% + 50% blending of the two
2654 images, you would need to use dissolve values of '50,100'. </p>
2655
2656 <div style="mx-auto my-3 text-center">
2657 <h2><a class="anchor" id="distort"></a>-distort <var>method arguments</var></h2>
2658 </div>
2659
2660 <p class="lead">Distort an image, using the given <var>method</var> and its required <var>arguments</var>.</p>
2661
2662 <p>The <var>arguments</var> is a single string containing a list
2663 of floating point numbers separated by commas or spaces. The number of
2664 and meaning of the floating point values depends on the distortion <var>method</var> being used. </p>
2665
2666 <p>Choose from these distortion types:</p>
2667
2668 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
2669 <table class="table table-sm table-hover table-striped table-responsive">
2670 <tr>
2671 <th style="width: 8%">Method</th>
2672 <th>Description</th>
2673 </tr>
2674
2675 <tr>
2676 <td>ScaleRotateTranslate <br/> SRT</td>
2677 <td>
2678 Distort image by first scaling and rotating about a given 'center',
2679 before translating that 'center' to the new location, in that order. It
2680 is an alternative method of specifying a 'Affine' type of
2681 distortion, but without shearing effects. It also provides a good way
2682 of rotating and displacing a smaller image for tiling onto a larger
2683 background (IE 2-dimensional animations). <br/>
2684
2685 The number of arguments determine the specific meaning of each
2686 argument for the scales, rotation, and translation operations. <br/>
2687
2688 <dl class="row">
2689 <dt class="col-md-4">2:</dt><dd class="col-md-8"><var>Scale Angle</var></dd>
2690 <dt class="col-md-4">3:</dt><dd class="col-md-8"><var>X,Y Angle</var></dd>
2691 <dt class="col-md-4">4:</dt><dd class="col-md-8"><var>X,Y Scale Angle</var></dd>
2692 <dt class="col-md-4">5:</dt> <dd class="col-md-8"><var>X,Y ScaleX,ScaleY Angle</var></dd>
2693 <dt class="col-md-4">6:</dt> <dd class="col-md-8"><var>X,Y Scale Angle NewX,NewY</var></dd>
2694 <dt class="col-md-4">7:</dt> <dd class="col-md-8"><var>X,Y ScaleX,ScaleY Angle NewX,NewY</var></dd>
2695 </dl>
2696
2697 This is actually an alternative way of specifying a 2 dimensional linear
2698 'Affine' or 'AffineProjection' distortion. </td> </tr>
2699
2700 <tr>
2701 <td>Affine</td>
2702 <td>
2703 Distort the image linearly by moving a list of at least 3 or more sets
2704 of control points (as defined below). Ideally 3 sets or 12 floating
2705 point values are given allowing the image to be linearly scaled,
2706 rotated, sheared, and translated, according to those three points. See
2707 also the related 'AffineProjection' and 'SRT'
2708 distortions. <br/>
2709
2710 More than 3 sets given control point pairs (12 numbers) is least
2711 squares fitted to best match a linear affine distortion. If only 2
2712 control point pairs (8 numbers) are given a two point image translation
2713 rotation and scaling is performed, without any possible shearing,
2714 flipping or changes in aspect ratio to the resulting image. If only one
2715 control point pair is provides the image is only translated, (which may
2716 be a floating point non-integer translation). <br/>
2717
2718 This distortion does not include any form of perspective distortion.
2719 </td>
2720
2721 </tr>
2722
2723 <tr>
2724 <td>RigidAffine</td>
2725 <td>
2726 A rigid affine (also known as a Euclidean transform), is similar to Affine but restricts the distortion to 4 arguments (S, R, Tx, Ty) with Sy = Sx and Ry = -Rx so that the distortion only has scale, rotation and translation. No skew. A minimum of two control point pairs is required.
2727 </td>
2728 </tr>
2729
2730 <tr>
2731 <td>AffineProjection</td>
2732 <td>
2733 Linearly distort an image using the given Affine Matrix of 6
2734 pre-calculated coefficients forming a set of Affine Equations to map
2735 the source image to the destination image.
2736
2737 <p class="text-center"><var>
2738 s<sub>x</sub>, r<sub>x</sub>,
2739 r<sub>y</sub>, s<sub>y</sub>,
2740 t<sub>x</sub>, t<sub>y</sub>
2741 </var></p>
2742
2743 See <a href="#affine" >-affine</a> setting for more detail, and
2744 meanings of these coefficients. <br/>
2745
2746 The distortions 'Affine' and 'SRT' provide
2747 alternative methods of defining this distortion, with ImageMagick doing
2748 the calculations needed to generate the required coefficients. You can
2749 see the internally generated coefficients, by using a <a
2750 href="#verbose" >-verbose</a> setting with those other variants. </td>
2751
2752 </tr>
2753
2754 <tr>
2755 <td>BilinearForward<br/>
2756 BilinearReverse</td>
2757 <td>
2758 Bilinear Distortion, given a minimum of 4 sets of coordinate pairs, or
2759 16 values (see below). Not that lines may not appear straight after
2760 distortion, though the distance between coordinates will remain
2761 consistent. <br/>
2762
2763 The 'BilinearForward' is used to map rectangles to any
2764 quadrilateral, while the 'BilinearReverse' form maps any
2765 quadrilateral to a rectangle, while preserving the straight line edges
2766 in each case. <br/>
2767
2768 Note that 'BilinearForward' can generate invalid pixels
2769 which will be colored using the <a href="#mattecolor" >-mattecolor</a>
2770 color setting. Also if the quadrilateral becomes 'flipped' the image
2771 may disappear. <br/>
2772
2773 There are future plans to produce a true Bilinear distortion that will
2774 attempt to map any quadrilateral to any other quadrilateral, while
2775 preserving edges (and edge distance ratios).
2776
2777 </td>
2778 </tr>
2779
2780 <tr>
2781 <td>Perspective</td>
2782 <td>
2783 Perspective distort the images, using a list of 4 or more sets of
2784 control points (as defined below). More that 4 sets (16 numbers) of
2785 control points provide least squares fitting for more accurate
2786 distortions (for the purposes of image registration and panorama
2787 effects). Less than 4 sets will fall back to a 'Affine'
2788 linear distortion. <br/>
2789
2790 Perspective Distorted images ensures that straight lines remain
2791 straight, but the scale of the distorted image will vary. The horizon
2792 is anti-aliased, and the 'sky' color may be set using the
2793 <a href="#mattecolor" >-mattecolor</a> setting. </td>
2794 </tr>
2795
2796 <tr>
2797 <td>PerspectiveProjection </td>
2798 <td>
2799 Do a 'Perspective' distortion biased on a set of 8
2800 pre-calculated coefficients. You can get these coefficients by looking
2801 at the <a href="#verbose" >-verbose</a> output of a
2802 'Perspective' distortion, or by calculating them yourself.
2803 If the last two perspective scaling coefficients are zero, the
2804 remaining 6 represents a transposed 'Affine Matrix'. </td>
2805 </tr>
2806
2807 <tr>
2808 <td>Polynomial</td>
2809 <td>
2810 Do an Nth order 2D 'Polynomial' distortion using a set of corresponding
2811 control points. The order of the polynomial dictates the minimum number of
2812 control points needed. Order 1 is the same as -distort Affine. Order 1.5 is the
2813 same as -distort BilinearReverse. Typical use is for a 2nd order distortion.
2814 There is no +distort polynomial.</td>
2815 </tr>
2816
2817 <tr>
2818 <td>Arc</td>
2819 <td>
2820 Arc the image (variation of polar mapping) over the angle given around
2821 a circle.
2822
2823 <dl class="row">
2824 <dt class="col-md-4">arc_angle</dt>
2825 <dd class="col-md-8">The angle over which to arc the image side-to-side</dd>
2826 <dt class="col-md-4">rotate_angle</dt>
2827 <dd class="col-md-8">Angle to rotate resulting image from vertical center</dd>
2828 <dt class="col-md-4">top_radius</dt>
2829 <dd class="col-md-8">Set top edge of source image at this radius</dd>
2830 <dt class="col-md-4">bottom_radius </dt>
2831 <dd class="col-md-8">Set bottom edge to this radius (radial scaling)</dd>
2832 </dl>
2833
2834 The resulting image is always resized to best fit the resulting image,
2835 (as if using <a href="#distort" >+distort</a>) while attempting to
2836 preserve scale and aspect ratio of the original image as much as
2837 possible with the arguments given by the user. All four arguments will
2838 be needed to change the overall aspect ratio of an 'Arc'ed image. <br/>
2839
2840 This a variation of a polar distortion designed to try to preserve the
2841 aspect ratio of the image rather than direct Cartesian to Polar
2842 conversion. </td>
2843 </tr>
2844
2845 <tr>
2846 <td>Polar</td>
2847 <td>
2848 Like 'Arc' but do a complete Cartesian to Polar mapping of
2849 the image. that is the height of the input image is mapped to the
2850 radius limits, while the width is wrapped around between the
2851 angle limits. <br/>
2852
2853 Arguments: <var>Rmax,Rmin CenterX,CenterY, start,end_angle</var> <br/>
2854
2855 All arguments are optional. With <var>Rmin</var> defaulting to zero, the
2856 center to the center of the image, and the angles going from -180 (top)
2857 to +180 (top). If <var>Rmax</var> is given the special value of
2858 '0', the distance from the center to the nearest edge
2859 is used for the radius of the output image, which will ensure the whole
2860 image is visible (though scaled smaller). However a special value of
2861 '-1' will use the distance from the center to the furthest
2862 corner, This may 'clip' the corners from the input rectangular image,
2863 but will generate the exact reverse of a 'DePolar' with
2864 the same arguments. <br/>
2865
2866 If the plus form of distort (<a href="#distort" >+distort</a>) is used
2867 output image center will default to 0,0 of the virtual
2868 canvas, and the image size adjusted to ensure the whole input image is
2869 made visible in the output image on the virtual canvas. </td>
2870
2871 </tr>
2872
2873 <tr>
2874 <td>DePolar</td>
2875 <td>
2876 Uses the same arguments and meanings as a 'Polar' distortion
2877 but generates the reverse Polar to Cartesian distortion. <br/>
2878
2879 The special <var>Rmax</var> setting of '0' may however clip
2880 the corners of the input image. However using the special
2881 <var>Rmax</var> setting of '-1' (maximum center to corner
2882 distance) will ensure the whole distorted image is preserved in the
2883 generated result, so that the same argument to 'Polar' will
2884 reverse the distortion re-producing the original.
2885
2886 Note that as this distortion requires the area resampling of a circular
2887 arc, which can not be handled by the builtin EWA resampling function.
2888 As such the normal EWA filters are turned off. It is recommended some
2889 form of 'super-sampling' image processing technique be used to produce
2890 a high quality result. </td>
2891
2892 </tr>
2893
2894 <tr>
2895 <td>Barrel</td>
2896 <td>
2897 Given the four coefficients (A,B,C,D) as defined by <a
2898 href="http://wiki.panotools.org/Lens_correction_model" >Helmut
2899 Dersch</a>, perform a barrel or pin-cushion distortion appropriate to
2900 correct radial lens distortions. That is in photographs, make straight
2901 lines straight again. <br/>
2902
2903 <p class="text-center">Arguments: <var>A B C</var> [ <var>D</var> [
2904 <var>X</var> , <var>Y</var> ] ] <br/>
2905 or <var>A<sub>x</sub> B<sub>x</sub> C<sub>x</sub> D<sub>x</sub>
2906 A<sub>y</sub> B<sub>y</sub> C<sub>y</sub> D<sub>y</sub></var>
2907 [ <var>X</var> , <var>Y</var> ] </p>
2908 So that it forms the function
2909 <p class="text-center">Rsrc = r * ( <var>A</var>*r<sup>3</sup> + <var>B</var>*r<sup>2</sup> +
2910 <var>C</var>*r + <var>D</var> )</p>
2911
2912 Where <var>X</var>,<var>Y</var> is the optional center of the distortion
2913 (defaulting to the center of the image). <br/>
2914 The second form is typically used to distort images, rather than
2915 correct lens distortions. <br/>
2916 </td>
2917
2918 </tr>
2919
2920 <tr>
2921 <td>BarrelInverse</td>
2922 <td>
2923 This is very similar to 'Barrel' with the same set of
2924 arguments, and argument handling. However it uses the inverse
2925 of the radial polynomial,
2926 so that it forms the function
2927 <p class="text-center">Rsrc = r / ( <var>A</var>*r<sup>3</sup> + <var>B</var>*r<sup>2</sup> +
2928 <var>C</var>*r + <var>D</var> )</p>
2929 Note that this is not the reverse of the 'Barrel'
2930 distortion, just a different barrel-like radial distortion method.
2931
2932 </td>
2933 </tr>
2934
2935 <tr>
2936 <td>Shepards</td>
2937 <td>
2938 Distort the given list control points (any number) using an Inverse
2939 Squared Distance Interpolation Method (<a
2940 href="http://en.wikipedia.org/wiki/Shepard%27s_method" >Shepards
2941 Method</a>). The control points in effect do 'localized' displacement
2942 of the image around the given control point (preserving the look and
2943 the rotation of the area near the control points. For best results
2944 extra control points should be added to 'lock' the positions of the
2945 corners, edges and other unchanging parts of the image, to prevent
2946 their movement. <br/>
2947
2948 The distortion has been likened to 'taffy pulling' using nails, or
2949 pins' stuck in a block of 'jelly' which is then moved to the new
2950 position, distorting the surface of the jelly. <br/>
2951
2952 Internally it is equivalent to generating a displacement map (see <a
2953 href="#displace" >-displace</a>) for source image color look-up using
2954 the <a href="#sparse-color" >-sparse-color</a> method of the same name.
2955
2956 </td>
2957 </tr>
2958
2959 </table>
2960 </div>
2961
2962 <p>To print a complete list of distortion methods, use <a href="#list">-list
2963 distort</a>.</p>
2964
2965 <p>Many of the above distortion methods such as '<code>Affine</code>',
2966 '<code>Perspective</code>', and '<code>Shepards</code>' use a list control points
2967 defining how these points in the given image should be distorted in the
2968 destination image. Each set of four floating point values represent a source
2969 image coordinate, followed immediately by the destination image coordinate.
2970 This produces a list of values such as...</p>
2971 <p class="text-center"><var>
2972 U<sub>1</sub>,V<sub>1</sub> X<sub>1</sub>,Y<sub>1</sub>
2973 U<sub>2</sub>,V<sub>2</sub> X<sub>2</sub>,Y<sub>2</sub>
2974 U<sub>3</sub>,V<sub>3</sub> X<sub>3</sub>,Y<sub>3</sub>
2975 ...
2976 U<sub>n</sub>,V<sub>n</sub> X<sub>n</sub>,Y<sub>n</sub>
2977 </var></p>
2978 <p>where <var>U,V</var> on the source image is mapped to <var>X,Y</var> on the
2979 destination image. </p>
2980
2981 <p>For example, to warp an image using '<code>perspective</code>' distortion,
2982 needs a list of at least 4 sets of coordinates, or 16 numbers. Here is the
2983 perspective distortion of the built-in "rose:" image. Note how spaces were
2984 used to group the 4 sets of coordinate pairs, to make it easier to read and
2985 understand.</p>
2986
2987 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick rose: -virtual-pixel black \
2988 -distort Perspective '0,0,0,0 0,45,0,45 69,0,60,10 69,45,60,35' \
2989 rose_3d_rotated.gif"
2990 </samp></pre>
2991
2992 <p>If more that the required number of coordinate pairs are given for
2993 a distortion, the distortion method is 'least squares' fitted to produce the
2994 best result for all the coordinate pairs given. If less than the ideal number
2995 of points are given, the distort will generally fall back to a simpler form of
2996 distortion that can handles the smaller number of coordinates (usually a linear
2997 '<code>Affine</code>' distortion). </p>
2998
2999 <p>By using more coordinates you can make use of image registration tool to
3000 find matching coordinate pairs in overlapping images, so as to improve the
3001 'fit' of the distortion. Of course a bad coordinate pair can also make the
3002 'fit' worse. Caution is always advised. </p>
3003
3004 <p>Colors are acquired from the source image according to a cylindrical
3005 resampling <a href="#filter" >-filter</a>, using a special technique known as
3006 EWA resampling. This produces very high quality results, especially when
3007 images become smaller (minified) in the output, which is very common when
3008 using '<code>perspective</code>' distortion. For example here we view
3009 a infinitely tiled 'plane' all the way to the horizon. </p>
3010
3011 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick -size 90x90 pattern:checkerboard -normalize -virtual-pixel tile \
3012 -distort perspective '0,0,5,45 89,0,45,46 0,89,0,89 89,89,89,89' \
3013 checks_tiled.jpg
3014 </samp></pre>
3015
3016 <p>Note that a infinitely tiled perspective images involving the horizon can
3017 be very slow, because of the number of pixels that are compressed to generate
3018 each individual pixel close to the 'horizon'. You can turn off EWA
3019 resampling, by specifying the special <a href="#filter" >-filter</a> setting of
3020 '<code>point</code>' (recommended if you plan to use super-sampling instead).
3021 </p>
3022
3023 <p>If an image generates <i>invalid pixels</i>, such as the 'sky' in the last
3024 example, <a href="#distort" >-distort</a> will use the current <a
3025 href="#mattecolor" >-mattecolor</a> setting for these pixels. If you do not
3026 what these pixels to be visible, set the color to match the rest of the
3027 ground. </p>
3028
3029 <p>The output image size will by default be the same as the input image. This
3030 means that if the part of the distorted image falls outside the viewed area of
3031 the 'distorted space', those parts is clipped and lost. However if you use
3032 the plus form of the operator (<a href="#distort" >+distort</a>) the operator
3033 will attempt (if possible) to show the whole of the distorted image, while
3034 retaining a correct 'virtual canvas' offset, for image layering. This offset
3035 may need to be removed using <a href="#repage" >+repage</a>, to remove if it
3036 is unwanted. </p>
3037
3038 <p>Setting <a href="#verbose" >-verbose</a> setting, will cause <a
3039 href="#distort" >-distort</a> to attempt to output the internal coefficients,
3040 and the <a href="#fx" >-fx</a> equivalent to the distortion, for expert study,
3041 and debugging purposes. This may not be available for all distorts. </p>
3042
3043 <p>You can alternatively specify a special "<code><a href="#define"
3044 >-define</a> distort:viewport={geometry_string}</code>" setting which will
3045 specify the size and the offset of the generated 'viewport' image of the
3046 distorted image space.</p>
3047
3048 <p>Setting a "<code><a href="#define" >-define</a>
3049 distort:scale=<var>scale_factor</var></code>" will scale the output image (viewport or
3050 otherwise) by that factor without changing the viewed contents of the
3051 distorted image. This can be used either for 'super-sampling' the image for
3052 a higher quality result, or for panning and zooming around the image (with
3053 appropriate viewport changes, or post-distort cropping and resizing). </p>
3054
3055 <p>Setting "<code><a href="#define" >-define</a> resample:verbose=1</code>"
3056 will output the cylindrical filter lookup table created by the EWA (Elliptical
3057 Weighted Average) resampling algorithm. Note this table uses a squared radius
3058 lookup value. This is typically only used for debugging EWA resampling. </p>
3059
3060
3061 <div style="mx-auto my-3 text-center">
3062 <h2><a class="anchor" id="distribute-cache"></a>-distribute-cache <var>port</var></h2>
3063 </div>
3064
3065 <p class="lead">Launch a distributed pixel cache server. </p>
3066
3067 <div style="mx-auto my-3 text-center">
3068 <h2><a class="anchor" id="dither"></a>-dither <var>method</var></h2>
3069 </div>
3070
3071 <p class="lead">Apply a Riemersma or Floyd-Steinberg error diffusion dither to
3072 images when general color reduction is applied via an option, or automagically
3073 when saving to specific formats. This enabled by default.</p>
3074
3075 <p>Dithering places two or more colors in neighboring pixels so that to the
3076 eye a closer approximation of the images original color is reproduced. This
3077 reduces the number of colors needed to reproduce the image but at the cost of
3078 a lower level pattern of colors. Error diffusion dithers can use any set of
3079 colors (generated or user defined) to an image. </p>
3080
3081 <p>Dithering is turned on by default, to turn it off use the plus form of the
3082 setting, <a href="#dither">+dither</a>. This will also render PostScript
3083 without text or graphic aliasing. Disabling dithering often (but not always)
3084 leads to faster process, a smaller number of colors, but more cartoon like
3085 image coloring. Generally resulting in 'color banding' effects in areas with
3086 color gradients. </p>
3087
3088 <p>The color reduction operators <a href="#colors">-colors</a>, <a
3089 href="#monochrome">-monochrome</a>, <a href="#remap ">-remap</a>, and <a
3090 href="#posterize">-posterize</a>, apply dithering to images using the reduced
3091 color set they created. These operators are also used as part of automatic
3092 color reduction when saving images to formats with limited color support, such
3093 as <code>GIF:</code>, <code>XBM:</code>, and others, so dithering may also be used
3094 in these cases. </p>
3095
3096 <p>Alternatively you can use <a href="#random-threshold">-random-threshold</a>
3097 to generate purely random dither. Or use <a
3098 href="#ordered-dither">-ordered-dither</a> to apply threshold mapped dither
3099 patterns, using uniform color maps, rather than specific color maps. </p>
3100 <p>Use "<code><a href="#define" >-define</a> dither:diffusion-amount=35%</code>, for example, to control the amount of Floyd-Steinberg dither.</p>
3101
3102
3103 <div style="mx-auto my-3 text-center">
3104 <h2><a class="anchor" id="draw"></a>-draw <var>string</var></h2>
3105 </div>
3106
3107 <p class="lead">Annotate an image with one or more graphic primitives.</p>
3108
3109 <p>Use this option to annotate or decorate an image with one or more graphic
3110 primitives. The primitives include shapes, text, transformations, and pixel
3111 operations.</p>
3112
3113 <p>The shape primitives:</p>
3114
3115 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
3116 <dl class="row">
3117 <dt class="col-md-4">point</dt><dd class="col-md-8"> x,y</dd>
3118 <dt class="col-md-4">line</dt><dd class="col-md-8"> x0,y0 x1,y1</dd>
3119 <dt class="col-md-4">rectangle</dt><dd class="col-md-8"> x0,y0 x1,y1</dd>
3120 <dt class="col-md-4">roundRectangle</dt><dd class="col-md-8"> x0,y0 x1,y1 wc,hc</dd>
3121 <dt class="col-md-4">arc</dt><dd class="col-md-8"> x0,y0 x1,y1 a0,a1</dd>
3122 <dt class="col-md-4">ellipse</dt><dd class="col-md-8"> x0,y0 rx,ry a0,a1</dd>
3123 <dt class="col-md-4">circle</dt><dd class="col-md-8"> x0,y0 x1,y1</dd>
3124 <dt class="col-md-4">polyline</dt><dd class="col-md-8"> x0,y0 ... xn,yn</dd>
3125 <dt class="col-md-4">polygon</dt><dd class="col-md-8"> x0,y0 ... xn,yn</dd>
3126 <dt class="col-md-4">bezier</dt><dd class="col-md-8"> x0,y0 ... xn,yn</dd>
3127 <dt class="col-md-4">path</dt><dd class="col-md-8">specification </dd>
3128 <dt class="col-md-4">image</dt><dd class="col-md-8"> operator x0,y0 w,h filename</dd>
3129 </dl>
3130 </div>
3131
3132 <p>The text primitive:</p>
3133
3134 <dl class="row">
3135 <dt class="col-md-4">text</dt><dd class="col-md-8">x0,y0 string</dd>
3136 </dl>
3137 <p>The text gravity primitive:</p>
3138
3139 <dl class="row">
3140 <dt class="col-md-4">gravity</dt><dd class="col-md-8">NorthWest, North, NorthEast, West, Center, East, SouthWest, South, or SouthEast</dd>
3141 </dl>
3142
3143 <p>The text gravity primitive only affects the placement of text and does not
3144 interact with the other primitives. It is equivalent to using the <a
3145 href="#gravity">-gravity</a> command-line option, except that it is limited in
3146 scope to the <a href="#draw">-draw</a> option in which it appears.</p>
3147
3148 <p>The transformation primitives:</p>
3149
3150 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
3151 <dl class="row">
3152 <dt class="col-md-4">rotate</dt><dd class="col-md-8">degrees</dd>
3153 <dt class="col-md-4">translate</dt><dd class="col-md-8">dx,dy</dd>
3154 <dt class="col-md-4">scale</dt><dd class="col-md-8">sx,sy</dd>
3155 <dt class="col-md-4">skewX</dt><dd class="col-md-8">degrees</dd>
3156 <dt class="col-md-4">skewY</dt><dd class="col-md-8">degrees</dd>
3157 </dl>
3158 </div>
3159
3160 <p>The pixel operation primitives:</p>
3161
3162 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
3163 <dl class="row">
3164 <dt class="col-md-4">color</dt><dd class="col-md-8">x0,y0 method</dd>
3165 <dt class="col-md-4">matte</dt><dd class="col-md-8">x0,y0 method</dd>
3166 </dl>
3167 </div>
3168
3169 <p>The shape primitives are drawn in the color specified by the preceding <a
3170 href="#fill">-fill</a> setting. For unfilled shapes, use <a
3171 href="#fill">-fill none</a>. You can optionally control the stroke (the
3172 "outline" of a shape) with the <a href="#stroke">-stroke</a> and <a
3173 href="#strokewidth">-strokewidth</a> settings.</p>
3174
3175 <p>A <code>point</code> primitive is specified by a single <var>point</var> in the
3176 pixel plane, that is, by an ordered pair of integer coordinates,
3177 <var>x</var>,<var>y</var>. (As it involves only a single pixel, a <code>point</code>
3178 primitive is not affected by <a href="#stroke">-stroke</a> or <a
3179 href="#strokewidth">-strokewidth</a>.)</p>
3180
3181 <p>A <code>line</code> primitive requires a start point and end point.</p>
3182
3183 <p>A <code>rectangle</code> primitive is specified by the pair of points at the
3184 upper left and lower right corners.</p>
3185
3186 <p>A <code>roundRectangle</code> primitive takes the same corner points as
3187 a <code>rectangle</code> followed by the width and height of the rounded corners
3188 to be removed.</p>
3189
3190 <p>The <code>circle</code> primitive makes a disk (filled) or circle (unfilled).
3191 Give the center and any point on the perimeter (boundary). Note, by using a translation, you can remove the need to calculate the circles edge coordinate, but can just give the radius directly:</p>
3192
3193 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><pre><samp>$ magick -size 100x60 xc: -stroke SeaGreen -fill PaleGreen -strokewidth 2 -draw 'translate 50,30 circle 0,0 25,0' circle.gif</samp></pre></pre>
3194
3195 <p>The <code>arc</code> primitive is used to inscribe an elliptical segment in
3196 to a given rectangle. An <code>arc</code> requires the two corners used for
3197 <code>rectangle</code> (see above) followed by the start and end angles of the
3198 arc of the segment (e.g. 130,30 200,100 45,90). The start and end
3199 points produced are then joined with a line segment and the resulting segment
3200 of an ellipse is filled.</p>
3201
3202 <p>Use <code>ellipse</code> to draw a partial (or whole) ellipse. Give the
3203 center point, the horizontal and vertical "radii" (the <var>semi-axes</var> of
3204 the ellipse) and start and end angles in degrees (e.g. 100,100 100,150
3205 0,360).</p>
3206
3207 <p>The <code>polyline</code> and <code>polygon</code> primitives require three or
3208 more points to define their perimeters. A <code>polyline</code> is simply
3209 a <code>polygon</code> in which the final point is not stroked to the start
3210 point. When unfilled, this is a <var>polygonal line</var>. If the <a
3211 href="#stroke">-stroke</a> setting is <code>none</code> (the default), then
3212 a <code>polyline</code> is identical to a <code>polygon</code>. </p>
3213
3214 <p>A <var>coordinate</var> is a pair of integers separated by a space or
3215 optional comma. </p>
3216
3217 <p>As an example, to define a circle centered at 100,100 that extends to
3218 150,150 use:</p>
3219
3220 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><code>-draw 'circle 100,100 150,150'
3221 </code></pre>
3222
3223 <p>The <code>Bezier</code> primitive creates a spline curve and requires three
3224 or points to define its shape. The first and last points are the
3225 <var>knots</var> and these points are attained by the curve, while any
3226 intermediate coordinates are <var>control points</var>. If two control points
3227 are specified, the line between each end knot and its sequentially respective
3228 control point determines the tangent direction of the curve at that end. If
3229 one control point is specified, the lines from the end knots to the one
3230 control point determines the tangent directions of the curve at each end. If
3231 more than two control points are specified, then the additional control points
3232 act in combination to determine the intermediate shape of the curve. In order
3233 to draw complex curves, it is highly recommended either to use the
3234 <code>path</code> primitive or to draw multiple four-point bezier segments with
3235 the start and end knots of each successive segment repeated. For example:</p>
3236
3237 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><code>-draw 'bezier 20,50 45,100 45,0 70,50'
3238 -draw 'bezier 70,50 95,100 95,0 120,50'
3239 </code></pre>
3240
3241 <p>A <code>path</code> represents an outline of an object, defined in terms of
3242 moveto (set a new current point), lineto (draw a straight line), curveto (draw
3243 a Bezier curve), arc (elliptical or circular arc) and closepath (close the
3244 current shape by drawing a line to the last moveto) elements. Compound paths
3245 (i.e., a path with subpaths, each consisting of a single moveto followed by
3246 one or more line or curve operations) are possible to allow effects such as
3247 <var>donut holes</var> in objects. (See <a
3248 href="http://www.w3.org/TR/SVG/paths.html">Paths</a>.)</p>
3249
3250 <p>Use <code>image</code> to composite an image with another image. Follow the
3251 image keyword with the composite operator, image location, image size, and
3252 filename:</p>
3253
3254 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><code>-draw 'image SrcOver 100,100 225,225 image.jpg'
3255 </code></pre>
3256
3257 <p>You can use 0,0 for the image size, which means to use the actual
3258 dimensions found in the image header. Otherwise, it is scaled to the given
3259 dimensions. See <a href="../compose/index.html">Alpha Compositing</a> for
3260 a detailed discussion of alpha composition methods that are available. </p>
3261
3262 <p>The "special augmented compose operators" such as "dissolve" that require
3263 arguments cannot be used at present with the <code>-draw image</code> option.
3264 </p>
3265
3266 <p>Use <code>text</code> to annotate an image with text. Follow the text
3267 coordinates with a string. If the string has embedded spaces, enclose it in
3268 single or double quotes.</p>
3269
3270 <p>For example, the following annotates the image with <code>Works like
3271 magick!</code> for an image titled <code>bird.miff</code>. </p>
3272
3273 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><code>-draw "text 100,100 'Works like magick!'"</code></pre>
3274
3275 <p>See the <a href="#annotate">-annotate</a> option for another convenient way
3276 to annotate an image with text.</p>
3277
3278 <p>The <code>rotate</code> primitive rotates subsequent shape primitives and
3279 text primitives about the origin of the main image:</p>
3280
3281 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><code>-draw "rotate 45 text 10,10 'Works like magick!'"</code></pre>
3282
3283 <p>The <code>translate</code> primitive translates subsequent shape and text
3284 primitives.</p>
3285
3286 <p>The <code>scale</code> primitive scales them.</p>
3287
3288 <p>The <code>skewX</code> and <code>skewY</code> primitives skew them with respect
3289 to the origin of the main image or the region.</p>
3290
3291 <p>The transformations modify the current affine matrix, which is initialized
3292 from the initial affine matrix defined by the <a href="#affine">-affine</a>
3293 option. Transformations are cumulative within the <a href="#draw">-draw</a>
3294 option. The initial affine matrix is not affected; that matrix is only changed
3295 by the appearance of another <a href="#affine">-affine</a> option. If another
3296 <a href="#draw">-draw</a> option appears, the current affine matrix is
3297 reinitialized from the initial affine matrix.</p>
3298
3299 <p>Use the <code>color</code> primitive to change the color of a pixel to the
3300 fill color (see <a href="#fill">-fill</a>). Follow the pixel coordinate with
3301 a method:</p>
3302
3303 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>point
3304 replace
3305 floodfill
3306 filltoborder
3307 reset
3308 </code></pre>
3309
3310 <p>Consider the target pixel as that specified by your coordinate. The
3311 <code>point</code> method recolors the target pixel. The <code>replace</code>
3312 method recolors any pixel that matches the color of the target pixel.
3313 <code>Floodfill</code> recolors any pixel that matches the color of the target
3314 pixel and is a neighbor, whereas <code>filltoborder</code> recolors any neighbor
3315 pixel that is not the border color. Finally, <code>reset</code> recolors all
3316 pixels.</p>
3317
3318 <p>Use <code>matte</code> to the change the pixel matte value to transparent.
3319 Follow the pixel coordinate with a method (see the <code>color</code> primitive
3320 for a description of methods). The <code>point</code> method changes the matte
3321 value of the target pixel. The <code>replace</code> method changes the matte
3322 value of any pixel that matches the color of the target pixel.
3323 <code>Floodfill</code> changes the matte value of any pixel that matches the
3324 color of the target pixel and is a neighbor, whereas <code>filltoborder</code>
3325 changes the matte value of any neighbor pixel that is not the border color (<a
3326 href="#bordercolor">-bordercolor</a>). Finally <code>reset</code> changes the
3327 matte value of all pixels.</p>
3328
3329 <p>You can set the primitive color, font, and font bounding box color with <a
3330 href="#fill">-fill</a>, <a href="#font">-font</a>, and <a href="#box">-box</a>
3331 respectively. Options are processed in command line order so be sure to use
3332 these options <var>before</var> the <a href="#draw">-draw</a> option.</p>
3333
3334 <p>Strings that begin with a number must be quoted (e.g. use '1.png' rather
3335 than 1.png).</p>
3336
3337 <p>Drawing primitives conform to the <a href="../magick-vector-graphics/index.html" >Magick
3338 Vector Graphics</a> format.</p>
3339 <p>Note, drawing requires an alpha channel. If none is available, an all opaque alpha channel is implicitly created.</p>
3340
3341
3342 <div style="mx-auto my-3 text-center">
3343 <h2><a class="anchor" id="duplicate"></a>-duplicate <var>count,indexes</var></h2>
3344 </div>
3345
3346 <p class="lead">Duplicate an image one or more times.</p>
3347
3348 <p>Specify the count and the image to duplicate by its index in the sequence.
3349 The first image is index 0. Negative indexes are relative to the end of the
3350 sequence, for example, -1 represents the last image of the sequence. Specify
3351 a range of images with a dash (e.g. 0-4). Separate indexes with a comma (e.g.
3352 0,2). Use <code>+duplicate</code> to duplicate the last image in the current
3353 image sequence.</p>
3354
3355 <div style="mx-auto my-3 text-center">
3356 <h2><a class="anchor" id="edge"></a>-edge <var>radius</var></h2>
3357 </div>
3358
3359 <p class="lead">Detect edges within an image.</p>
3360
3361 <div style="mx-auto my-3 text-center">
3362 <h2><a class="anchor" id="emboss"></a>-emboss <var>radius</var>{x<var>sigma</var></h2>
3363 </div>
3364
3365 <p class="lead">Emboss an image.</p>
3366
3367 <div style="mx-auto my-3 text-center">
3368 <h2><a class="anchor" id="encipher"></a>-encipher <var>filename</var></h2>
3369 </div>
3370
3371 <p class="lead">Encipher pixels for later deciphering by <a href="#decipher">-decipher</a>.</p>
3372
3373 <p>Get the passphrase from the file specified by <var>filename</var>.</p>
3374
3375 <p>For more information, see the webpage, <a href="../cipher/index.html">ImageMagick: Encipher or
3376 Decipher an Image</a>.</p>
3377
3378
3379 <div style="mx-auto my-3 text-center">
3380 <h2><a class="anchor" id="encoding"></a>-encoding <var>type</var></h2>
3381 </div>
3382
3383 <p class="lead">Specify the text encoding.</p>
3384
3385 <p>Choose from</p>
3386
3387 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>AdobeCustom AdobeExpert
3388 AdobeStandard AppleRoman
3389 BIG5 GB2312
3390 Latin 2 None
3391 SJIScode Symbol
3392 Unicode Wansung
3393 </code></pre>
3394
3395 <div style="mx-auto my-3 text-center">
3396 <h2><a class="anchor" id="endian"></a>-endian <var>type</var></h2>
3397 </div>
3398
3399 <p class="lead">Specify endianness (<code>MSB</code> or <code>LSB</code>) of the image.</p>
3400
3401 <p>To print a complete list of endian types, use the <a href="#list">-list endian</a> option.</p>
3402
3403 <p>Use <a href="#endian">+endian</a> to revert to unspecified endianness.</p>
3404
3405
3406 <div style="mx-auto my-3 text-center">
3407 <h2><a class="anchor" id="enhance"></a>-enhance</h2>
3408 </div>
3409
3410 <p class="lead">Apply a digital filter to enhance a noisy image.</p>
3411
3412
3413 <div style="mx-auto my-3 text-center">
3414 <h2><a class="anchor" id="equalize"></a>-equalize</h2>
3415 </div>
3416
3417 <p class="lead">Perform histogram equalization on the image channel-by-channel.</p>
3418
3419 <p>To perform histogram equalization on all channels in concert, transform the
3420 image into some other color space, such as HSL, OHTA, YIQ or YUV, then
3421 equalize the appropriate intensity-like channel, then convert back to RGB.</p>
3422
3423 <p>For example using HSL, we have: ... <code>-colorspace HSL -channel lightness
3424 -equalize -colorspace sRGB</code> ...</p>
3425
3426 <p>For YIQ, YUV and OHTA use the red channel. For example, OHTA is a principal
3427 components transformation that puts most of the information in the first
3428 channel. Here we have ... <code>-colorspace OHTA -channel red -equalize
3429 -colorspace sRGB</code> ...</p>
3430
3431 <div style="mx-auto my-3 text-center">
3432 <h2><a class="anchor" id="evaluate"></a>-evaluate <var>operator value</var></h2>
3433 </div>
3434
3435 <p class="lead">Alter channel pixels by evaluating an arithmetic, relational, or logical expression.</p>
3436
3437 <p>(See the <a href="#function" >-function</a> operator for some
3438 multi-parameter functions. See the <a href="#fx" >-fx</a> operator if more
3439 elaborate calculations are needed.)</p>
3440
3441 <p>The behaviors of each <var>operator</var> are summarized in the
3442 following list. For brevity, the numerical value of a "pixel" referred to
3443 below is the value of the corresponding channel of that pixel, while
3444 a "normalized pixel" is that number divided by the maximum
3445 (installation-dependent) value <var>QuantumRange</var>. (If
3446 normalized pixels are used, they are restored, following the other
3447 calculations, to the full range by multiplying by <var>QuantumRange</var>.)</p>
3448
3449 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
3450 <table class="table table-sm table-hover table-striped table-responsive">
3451 <col width="25%" />
3452 <col width="75%" />
3453 <thead>
3454 <tr>
3455 <th>Operator</th>
3456 <th>Summary (see further below for details)</th>
3457 </tr>
3458 </thead>
3459 <tbody>
3460
3461 <tr><td>Abs </td> <td>Add <var>value</var> to pixels and return absolute value. </td></tr>
3462 <tr><td>Add </td> <td>Add <var>value</var> to pixels. </td></tr>
3463 <tr><td>AddModulus </td> <td>Add <var>value</var> to pixels modulo <var>QuantumRange</var>.</td></tr>
3464 <tr><td>And </td> <td>Binary AND of pixels with <var>value</var>.</td></tr>
3465 <tr><td>Cos, Cosine </td> <td>Apply cosine to pixels with frequency <var>value</var> with 50% bias added.</td></tr>
3466 <tr><td>Divide </td> <td>Divide pixels by <var>value</var>.</td></tr>
3467 <tr><td>Exp </td> <td>base-e exponential function</td></tr>
3468 <tr><td>Exponential </td> <td>base-e exponential function</td></tr>
3469 <tr><td>Gaussian-noise</td><td> </td></tr>
3470 <tr><td>Impulse-noise</td><td> </td></tr>
3471 <tr><td>InverseLog </td> <td>Apply inverse scaled logarithm to normalized pixels.</td></tr>
3472 <tr><td>Laplacian-noise</td><td> </td></tr>
3473 <tr><td>LeftShift </td> <td>Shift the pixel values left by <var>value</var> bits (i.e., multiply pixels by 2<sup><var>value</var></sup>).</td></tr>
3474 <tr><td>Log </td> <td>Apply scaled logarithm to normalized pixels.</td></tr>
3475 <tr><td>Max </td> <td>Set pixels to maximum of <var>value</var> and current pixel <var>value</var> (i.e. set any pixels currently less than <var>value</var> to <var>value</var>).</td></tr>
3476 <tr><td>Mean </td> <td>Add the <var>value</var> and divide by 2.</td></tr>
3477 <tr><td>Median </td> <td>Choose the median value from an image sequence.</td></tr>
3478 <tr><td>Min </td> <td>Set pixels to minimum of <var>value</var> and current pixel <var>value</var> (i.e. set any pixels currently greater than <var>value</var> to <var>value</var>).</td></tr>
3479 <tr><td>Multiplicative-noise</td> <td>(These are equivalent to the corresponding <a href="#noise" >-noise</a> operators.)</td></tr>
3480 <tr><td>Multiply </td> <td>Multiply pixels by <var>value</var>.</td></tr>
3481 <tr><td>Or </td> <td>Binary OR of pixels with <var>value</var>.</td></tr>
3482 <tr><td>Poisson-noise</td><td> </td></tr>
3483 <tr><td>Pow </td> <td>Raise normalized pixels to the power <var>value</var>.</td></tr>
3484 <tr><td>RightShift </td> <td>Shift the pixel values right by <var>value</var> bits (i.e., divide pixels by 2<sup><var>value</var></sup>).</td></tr>
3485 <tr><td>RMS</td> <td>Square the pixel and add the <var>value</var>.</td></tr>
3486 <tr><td>RootMeanSquare</td> <td>Square the pixel and add the <var>value</var>.</td></tr>
3487 <tr><td>Set </td> <td>Set pixel equal to <var>value</var>.</td></tr>
3488 <tr><td>Sin, Sine </td> <td>Apply sine to pixels with frequency <var>value</var> with 50% bias added.</td></tr>
3489 <tr><td>Subtract </td> <td>Subtract <var>value</var> from pixels.</td></tr>
3490 <tr><td>Sum </td> <td></td></tr>
3491
3492 <tr><td>Threshold </td> <td>Threshold pixels larger than <var>value</var>.</td></tr>
3493 <tr><td>ThresholdBlack </td> <td>Threshold pixels to zero values equal to or below <var>value</var>.</td></tr>
3494 <tr><td>ThresholdWhite </td> <td>Threshold pixels to maximum values above <var>value</var>. </td></tr>
3495 <tr><td>Uniform-noise</td><td> </td></tr>
3496 <tr><td>Xor </td> <td>Binary XOR of pixels with <var>value.</var></td></tr>
3497
3498 </tbody>
3499 </table>
3500 </div>
3501
3502 <p>The specified functions are applied only to each previously set <a
3503 href="#channel" >-channel</a> in the image. If necessary, the results of the
3504 calculations are truncated (clipped) to fit in the interval [0, <var>QuantumRange</var>]. The transparency channel of the image is
3505 represented as a 'alpha' values (0 = fully transparent), so, for example, a
3506 <code>Divide</code> by 2 of the alpha channel will make the image
3507 semi-transparent. Append the percent symbol '<code>%</code>' to specify a value
3508 as a percentage of the <var>QuantumRange</var>.</p>
3509
3510 <p>To print a complete list of <a href="#evaluate">-evaluate</a> operators, use
3511 <a href="#list">-list evaluate</a>.</p>
3512
3513 <p>The results of the <code>Add</code>, <code>Subtract</code> and
3514 <code>Multiply</code> methods can also be achieved using either the <a
3515 href="#level" >-level</a> or the <a href="#level" >+level</a> operator, with
3516 appropriate argument, to linearly modify the overall range of color values.
3517 Please note, however, that <a href="#level" >-level</a> treats transparency as
3518 'matte' values (0 = opaque), while <a href="#level" >-evaluate</a> works with
3519 'alpha' values.</p>
3520
3521 <p><code>AddModulus</code> has been added as of ImageMagick 6.4.8-4 and provides
3522 addition modulo the <var>QuantumRange</var>. It is therefore
3523 equivalent to <code>Add</code> unless the resulting pixel value is outside the
3524 interval [0, <var>QuantumRange</var>]. </p>
3525
3526 <p><code>Exp or Exponential</code> has been added as of ImageMagick 6.6.5-1 and
3527 works on normalized pixel values. The <var>value</var> used with
3528 <code>Exp</code> should be negative so as to produce a decaying exponential
3529 function. Non-negative values will always produce results larger unity and
3530 thus outside the interval [0, <var>QuantumRange</var>]. The
3531 formula is expressed below. </p>
3532
3533 <p class="text-center">
3534 exp(<var>value</var> × <b><var>u</var></b>)
3535 </p>
3536
3537 <p> If the input image is squared, for example, using <a href="#-function"
3538 >-function polynomial "2 0 0"</a>, then a decaying Gaussian function will be
3539 the result.</p>
3540
3541 <p><code>Log</code> has been added as of ImageMagick 6.4.2-1 and works on
3542 normalized pixel values. This a <var>scaled</var> log function. The <var>value</var> used with <code>Log</code> provides a <var>scaling
3543 factor</var> that adjusts the curvature in the graph of the log function. The
3544 formula applied to a normalized value <b><var>u</var></b> is below. </p>
3545
3546 <p class="text-center">
3547 log(<var>value</var> × <b><var>u</var></b> + 1) / log(<var>value</var> + 1)
3548 </p>
3549
3550 <p><code>Pow</code> has been added as of ImageMagick 6.4.1-9, and works on
3551 normalized pixel values. Note that <code>Pow</code> is related to the <a
3552 href="#gamma" >-gamma</a> operator. For example, <b>-gamma 2</b> is equivalent
3553 to <b>-evaluate pow 0.5</b>, i.e., a 'square root' function. The value used
3554 with <a href="#gamma" >-gamma</a> is simply the reciprocal of the value used
3555 with <code>Pow</code>.</p>
3556
3557 <p><code>Cosine</code> and <code>Sine</code> was added as of IM v6.4.8-8 and
3558 converts the image values into a value according to a (co)sine wave function.
3559 The synonyms <code>Cos</code> and <code>Sin</code> may also be used. The output
3560 is biased 50% and normalized by 50% so as to fit in the respective color value
3561 range. The <var>value</var> scaling of the <var>period</var> of the
3562 function (its frequency), and thus determines the number of 'waves' that will
3563 be generated over the input color range. For example, if the <var>value</var> is 1, the effective period is simply the <var>QuantumRange</var>; but if the <var>value</var> is 2,
3564 then the effective period is the <var>half</var> the <var>QuantumRange</var>.</p>
3565
3566 <p class="text-center">
3567 0.5 + 0.5 × cos(2 π <b><var>u</var></b> × <var>value</var>).
3568 </p>
3569
3570 <p>Use <a href="#set">-set</a> '<code>option:evaluate:clamp=true</code> to clamp the evaluation value.</p>
3571
3572 <p>See also the <a href="#function" >-function</a> operator, which is a
3573 multi-value version of evaluate. </p>
3574
3575 <div style="mx-auto my-3 text-center">
3576 <h2><a class="anchor" id="evaluate-sequence"></a>-evaluate-sequence <var>operator</var></h2>
3577 </div>
3578
3579 <p class="lead">Alter channel pixels by evaluating an arithmetic, relational, or logical expression over a sequence of images. Ensure all the images in the sequence are in the same colorspace, otherwise you may get unexpected results, e.g. add <a href="#colorspace" >-colorspace sRGB</a> to your command-line.</p>
3580
3581 <p>To print a complete list of <a
3582 href="#evaluate-sequence">-evaluate-sequence</a> operators, use <a
3583 href="#list">-list evaluate</a>.</p>
3584
3585 <div style="mx-auto my-3 text-center">
3586 <h2><a class="anchor" id="exit"></a>-exit</h2>
3587 </div>
3588
3589 <p class="lead">Stop processing at this point.</p>
3590 <p> No further options are processed after this option. Useful in a script to force the <code>magick</code> command to exit without actually closing the pipeline that it is processing options from. You can also use the option as a <em>final</em> option on the <code>magick</code> command line instead of an implicit output image, to completely prevent any image write. Note, even the <code>NULL:</code> coder requires at least one image, for it to 'not write'! This option does not require any images at all.</p>
3591
3592 <div style="mx-auto my-3 text-center">
3593 <h2><a class="anchor" id="extent"></a>-extent <var>geometry</var></h2>
3594 </div>
3595
3596 <p class="lead">Set the image size and offset.</p>
3597
3598 <p>If the image is enlarged, unfilled areas are set to the background color.
3599 To position the image, use offsets in the <var>geometry</var>
3600 specification or precede with a <a href="#gravity">-gravity</a> setting. To
3601 specify how to compose the image with the background, use <a href="#compose"
3602 >-compose</a>.</p>
3603
3604 <p>The following command reduces or expands a JPEG image to fit on an 800x600
3605 display. If the aspect ratio of the input image isn't exactly 4:3, then the
3606 image is centered on an 800x600 black canvas: </p>
3607
3608 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick input.jpg -resize 800x600 -background black -compose Copy \
3609 -gravity center -extent 800x600 -quality 92 output.jpg
3610 </samp></pre>
3611
3612 <p>The command can also be used with a ratio. If the image is not already at that ratio, it will be cropped to fit it. The <a href="#gravity">-gravity</a> setting has the expected effects.</p>
3613
3614 <p>The following command crops a JPEG image so that it has a 4:3 ratio:</p>
3615
3616 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick input.jpg -extent 4:3 -quality 92 output.jpg
3617 </samp></pre>
3618
3619 <p>Append <code>&lt;</code> to pad only if the image is smaller than the specified size <em>and</em> not crop if the image is larger (i.e. no-op). Append <code>&gt;</code> to crop only if the image is larger than the specified size <em>and</em> not extend if the image is smaller. (i.e. no-op).</p>
3620
3621 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument.</p>
3622
3623 <div style="mx-auto my-3 text-center">
3624 <h2><a class="anchor" id="extract"></a>-extract <var>geometry</var></h2>
3625 </div>
3626
3627 <p class="lead">Extract the specified area from image.</p>
3628
3629 <p>This option is most useful for extracting a subregion of a very large raw
3630 image. Note that these two commands are equivalent:</p>
3631
3632 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick -size 16000x16000 -depth 8 -extract 640x480+1280+960 \
3633 image.rgb image.png",
3634 convert -size 16000x16000 -depth 8 'image.rgb[640x480+1280+960]' \
3635 image.rgb image.png"
3636 </samp></pre>
3637
3638 <p>If you omit the offsets, as in</p>
3639
3640 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick -size 16000x16000 -depth 8 -extract 640x480 \
3641 image.rgb image.png
3642 </samp></pre>
3643
3644 <p>the image is <var>resized</var> to the specified dimensions instead,
3645 equivalent to:</p>
3646
3647 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick -size 16000x16000 -depth 8 -resize 640x480 image.rgb image.png
3648 </samp></pre>
3649
3650 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument.</p>
3651
3652 <div style="mx-auto my-3 text-center">
3653 <h2><a class="anchor" id="family"></a>-family <var>fontFamily</var></h2>
3654 </div>
3655
3656 <p class="lead">Set a font family for text.</p>
3657
3658 <p>This setting suggests a font family that ImageMagick should try to use for
3659 rendering text. If the family can be found it is used; if not, a default font
3660 (e.g., "Arial") or a family known to be similar is substituted (e.g.,
3661 "Courier" might be used if "System" is requested but not found). Note, the family can be a CSS-style font list.</p>
3662
3663 <p>For other settings that affect fonts, see the options
3664 <a href="#font">-font</a>,
3665 <a href="#pointsize">-pointsize</a>,
3666 <a href="#stretch">-stretch</a>,
3667 <a href="#style">-style</a>,
3668 and <a href="#weight">-weight</a>. </p>
3669
3670 <div style="mx-auto my-3 text-center">
3671 <h2><a class="anchor" id="features"></a>-features <var>distance</var></h2>
3672 </div>
3673
3674 <p class="lead">Display (co-occurrence matrix) texture measure features for each channel in the image in each of four directions (horizontal, vertical, left and right diagonals) for the specified distance.</p>
3675
3676 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>Angular Second Moment Sum Entropy
3677 Contrast Entropy
3678 Correlation Difference Variance
3679 Sum of Squares Variance Difference Entropy
3680 Inverse Difference Moment Information Measure of Correlation 1
3681 Sum Average Information Measure of Correlation 2
3682 Sum Variance Maximum Correlation Coefficient
3683 </code></pre>
3684
3685 <div style="mx-auto my-3 text-center">
3686 <h2><a class="anchor" id="fft"></a>-fft</h2>
3687 </div>
3688
3689 <p class="lead">Implements the forward discrete Fourier transform (DFT).</p>
3690
3691 <p>This option is new as of ImageMagick 6.5.4-3 (and now working for Windows
3692 users in ImageMagick 6.6.0-9). It transforms an image from the normal
3693 (spatial) domain to the frequency domain. In the frequency domain, an image is
3694 represented as a superposition of complex sinusoidal waves of varying
3695 amplitudes. The image x and y coordinates are the possible frequencies along
3696 the x and y directions, respectively, and the pixel intensity values are
3697 complex numbers that correspond to the sinusoidal wave amplitudes. See for
3698 example, <a href="http://en.wikipedia.org/wiki/Fourier_transform">Fourier
3699 Transform</a>, <a href="http://en.wikipedia.org/wiki/DFT">Discrete Fourier
3700 Transform</a> and <a href="http://en.wikipedia.org/wiki/FFT">Fast Fourier
3701 Transform</a>.</p>
3702
3703 <p>A single image name is provided as output for this option. However, the
3704 output result will have two components. It is either a two-frame image or two
3705 separate images, depending upon whether the image format specified supports
3706 multi-frame images. The reason that we get a dual output result is because the
3707 frequency domain represents an image using complex numbers, which cannot be
3708 visualized directly. Therefore, the complex values are automagically separated
3709 into a two-component image representation. The first component is the
3710 magnitude of the complex number and the second is the phase of the complex
3711 number. See for example, <a
3712 href="http://en.wikipedia.org/wiki/Complex_numbers">Complex Numbers</a>.</p>
3713
3714 <p>The magnitude and phase component images must be specified using image
3715 formats that do not limit the color or compress the image. Thus, MIFF, TIF,
3716 PFM, EXR and PNG are the recommended image formats to use. All of these
3717 formats, except PNG support multi-frame images. So for example,</p>
3718
3719 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick image.png -fft fft_image.miff
3720 </samp></pre>
3721
3722 <p>generates a magnitude image as <code>fft_image.miff[0]</code> and a phase
3723 image as <code>fft_image.miff[1]</code>. Similarly,</p>
3724
3725 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick image.png -fft fft_image.png
3726 </samp></pre>
3727
3728 <p>generates a magnitude image as <code>fft_image-0.png</code> and a phase image
3729 as <code>fft_image-1.png</code>. If you prefer this representation, then you can
3730 force any of the other formats to produce two output images by including <a
3731 href="#adjoin">+adjoin</a> following -fft in the command line.</p>
3732
3733 <p>The input image can be any size, but if not square and even-dimensioned, it
3734 is padded automagically to the larger of the width or height of the input
3735 image and to an even number of pixels. The padding will occur at the bottom
3736 and/or right sides of the input image. The resulting output magnitude and
3737 phase images is square at this size. The kind of padding relies on the <a
3738 href="#virtual-pixel">-virtual-pixel</a> setting.</p>
3739
3740 <p>Both output components will have dynamic ranges that fit within
3741 [0, <var>QuantumRange</var>], so that HDRI need not be enabled.
3742 Phase values nominally range from 0 to 2*π, but is scaled to span the full
3743 dynamic range. (The first few releases had non-HDRI scaled but HDRI not
3744 scaled). The magnitude image is not scaled and thus generally will contain
3745 very small values. As such, the image normally will appear totally black. In
3746 order to view any detail, the magnitude image typically is enhanced with a log
3747 function into what is usually called the spectrum. A log function is used to
3748 enhance the darker values more in comparison to the lighter values. This can
3749 be done, for example, as follows:</p>
3750
3751 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick fft_image.miff[0] -contrast-stretch 0 \
3752 -evaluate log 1000 fft_image_spectrum.png"
3753 </samp></pre>
3754
3755 <p>where either <a href="#contrast-stretch">-contrast-stretch</a> 0 or <a
3756 href="#auto-level">-auto-level</a> is used to scale the image to full dynamic
3757 range, first. The argument to the <a href="#evaluate">-evaluate</a> log
3758 typically is specified between 100 and 10,000, depending upon the amount of
3759 detail that one wants to bring out in the spectrum. Larger values produce more
3760 visible detail. Too much detail, however, may hide the important features.</p>
3761
3762 <p>The <a href="http://www.fftw.org/">FFTW</a> delegate library is required to
3763 use <a href="#fft">-fft</a>.</p>
3764
3765 <p>Use <a href="#fft">+fft</a> to produce two output images that are the real
3766 and imaginary components of the complex valued Fourier transform.</p>
3767
3768 <p>However, as the real and imaginary components can contain negative values,
3769 this requires that IM be configured with HDRI enabled. In this case, you must
3770 use either MIFF, TIF, PFM or MPC formats for the real and imaginary component
3771 results, since they are formats that preserve both negative and fractional
3772 values without clipping them or truncating the fractional part. With either
3773 MIFF or TIF, one should add <code>-define quantum:format=32</code>, to allow those image
3774 types to work properly in HDRI mode without clipping.</p>
3775
3776 <p>The real and imaginary component images resulting from <a
3777 href="#fft">+fft</a> are also square, even dimensioned images due to the same
3778 padding that was discussed above for the magnitude and phase component
3779 images.</p>
3780
3781 <p>See the discussion on HDRI implementations of ImageMagick on the page <a
3782 href="../high-dynamic-range/index.html" >High Dynamic-Range Images</a>. For more
3783 about HDRI go the ImageMagick <a
3784 href="https://usage.imagemagick.org/basics/#hdri" >Usage</a> pages, <a
3785 href="http://www.fmwconcepts.com/imagemagick/fourier_transforms/fourier.html"
3786 >Fred's Fourier Processing With ImageMagick page</a> or this <a
3787 href="http://en.wikipedia.org/wiki/High_dynamic_range_imaging" >Wikipedia</a>
3788 entry. </p>
3789
3790 <p>By default the FFT is normalized (and the IFT is not). Use "<code><a href="#define" >-define</a> fourier:normalize=forward</code> to explicitly normalize the FFT and unnormalize the IFT.</p>
3791
3792
3793 <div style="mx-auto my-3 text-center">
3794 <h2><a class="anchor" id="fill"></a>-fill <var>color</var></h2>
3795 </div>
3796
3797 <p class="lead">Color to use when filling a graphic primitive.</p>
3798
3799 <p>This option accepts a color name, a hex color, or a numerical RGB, RGBA,
3800 HSL, HSLA, CMYK, or CMYKA specification. See <a href="../color/index.html" >Color Names</a> for
3801 a description of how to properly specify the color argument.</p>
3802
3803 <p>Enclose the color specification in quotation marks to prevent the "#" or
3804 the parentheses from being interpreted by your shell.</p>
3805
3806 <p>For example,</p>
3807
3808 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>-fill blue
3809 -fill "#ddddff"
3810 -fill "rgb(255,255,255)"
3811 </code></pre>
3812
3813 <p>See <a href="#draw">-draw</a> for further details.</p>
3814
3815 <p>To print a complete list of color names, use the <a href="#list">-list color</a> option.</p>
3816
3817 <div style="mx-auto my-3 text-center">
3818 <h2><a class="anchor" id="filter"></a>-filter <var>type</var></h2>
3819 </div>
3820
3821 <p class="lead">Use this <var>type</var> of filter when resizing or distorting an image.</p>
3822
3823 <p>Use this option to affect the resizing operation of an image during
3824 operations such as <a href="#resize">-resize</a> and <a href="#distort"
3825 >-distort</a>. For example you can use a simple resize filter such as:</p>
3826
3827 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>Point Hermite Cubic
3828 Box Gaussian Catrom
3829 Triangle Quadratic Mitchell
3830 CubicSpline
3831 </code></pre>
3832
3833 <p>Use <code>-define filter:lobes={2,3,4}</code> to specify the support size for filtering for the <code>CubicSpline</code> filter.</p>
3834
3835 <p>The <code>Bessel</code> and <code>Sinc</code> filter is also provided (as well
3836 as a faster <code>SincFast</code> equivalent form). However these filters are
3837 generally useless on their own as they are infinite filters that are being
3838 clipped to the filters support size. Their direct use is not recommended
3839 except via expert settings (see below). </p>
3840
3841 <p>Instead these special filter functions are typically windowed by a windowing
3842 function that the <a href="#filter" >-filter</a> setting defines. That is
3843 using these functions will define a 'Windowed' filter, appropriate to the
3844 operator involved. Windowed filters include: </p>
3845
3846 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>Lanczos Hamming Parzen
3847 Blackman Kaiser Welsh
3848 Hanning Bartlett Bohman
3849 </code></pre>
3850
3851 <p>Also one special self-windowing filter is also provided
3852 <code>Lagrange</code>, which will automagically re-adjust its function depending
3853 on the current 'support' or 'lobes' expert settings (see below).</p>
3854
3855 <p>If you do not select a filter with this option, the filter defaults to
3856 <code>Mitchell</code> for a colormapped image, an image with a matte channel, or
3857 if the image is enlarged. Otherwise the filter default to
3858 <code>Lanczos</code>.</p>
3859
3860 <p>To print a complete list of resize filters, use the <a href="#list">-list
3861 filter</a> option.</p>
3862
3863 <p>You can modify how the filter behaves as it scales your image through the
3864 use of these expert settings (see also <a href="#define" >-define</a> and <a
3865 href="#set" >-set</a>):-</p>
3866
3867 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
3868 <table class="table table-sm table-hover table-striped table-responsive">
3869 <tr>
3870 <td>-define filter:blur=<var>factor</var></td>
3871 <td>Scale the X axis of the filter (and its window). Use &gt; 1.0 for
3872 blurry or &lt; 1.0 for sharp. This should only be used with Gaussian and
3873 Gaussian-like filters simple filters, or you may not get the expected
3874 results. </td>
3875 </tr>
3876
3877 <tr>
3878 <td>-define filter:support=<var>radius</var></td>
3879 <td>Set the filter support radius. Defines how large the filter should be and
3880 thus directly defines how slow the filtered resampling process is. All
3881 filters have a default 'preferred' support size. Some filters like
3882 <code>Lagrange</code> and windowed filters adjust themselves depending on
3883 this value. With simple filters this value either does nothing (but slow
3884 the resampling), or will clip the filter function in a detrimental way.
3885 </td>
3886 </tr>
3887
3888 <tr>
3889 <td>-define filter:lobes=<var>count</var></td>
3890 <td>Set the number of lobes to use for the Sinc/Bessel filter. This an
3891 alternative way of specifying the 'support' range of the filter, that is
3892 designed to be more suited to windowed filters, especially when used for
3893 image distorts.</td>
3894 </tr>
3895
3896 <tr>
3897 <td>-define filter:sigma=<var>value</var></td>
3898 <td>The 'sigma' value used to define the <code>Gaussian</code> filter. Default
3899 sigma value is '<code>0.5</code>'. It only affects <code>Gaussian</code> but
3900 does not shrink (but may enlarge) the filter's 'support'. It can be used
3901 to generate very small blurs but without the filter 'missing' pixels due
3902 to using a small support setting. A larger value of '<code>0.707</code>'
3903 (a value of '1/sqrt(2)') is another common setting. </td>
3904 </tr>
3905
3906 <tr>
3907 <td>-define filter:b=<var>b-spline_factor</var></td>
3908 </tr>
3909
3910 <tr>
3911 <td>-define filter:c=<var>keys_alpha_factor</var></td>
3912 <td>Redefine the values used for cubic filters such as <code>Cubic</code>,
3913 <code>Catrom</code>, <code>Mitchel</code>, and <code>Hermite</code>, as well as
3914 the <code>Parzen</code> cubic windowing function. If only one of the values
3915 are defined, the other is set so as to generate a 'Cubic-Keys' filter.
3916 The values meaning was defined by a research paper by
3917 Mitchell-Netravali.</td>
3918 </tr>
3919
3920 <tr>
3921 <td>-define filter:kaiser-beta=<var>value</var></td>
3922 <td>The 'alpha' value used to as part of the Kaiser Windowing function.
3923 Default value is '6.5'. It only affects Kaiser windowing function, and
3924 does not affect any other attributes.
3925 Before ImageMagick v6.7.6-10, this option was known as "filter:alpha", (an
3926 inheritance from the very old "zoom" program). It was changed to bring the
3927 function in line with more modern academic research usage, and better
3928 assign it be more definitive. </td>
3929 </tr>
3930
3931 <tr>
3932 <td>-define filter:kaiser-alpha=<var>value</var></td>
3933 <td>This value when multiplied by 'PI' is equivalent to "kaiser-beta", and
3934 will override that setting. It only affects Kaiser windowing function,
3935 and does not affect any other attributes. </td>
3936 </tr>
3937
3938 <tr>
3939 <td>-define filter:filter=<var>filter_function</var></td>
3940 <td>Use this function directly as the weighting filter. This will allow
3941 you to directly use a windowing function such as <code>Blackman</code>,
3942 as a resampling filter, rather than as its normal usage as a windowing
3943 function. If defined, no windowing function also defined, the window function is set
3944 to <code>Box</code>). Directly specifying <code>Sinc</code> or <code>Jinc</code>
3945 as a filter will also do this. </td>
3946 </tr>
3947
3948 <tr>
3949 <td>-define filter:window=<var>filter_function</var></td>
3950 <td>The IIR (infinite impulse response) filters <code>Sinc</code> and
3951 <code>Jinc</code> are windowed (brought down to zero over the defined
3952 support range) with the given filter. This allows you to specify a filter
3953 function to be used as a windowing function for these IIR filters.
3954 Many of the defined filters are actually windowing functions for these IIR
3955 filters. A typical choices is <code>Box</code>, (which effectively turns
3956 off the windowing function). </td>
3957 </tr>
3958
3959 <tr>
3960 <td>-define filter:win-support=<var>radius</var></td>
3961 <td>Scale windowing function to this size instead. This causes the windowing
3962 (or self-windowing Lagrange filter) to act is if the support window is
3963 larger than what is actually supplied to the calling operator. The filter
3964 however is still clipped to the real support size given. If unset this
3965 will equal the normal filter support size. </td>
3966 </tr>
3967
3968 <tr>
3969 <td>-define filter:verbose=<var>1</var></td>
3970 <td>This causes IM to print information on the final internal filter
3971 selection to standard output. This includes a commented header on the
3972 filter settings being used, and data allowing the filter weights to be
3973 easily graphed. Note however that some filters are internally defined in terms of other filters. The <code>Lanczos</code> filter for example is defined in terms of
3974 a <code>SincFast</code> windowed <code>SincFast</code> filter, while
3975 <code>Mitchell</code> is defined as a general <code>Cubic</code> family filter
3976 with specific 'B' and 'C' settings. </td>
3977 </tr>
3978
3979 </table>
3980 </div>
3981
3982 <p>For example, to get a 8 lobe jinc windowed sinc filter (Genseng filter?):</p>
3983
3984 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick image.png \
3985 -filter sinc \
3986 -set filter:window=jinc \
3987 -set filter:lobes=8 \
3988 -resize 150% image.jpg"
3989 </samp></pre>
3990
3991 <p>Or a raw un-windowed Sinc filter with 4 lobes:</p>
3992
3993 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick image.png \
3994 -set filter:filter=sinc \
3995 -set filter:lobes=4 \
3996 -resize 150% image.jpg"
3997 </samp></pre>
3998
3999 <p>To extract the data for a raw windowing function, combine it with
4000 a '<code>Box</code>' filter. For example the '<code>Welch</code> parabolic
4001 windowing function. </p>
4002
4003 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick null: -define filter:filter=Box \
4004 -define filter:window=Welch \
4005 -define filter:support=1.0 \
4006 -define filter:verbose=1 \
4007 -resize 2 null: > window_welch.dat
4008 gnuplot
4009 set grid
4010 plot \"window_welch.dat\" with lines
4011 </samp></pre>
4012
4013 <p>Note that the use of expert options is provided for image processing experts
4014 who have studied and understand how resize filters work. Without this
4015 knowledge, and an understanding of the definition of the actual filters
4016 involved, using expert settings are more likely to be detrimental to your image
4017 resizing.</p>
4018
4019
4020 <div style="mx-auto my-3 text-center">
4021 <h2><a class="anchor" id="flatten"></a>-flatten</h2>
4022 </div>
4023
4024 <p class="lead">This is a simple alias for the <a href="#layers" >-layers</a> method "flatten".</p>
4025
4026
4027 <div style="mx-auto my-3 text-center">
4028 <h2><a class="anchor" id="flip"></a>-flip</h2>
4029 </div>
4030
4031 <p class="lead">Create a <var>mirror image</var></p>
4032
4033 <p>reflect the scanlines in the vertical direction. The image will be mirrored
4034 upside-down. </p>
4035
4036
4037 <div style="mx-auto my-3 text-center">
4038 <h2><a class="anchor" id="floodfill"></a>-floodfill {<var>+-</var>}<var>x</var>{<var>+-</var>}<var>y</var> <var>color</var></h2>
4039 </div>
4040
4041 <p class="lead">Floodfill the image with color at the specified offset.</p>
4042
4043 <p>Flood fill starts from the given 'seed point' which is not gravity affected.
4044 Any color that matches within <a href="#fuzz" >-fuzz</a> color distance of the
4045 given <var>color</var> argument, connected to that 'seed point'
4046 will be replaced with the current <a href="#fill" >-fill</a> color. </p>
4047
4048 <p>Note that if the pixel at the 'seed point' does not itself match the given
4049 <var>color</var> (according to <a href="#fuzz" >-fuzz</a>), then no
4050 action will be taken. </p>
4051
4052 <p>This operator works more like the <a href="#opaque" >-opaque</a> option, than
4053 a more general flood fill that reads the matching color directly at the 'seed
4054 point'. For this form of flood fill, look at <a href="#draw" >-draw</a> and
4055 its 'color floodfill' drawing method. </p>
4056
4057
4058 <div style="mx-auto my-3 text-center">
4059 <h2><a class="anchor" id="flop"></a>-flop</h2>
4060 </div>
4061
4062 <p class="lead">Create a <var>mirror image</var>.</p>
4063
4064 <p>Reflect the scanlines in the horizontal direction, just like the image in
4065 a vertical mirror. </p>
4066
4067
4068 <div style="mx-auto my-3 text-center">
4069 <h2><a class="anchor" id="font"></a>-font <var>name</var></h2>
4070 </div>
4071
4072 <p class="lead">Set the font to use when annotating images with text, or creating labels.</p>
4073
4074 <p>To print a complete list of fonts, use the <a href="#list">-list font</a>
4075 option (for versions prior to 6.3.6, use 'type' instead of 'font').</p>
4076
4077 <p>In addition to the fonts specified by the above pre-defined list, you can
4078 also specify a font from a specific source. For example <code>Arial.ttf</code>
4079 is a TrueType font file, <code>ps:helvetica</code> is PostScript font, and
4080 <code>x:fixed</code> is X11 font.</p>
4081
4082 <p>For other settings that affect fonts, see the options <a
4083 href="#family">-family</a>, <a href="#stretch">-stretch</a>, <a
4084 href="#style">-style</a>, and <a href="#weight">-weight</a>. </p>
4085
4086 <p>To specify an explicit font filename or collection, specify the font path preceded with a <code>@</code>, e.g., <code>@arial.ttf</code>. You can specify the font face index for font collections, e.g., <code>@msgothic.ttc[1]</code>.</p>
4087
4088
4089 <div style="mx-auto my-3 text-center">
4090 <h2><a class="anchor" id="foreground"></a>-foreground <var>color</var></h2>
4091 </div>
4092
4093 <p class="lead">Define the foreground color for menus.", "display</p>
4094
4095 <p>The color is specified using the format described under the <a
4096 href="#fill">-fill</a> option.</p>
4097
4098 <p>The default foreground color is black.</p>
4099
4100 <div style="mx-auto my-3 text-center">
4101 <h2><a class="anchor" id="format"></a>-format <var>type</var></h2>
4102 </div>
4103
4104 <p class="lead">The image format type.</p>
4105
4106 <p>When used with the <code>mogrify</code> utility, this option converts any
4107 image to the image <a href="../formats/index.html">format</a> you specify.
4108 For a list of image format types supported by ImageMagick, use <a
4109 href="#list">-list format</a>.</p>
4110
4111 <p>By default the file is written to its original name. However, if the
4112 filename extension matches a supported format, the extension is replaced with
4113 the image format type specified with <a href="#format">-format</a>. For
4114 example, if you specify <var>tiff</var> as the format type and the
4115 input image filename is <var>image.gif</var>, the output image
4116 filename becomes <var>image.tiff</var>.</p>
4117
4118 <div style="mx-auto my-3 text-center">
4119 <h2><a class="anchor" id="format_identify"></a>-format <var>expression</var></h2>
4120 </div>
4121
4122 <p class="lead">Output formatted image characteristics.</p>
4123
4124 <p>See <a href="../escape/index.html">Format and Print Image
4125 Properties</a> for an explanation on how to specify the argument to this
4126 option.</p>
4127
4128 <div style="mx-auto my-3 text-center">
4129 <h2><a class="anchor" id="frame"></a>-frame <var>geometry</var></h2>
4130 </div>
4131
4132 <p class="lead">Surround the image with a border or beveled frame.</p>
4133
4134 <p>The color of the border is specified with the <a href="#mattecolor"
4135 >-mattecolor</a> command line option. </p>
4136
4137 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument. The <var>size</var> portion of the <var>geometry</var> argument indicates the amount of extra width and
4138 height that is added to the dimensions of the image. If no offsets are given
4139 in the <var>geometry</var> argument, then the border added is
4140 a solid color. Offsets <var>x</var> and <var>y</var>, if present, specify that
4141 the width and height of the border is partitioned to form an outer bevel of
4142 thickness <var>x</var> pixels and an inner bevel of thickness
4143 <var>y</var> pixels. Negative offsets make no sense as frame arguments.
4144 </p>
4145
4146 <p>The <a href="#frame">-frame</a> option is affected by the current <a
4147 href="#compose">-compose</a> setting and assumes that this is using the default
4148 '<code>Over</code>' composition method. It generates an image of the appropriate
4149 size with the current <a href="#bordercolor">-bordercolor</a> setting, and then
4150 draws the frame of four distinct colors close to the current <a
4151 href="#mattecolor">-mattecolor</a>. The original image is then overlaid onto
4152 center of this image. This means that with the default compose method of
4153 '<code>Over</code>' any transparent parts may be replaced by the current <a
4154 href="#bordercolor">-bordercolor</a> setting.</p>
4155
4156 <p>The image composition is not
4157 affected by the <a href="#gravity">-gravity</a> option.</p>
4158
4159
4160 <div style="mx-auto my-3 text-center">
4161 <h2><a class="anchor" id="frame_import_"></a>-frame</h2>
4162 </div>
4163
4164 <p class="lead">Include the X window frame in the imported image. </p>
4165 <div style="mx-auto my-3 text-center">
4166 <h2><a class="anchor" id="function"></a>-function <var>function</var> <var>parameters</var></h2>
4167 </div>
4168
4169 <p class="lead">Apply a function to channel values.</p>
4170
4171 <p>This operator performs calculations based on the given arguments to modify
4172 each of the color values for each previously set <a
4173 href="#channel">-channel</a> in the image. See <a
4174 href="#evaluate">-evaluate</a> for details concerning how the results of the
4175 calculations are handled.</p>
4176
4177 <p>This is can be considered a multi-argument version of the <a
4178 href="#evaluate">-evaluate</a> operator. (Added in
4179 ImageMagick 6.4.8−8.)</p>
4180
4181 <p>Here, <var>parameters</var> is a comma-separated list of
4182 numerical values. The number of values varies depending on which <var>function</var> is selected. Choose the <var>function</var> from:</p>
4183
4184 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>Polynomial
4185 Sinusoid
4186 Arcsin
4187 Arctan
4188 </code></pre>
4189
4190 <p>To print a complete list of <a href="#function">-function</a> operators,
4191 use <a href="#list">-list function</a>. Descriptions follow.</p>
4192
4193 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
4194 <dl class="row">
4195 <dt class="col-md-4">Polynomial</dt>
4196 <dd class="col-md-8"><p>The <code>Polynomial</code> function takes an arbitrary number of parameters,
4197 these being the coefficients of a polynomial, in decreasing order of degree.
4198 That is, entering</p>
4199
4200 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>-function Polynomial <var>a</var><sub><var>n</var></sub>,<var>a</var><sub><var>n</var>-1</sub>,...<var>a</var><sub>1</sub>,<var>a</var><sub>0</sub>
4201 </code></pre>
4202
4203 <p>will invoke a polynomial function given by</p>
4204
4205 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code><var>a</var><sub><var>n</var></sub> <b><var>u</var></b><sup><var>n</var></sup> + <var>a</var><sub><var>n</var>-1</sub> <b><var>u</var></b><sup><var>n</var>-1</sup> + ··· <var>a</var><sub>1</sub> <b><var>u</var></b> + <var>a</var><sub>0</sub>,
4206 </code></pre>
4207
4208 <p>where <b><var>u</var></b> is pixel's original normalized channel value.</p>
4209
4210 <p>The <code>Polynomial</code> function can be used in place of <code>Set</code>
4211 (the <var>constant</var> polynomial) and <code>Add</code>, <code>Divide</code>,
4212 <code>Multiply</code>, and <code>Subtract</code> (some <var>linear</var>
4213 polynomials) of the <a href="#evaluate">-evaluate</a> operator. The <a
4214 href="#level">-level</a> operator also affects channels linearly. Some
4215 correspondences follow.</p>
4216
4217 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
4218 <table class="table table-sm table-hover table-striped table-responsive">
4219 <tr>
4220 <td>-evaluate Set <var>value</var> </td>
4221 <td>-function Polynomial <var>value</var></td>
4222 <td>(Constant functions; set <var>value</var>×100% gray when channels are RGB.)</td>
4223 </tr>
4224 <tr>
4225 <td>-evaluate Add <var>value</var> </td>
4226 <td>-function Polynomial 1,<var>value</var></td>
4227 </tr>
4228 <tr>
4229 <td>-evaluate Subtract <var>value</var> </td>
4230 <td>-function Polynomial 1,−<var>value</var></td>
4231 </tr>
4232 <tr>
4233 <td>-evaluate Multiply <var>value</var> </td>
4234 <td>-function Polynomial <var>value</var>,0</td>
4235 </tr>
4236 <tr>
4237 <td>+level black% x white%</td>
4238 <td>-function Polynomial A,B</td>
4239 <td>(Reduce contrast. Here, A=(white-black)/100 and B=black/100.)</td>
4240 </tr>
4241 </table>
4242 </div>
4243
4244 <p>The <code>Polynomial</code> function gives great versatility, since
4245 polynomials can be used to fit any continuous curve to any degree of accuracy
4246 desired.</p>
4247
4248 </dd>
4249 <dt class="col-md-4">Sinusoid</dt>
4250 <dd class="col-md-8">
4251 <p>The <code>Sinusoid</code> function can be used to vary the channel values
4252 sinusoidally by setting frequency, phase shift, amplitude, and a bias. These
4253 values are given as one to four parameters, as follows,</p>
4254
4255 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>-function <code>Sinusoid</code> <var>freq</var>,[<var>phase</var>,[<var>amp</var>,[<var>bias</var>]]]
4256 </code></pre>
4257
4258 <p>where <var>phase</var> is in degrees. (The domain [0,1] of the function
4259 corresponds to 0 through <var>freq</var>×360 degrees.)
4260 The result is that if a pixel's normalized channel value is originally
4261 <b><var>u</var></b>, its resulting normalized value is given by </p>
4262
4263 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code><var>amp</var> * sin(2*π* (<var>freq</var> * <b><var>u</var></b> + <var>phase</var> / 360)) + <var>bias</var>
4264 </code></pre>
4265
4266 <p> For example, the following generates a curve that starts and ends at 0.9
4267 (when <b><var>u</var></b>=0 and 1, resp.), oscillating three times between
4268 .7−.2=.5 and .7+.2=.9. </p>
4269
4270 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>-function Sinusoid 3,-90,.2,.7
4271 </code></pre>
4272
4273 <p>The default values of <var>amp</var> and <var>bias</var> are both .5. The default for <var>phase</var>
4274 is 0.</p>
4275
4276 <p>The <code>Sinusoid</code> function generalizes <code>Sin</code> and
4277 <code>Cos</code> of the <a href="#evaluate">-evaluate</a> operator by allowing
4278 varying amplitude, phase and bias. The correspondence is as follows.</p>
4279
4280 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
4281 <table class="table table-sm table-hover table-striped table-responsive">
4282 <tr>
4283 <td>-evaluate Sin <var>freq</var> </td>
4284 <td>-function Sinusoid <var>freq</var>,0 </td>
4285 </tr>
4286 <tr>
4287 <td>-evaluate Cos <var>freq</var> </td>
4288 <td>-function Sinusoid <var>freq</var>,90 </td>
4289 </tr>
4290 </table>
4291 </div>
4292 </dd>
4293 <dt class="col-md-4">ArcSin</dt>
4294 <dd class="col-md-8">
4295 <p>The <code>ArcSin</code> function generates the inverse curve of a Sinusoid,
4296 and can be used to generate cylindrical distortion and displacement maps.
4297 The curve can be adjusted relative to both the input values and output range
4298 of values.</p>
4299
4300 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>-function <code>ArcSin</code> <var>width</var>,[<var>center</var>,[<var>range</var>,[<var>bias</var>]]]
4301 </code></pre>
4302
4303 <p>with all values given in terms of normalized color values (0.0 for black,
4304 1.0 for white). Defaulting to values covering the full range from 0.0 to 1.0
4305 for bout input (<var>width</var>), and output (<var>width</var>) values. '<code>1.0,0.5,1.0,0.5</code>' </p>
4306
4307 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code><var>range</var>/π * asin( 2/<var>width</var> * ( <b><var>u</var></b> - <var>center</var> ) ) + <var>bias</var>
4308 </code></pre>
4309
4310 </dd>
4311 <dt class="col-md-4">ArcTan</dt>
4312 <dd class="col-md-8">
4313 <p>The <code>ArcTan</code> function generates a curve that smooth crosses from
4314 limit values at infinities, though a center using the given slope value.
4315 All these values can be adjusted via the arguments.</p>
4316
4317 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>-function <code>ArcTan</code> <var>slope</var>,[<var>center</var>,[<var>range</var>,[<var>bias</var>]]]
4318 </code></pre>
4319
4320 <p>Defaulting to '<code>1.0,0.5,1.0,0.5</code>'.
4321 </p>
4322
4323 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code><var>range</var>/π * atan( <var>slope</var>*π * ( <b><var>u</var></b> - <var>center</var> ) ) + <var>bias</var>
4324 </code></pre>
4325 </dd>
4326 </dl>
4327 </div>
4328
4329
4330
4331 <div style="mx-auto my-3 text-center">
4332 <h2><a class="anchor" id="fuzz"></a>-fuzz <var>distance</var>{<var>%</var>}</h2>
4333 </div>
4334
4335 <p class="lead">Colors within this <var>distance</var> are considered equal.</p>
4336
4337 <p>A number of algorithms search for a target color. By default the color must
4338 be exact. Use this option to match colors that are close to the target color
4339 in RGB space. For example, if you want to automagically trim the edges of an
4340 image with <a href="#trim">-trim</a> but the image was scanned and the target
4341 background color may differ by a small amount. This option can account for
4342 these differences.</p>
4343
4344 <p>The <var>distance</var> can be in absolute intensity units or, by
4345 appending <code>%</code> as a percentage of the maximum possible intensity (255,
4346 65535, or 4294967295).</p>
4347
4348 <p>Use <a href="#fuzz" >+fuzz</a> to reset the fuzz value to 0.</p>
4349
4350
4351 <div style="mx-auto my-3 text-center">
4352 <h2><a class="anchor" id="fx"></a>-fx <var>expression</var></h2>
4353 </div>
4354
4355 <p class="lead">Apply a mathematical expression to an image or image channels.</p>
4356
4357 <p>If the first character of <var>expression</var> is <code>@</code>,
4358 the expression is read from a file titled by the remaining characters in the
4359 string.</p>
4360
4361 <p>See <a href="../fx/index.html">FX,
4362 The Special Effects Image Operator</a> for a detailed discussion of this
4363 option.</p>
4364
4365
4366 <div style="mx-auto my-3 text-center">
4367 <h2><a class="anchor" id="gamma"></a>-gamma <var>value</var></h2>
4368 </div>
4369
4370 <p class="lead">Level of gamma correction.</p>
4371
4372 <p>The same color image displayed on two different workstations may look
4373 different due to differences in the display monitor. Use gamma correction to
4374 adjust for this color difference. Reasonable values extend from
4375 <code>0.8</code> to <code>2.3</code>. Gamma less than 1.0 darkens the image and
4376 gamma greater than 1.0 lightens it. Large adjustments to image gamma may
4377 result in the loss of some image information if the pixel quantum size is only
4378 eight bits (quantum range 0 to 255).</p>
4379
4380 <p>Gamma adjusts the image's channel values pixel-by-pixel according to
4381 a power law, namely, pow(pixel,1/gamma) or pixel^(1/gamma), where pixel is the
4382 normalized or 0 to 1 color value. For example, using a value of gamma=2 is the
4383 same as taking the square root of the image.</p>
4384
4385 <p>Use <a href="#gamma">+gamma <var>value</var></a> to set the
4386 image gamma level without actually adjusting the image pixels. This option
4387 is useful if the image is of a known gamma but not set as an image attribute
4388 (e.g. PNG images). Write the "file gamma" which is the reciprocal of the
4389 display gamma; e.g., if your image is sRGB and you want to write a PNG gAMA
4390 chunk, use</p>
4391
4392 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick input.png +gamma .45455 output.png
4393 </samp></pre>
4394
4395 <p>(0.45455 is 1/2.2)</p>
4396
4397 <p>Note that gamma adjustments are also available via the <a href="#level">-level</a> operator.</p>
4398
4399 <div style="mx-auto my-3 text-center">
4400 <h2><a class="anchor" id="gaussian-blur"></a>-gaussian-blur <var>radius</var><br />-gaussian-blur <var>radius</var>{x<var>sigma</var>}</h2>
4401 </div>
4402
4403 <p class="lead">Blur the image with a Gaussian operator.</p>
4404
4405 <p>Convolve the image with a Gaussian or normal distribution using the given
4406 <var >Sigma</var> value. The formula is:</p>
4407
4408 <p class="text-center"><img class="img-fluid img-thumbnail" alt="gaussian distribution" width="243px" height="42px" src="../image/gaussian-blur.png"/> </p>
4409
4410 <p>The <var>sigma</var> value is the important argument, and
4411 determines the actual amount of blurring that will take place. </p>
4412
4413 <p>The <var>radius</var> is only used to determine the size of the
4414 array which will hold the calculated Gaussian distribution. It should be an
4415 integer. If not given, or set to zero, IM will calculate the largest possible
4416 radius that will provide meaningful results for the Gaussian distribution.
4417 </p>
4418
4419 <p>The larger the <var >Radius</var> the radius the slower the
4420 operation is. However too small a <var >Radius</var>, and severe
4421 aliasing effects may result. As a guideline, <var >Radius</var>
4422 should be at least twice the <var >Sigma</var> value, though three
4423 times will produce a more accurate result. </p>
4424
4425 <p>This differs from the faster <a href="#blur">-blur</a> operator in that a
4426 full 2-dimensional convolution is used to generate the weighted average of the
4427 neighboring pixels. </p>
4428
4429 <p>The <a href="#virtual-pixel">-virtual-pixel</a> setting will determine how
4430 pixels which are outside the image proper are blurred into the final result.
4431 </p>
4432
4433
4434 <div style="mx-auto my-3 text-center">
4435 <h2><a class="anchor" id="geometry"></a>-geometry <var>geometry</var></h2>
4436 </div>
4437
4438 <p class="lead">Set the preferred size and location of the image.</p>
4439
4440 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument.</p>
4441
4442 <div style="mx-auto my-3 text-center">
4443 <h2><a class="anchor" id="gravity"></a>-gravity <var>type</var></h2>
4444 </div>
4445
4446 <p class="lead">Sets the current gravity suggestion for various other settings and options.</p>
4447
4448 <p>Choices include: <code>NorthWest</code>, <code>North</code>,
4449 <code>NorthEast</code>, <code>West</code>, <code>Center</code>, <code>East</code>,
4450 <code>SouthWest</code>, <code>South</code>, <code>SouthEast</code>. Use <a
4451 href="#list">-list gravity</a> to get a complete list of <a
4452 href="#gravity">-gravity</a> settings available in your ImageMagick
4453 installation.</p>
4454
4455 <p>The direction you choose specifies where to position text or subimages. For
4456 example, a gravity of <code>Center</code> forces the text to be centered within
4457 the image. By default, the image gravity is <code>undefined</code>. See <a
4458 href="#draw">-draw</a> for more details about graphic primitives. Only the
4459 text primitive of <a href="#draw">-draw</a> is affected by the <a
4460 href="#gravity">-gravity</a> option.</p>
4461
4462 <p>The <a href="#gravity">-gravity</a> option is also used in concert with the
4463 <a href="#geometry">-geometry</a> setting and other settings or options that
4464 take <var>geometry</var> as an argument, such as the <a
4465 href="#crop">-crop</a> option. </p>
4466
4467 <p>If a <a href="#gravity">-gravity</a> setting occurs before another option
4468 or setting having a <var>geometry</var> argument that specifies an
4469 offset, the offset is usually applied to the point within the image suggested
4470 by the <a href="#gravity">-gravity</a> argument. Thus, in the following
4471 command, for example, suppose the file <code>image.png</code> has dimensions
4472 200x100. The offset specified by the argument to <a href="#region">-region</a>
4473 is (−40,+20). The argument to <a href="#gravity">-gravity</a> is
4474 <code>Center</code>, which suggests the midpoint of the image, at the point
4475 (100,50). The offset (−40,20) is applied to that point, giving
4476 (100−40,50+20)=(60,70), so the specified 10x10 region is located at
4477 that point. (In addition, the <a href="#gravity">-gravity</a> affects the
4478 region itself, which is <var>centered</var> at the pixel
4479 coordinate (60,70). (See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument.)</p>
4480
4481 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick image.png -gravity Center -region 10x10-40+20 \
4482 -negate output.png
4483 </samp></pre>
4484
4485 <p>When used as an option to <a href="../composite/index.html">composite</a>, <a
4486 href="#gravity">-gravity</a> gives the direction that the image gravitates
4487 within the composite.</p>
4488
4489 <p>When used as an option to <a href="../montage/index.html">montage</a>, <a
4490 href="#gravity">-gravity</a> gives the direction that an image gravitates
4491 within a tile. The default gravity is <code>Center</code> for this purpose.</p>
4492
4493 <p>Use <a href="#gravity">+gravity</a> to return gravity to its default value.</p>
4494
4495
4496 <div style="mx-auto my-3 text-center">
4497 <h2><a class="anchor" id="grayscale"></a>-grayscale <var>method</var></h2>
4498 </div>
4499
4500 <p class="lead">Convert image to grayscale.</p>
4501
4502 <p>This will use one of the <a href="#intensity" >-intensity</a> methods to
4503 convert the given image into a grayscale image. </p>
4504
4505 <p>For example, to convert an image to (linear) Rec709Luminance grayscale, type:</p>
4506
4507 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick in.png -grayscale Rec709Luminance out.png
4508 </samp></pre>
4509
4510 <p>which is equivalent to:</p>
4511
4512 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary">
4513 <pre><samp>$ magick in.png -colorspace LinearGray out.png</samp></pre>
4514 </pre>
4515
4516 <p>Similarly, to convert an image to (non-linear) Rec709Luma grayscale, type:</p>
4517
4518 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick in.png -grayscale Rec709Luma out.png
4519 </samp></pre>
4520
4521 <p>which is equivalent to:</p>
4522
4523 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick in.png -colorspace Gray out.png
4524 </samp></pre>
4525
4526 <p>Note that a 'colorspace' intensity method will produce the same result
4527 regardless of the current colorpsace of the image. But a 'mathematical'
4528 intensity method depends on the current colorspace the image is currently
4529 using. </p>
4530
4531 <p>While this operation uses an <a href="#intensity" >-intensity</a> method,
4532 it does not use or set the <a href="#intensity" >-intensity</a> setting, so
4533 will not affect other operations that may use that setting.</p>
4534
4535
4536 <div style="mx-auto my-3 text-center">
4537 <h2><a class="anchor" id="green-primary"></a>-green-primary <var>x,y</var></h2>
4538 </div>
4539
4540 <p class="lead">Green chromaticity primary point.</p>
4541
4542
4543 <div style="mx-auto my-3 text-center">
4544 <h2><a class="anchor" id="hald-clut"></a>-hald-clut</h2>
4545 </div>
4546
4547 <p class="lead">Apply a Hald color lookup table to the image.</p>
4548
4549 <p>A Hald color lookup table is a 3-dimensional color cube mapped to 2
4550 dimensions. Create it with the <code>HALD:</code> prefix (e.g. HALD:8). You
4551 can apply any color transformation to the Hald image and then use this option
4552 to apply the transform to the image. </p>
4553
4554 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick image.png hald.png -hald-clut transform.png
4555 </samp></pre>
4556
4557 <p>This option provides a convenient method for you to use Gimp or Photoshop
4558 to make color corrections to the Hald CLUT image and subsequently apply them
4559 to multiple images using an ImageMagick script. </p>
4560
4561 <p>Note that the representation is only of the normal RGB color space and that
4562 the whole color value triplet is used for the interpolated lookup of the
4563 represented Hald color cube image. Because of this the operation is not <a
4564 href="#channel" >-channel</a> setting affected, nor can it adjust or modify an
4565 images transparency or alpha/matte channel.</p>
4566
4567 <p>See also <a href="#clut" >-clut</a> which provides color value replacement
4568 of the individual color channels, usually involving a simpler grayscale
4569 image. E.g: grayscale to color replacement, or modification by a histogram
4570 mapping. </p>
4571
4572
4573 <div style="mx-auto my-3 text-center">
4574 <h2><a class="anchor" id="help"></a>-help</h2>
4575 </div>
4576
4577 <p class="lead">Print usage instructions.</p>
4578
4579 <div style="mx-auto my-3 text-center">
4580 <h2><a class="anchor" id="highlight-color"></a>-highlight-color <var>color</var></h2>
4581 </div>
4582
4583 <p class="lead">When comparing images, emphasize pixel differences with this color.</p>
4584
4585 <div style="mx-auto my-3 text-center">
4586 <h2><a class="anchor" id="hough-lines"></a>-hough-lines <var>width</var>x<var>height</var>{<var>+threshold</var>}</h2>
4587 </div>
4588
4589 <p class="lead">Identify straight lines in the image (e.g. -hough-lines 9x9+195).</p>
4590
4591 <p>Use the Hough line detector with any binary edge extracted image to locate and draw any straight lines that it finds.</p>
4592
4593 <p>The process accumulates counts for every white pixel in the binary edge image for every possible orientation (for angles from 0 to 179 in 1 deg increments) and distance from the center of the image to the corners (in 1 px increments). It stores the counts in an accumulator matrix of angle vs distance. The size of the accumulator will be 180x(diagonal/2). Next it searches the accumulator for peaks in counts and converts the locations of the peaks to slope and intercept in the normal x,y input image space. The algorithm uses slope/intercepts to find the endpoints clipped to the bounds of the image. The lines are drawn from the given endpoints. The counts are a measure of the length of the lines.</p>.
4594
4595 <p>The WxH arguments specify the filter size for locating the peaks in the Hough accumulator. The threshold excludes lines whose counts are less than the threshold value.</p>
4596
4597 <p>Use <code><a href="#background" >-background</a></code> to specify the color of the background onto which the lines will be drawn. The default is black.</p>
4598
4599 <p>Use <code><a href="#fill" >-fill</a></code> to specify the color of the lines. The default is black.</p>
4600
4601 <p>Use <code><a href="#stroke" >-stroke</a></code> and <code><a href="#strokewidth" >-strokewidth</a></code> to specify the thickness of the lines. The default is black and no strokewidth.</p>
4602
4603 <p>A text file listing the endpoints and counts may be created by using the suffix, .mvg, for the output image.</p>
4604
4605 <p>Use <code><a href="#define" >-define</a> hough-lines:accumulator=true</code> to return the accumulator image in addition to the lines image.</p>
4606
4607 <div style="mx-auto my-3 text-center">
4608 <h2><a class="anchor" id="iconGeometry"></a>-iconGeometry <var>geometry</var></h2>
4609 </div>
4610
4611 <p class="lead">Specify the icon geometry.</p>
4612
4613 <p>Offsets, if present in the geometry specification, are handled in the same
4614 manner as the <a href="#geometry">-geometry</a> option, using X11 style to
4615 handle negative offsets.</p>
4616
4617 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument.</p>
4618
4619 <div style="mx-auto my-3 text-center">
4620 <h2><a class="anchor" id="iconic"></a>-iconic</h2>
4621 </div>
4622
4623 <p class="lead">Start in icon mode in X Windows", 'animate', 'display</p>
4624
4625 <div style="mx-auto my-3 text-center">
4626 <h2><a class="anchor" id="identify"></a>-identify</h2>
4627 </div>
4628
4629 <p class="lead">Identify the format and characteristics of the image.</p>
4630
4631 <p>This information is printed by default:
4632 <ul>
4633 <li>image scene number (if its not zero)</li>
4634 <li>image name</li>
4635 <li>image format</li>
4636 <li>image size</li>
4637 <li>virtual page offset</li>
4638 <li>color depth</li>
4639 <li>colorspace</li>
4640 <li>file size in bytes</li>
4641 <li>consumed user time identifying the image</li>
4642 <li>elapsed time identifying the image</li>
4643 </ul></p>
4644
4645 <p>To customize the attributes you want to identify, use <a href="#format_identify_">-format</a>.</p>
4646
4647 <p>If <a href="#colors">-colors</a> is also specified, the total unique colors
4648 in the image and color reduction error values are printed. Refer to <a
4649 href="../quantize/index.html">color
4650 reduction algorithm</a> for a description of these values.</p>
4651
4652 <p>If <a href="#verbose">-verbose</a> precedes this option, copious
4653 amounts of image properties are displayed including image statistics, profiles,
4654 image histogram, and others.</p>
4655
4656 <div style="mx-auto my-3 text-center">
4657 <h2><a class="anchor" id="ift"></a>-ift</h2>
4658 </div>
4659
4660 <p class="lead">Implements the inverse discrete Fourier transform (DFT).</p>
4661
4662 <p>This option is new as of ImageMagick 6.5.4-3 (and now working for Windows
4663 users in ImageMagick 6.6.0-9). It transforms a pair of magnitude and phase
4664 images from the frequency domain to a single image in the normal or spatial
4665 domain. See for example, <a
4666 href="http://en.wikipedia.org/wiki/Fourier_transform">Fourier Transform</a>,
4667 <a href="http://en.wikipedia.org/wiki/DFT">Discrete Fourier Transform</a> and
4668 <a href="http://en.wikipedia.org/wiki/FFT">Fast Fourier Transform</a>.</p>
4669
4670 <p>For example, depending upon the image format used to store the result of
4671 the <a href="#fft">-fft</a>, one would use either</p>
4672
4673 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick fft_image.miff -ift fft_image_ift.png
4674 </samp></pre>
4675
4676 <p>or</p>
4677
4678 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick fft_image-0.png fft_image-1.png -ift fft_image_ift.png
4679 </samp></pre>
4680
4681 <p>The resulting image may need to be cropped due to padding introduced when
4682 the original image, prior to the <a href="#fft">-fft</a> or <a
4683 href="#fft">+fft</a>, was not square or even dimensioned. Any padding is at
4684 the right and/or bottom sides of the image.</p>
4685
4686 <p>The <a href="http://www.fftw.org/">FFTW</a> delegate library is required to
4687 use <a href="#ift">-ift</a>.</p>
4688
4689 <p>Use <a href="#ift">+ift</a> (with HDRI enabled) to transform a pair of real
4690 and imaginary images from the frequency domain to a single image in the normal
4691 (spatial) domain.</p>
4692
4693 <p>By default the IFT is not normalized (and the FFT is). Use "<code><a href="#define" >-define</a> fourier:normalize=inverse</code> to explicitly normalize the IFT and unnormalize the FFT.</p>
4694
4695 <div style="mx-auto my-3 text-center">
4696 <h2><a class="anchor" id="illuminant"></a>-illuminant <var>method</var></h2>
4697 </div>
4698
4699 <p class="lead">reference illuminant. Choose from <code>A</code>, <code>B</code>, <code>C</code>, <code>D50</code>, <code>D55</code>, <code>D65</code>, <code>E</code>, <code>F2</code>, <code>F7</code>, or <code>F11</code>.</p>
4700
4701 <div style="mx-auto my-3 text-center">
4702 <h2><a class="anchor" id="immutable"></a>-immutable</h2>
4703 </div>
4704
4705 <p class="lead">Make image immutable.</p>
4706
4707 <div style="mx-auto my-3 text-center">
4708 <h2><a class="anchor" id="implode"></a>-implode <var>factor</var></h2>
4709 </div>
4710
4711 <p class="lead">Implode image pixels about the center.</p>
4712
4713 <div style="mx-auto my-3 text-center">
4714 <h2><a class="anchor" id="insert"></a>-insert <var>index</var></h2>
4715 </div>
4716
4717 <p class="lead">Insert the last image into the image sequence.</p>
4718
4719 <p>This option takes last image in the current image sequence and inserts it
4720 at the given index. If a negative index is used, the insert position is
4721 calculated before the last image is removed from the sequence. As such
4722 <code>-insert -1</code> will result in no change to the image sequence.</p>
4723
4724 <p>The <code>+insert</code> option is equivalent to <code>-insert -1</code>. In
4725 other words, insert the last image, at the end of the current image sequence.
4726 Consequently this has no effect on the image sequence order.</p>
4727
4728 <div style="mx-auto my-3 text-center">
4729 <h2><a class="anchor" id="intensity"></a>-intensity <var>method</var></h2>
4730 </div>
4731
4732 <p class="lead">Method to generate intensity value from pixel.</p>
4733
4734 <p>ImageMagick provides a number of methods used in situations where an
4735 operator needs to determine a single grayscale value for some purpose, from
4736 an image with red, green, and blue pixel components. Typically the
4737 <code>Rec709Luma</code> formula is used, which is the same formula used when converting images to <code>-colorspace gray</code>. </p>
4738
4739 <p>The following formulas are currently provided, and will first convert
4740 the pixel values to linear-RGB or non-linear sRGB colorspace before
4741 being applied to calculate the final greyscale value. </p>
4742
4743 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
4744 <dl class="row">
4745 <dt class="col-md-4">Rec601Luma</dt><dd class="col-md-8"> 0.298839R' + 0.586811G'+ 0.114350B'</dd>
4746 <dt class="col-md-4">Rec601Luminance</dt><dd class="col-md-8"> 0.298839R + 0.586811G + 0.114350B</dd>
4747 <dt class="col-md-4">Rec709Luma</dt><dd class="col-md-8"> 0.212656R' + 0.715158G' + 0.072186B'</dd>
4748 <dt class="col-md-4">Rec709Luminance</dt><dd class="col-md-8"> 0.212656R + 0.715158G + 0.072186B</dd>
4749 <dt class="col-md-4">Brightness</dt><dd class="col-md-8"> max(R', G', B')</dd>
4750 <dt class="col-md-4">Lightness</dt><dd class="col-md-8"> (min(R', G', B') + max(R', G', B')) / 2.0</dd>
4751 </dl>
4752 </div>
4753
4754 <p>Note that the above R,G,B values is the image's linear-RGB values, while
4755 R',G',B' are sRGB non-linear values. </p>
4756
4757 <p>These intensity methods are mathematical in nature and will use the
4758 current value in the images respective R,G,B channel regardless of
4759 what that is, or what colorspace the image is currently using.</p>
4760
4761 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
4762 <dl class="row">
4763 <dt class="col-md-4">Average</dt><dd class="col-md-8">(R' + G' + B') / 3.0</dd>
4764 <dt class="col-md-4">MS</dt><dd class="col-md-8">(R'^2 + G'^2 + B'^2) / 3.0</dd>
4765 <dt class="col-md-4">RMS</dt><dd class="col-md-8">sqrt( (R'^2 + G'^2 + B'^2) / 3.0 )</dd>
4766 </dl>
4767 </div>
4768
4769 <p>These methods are often used for other purposes, such as generating a
4770 grayscale difference image between two color images (using <a href="#compose"
4771 >-compose</a> '<code>Difference</code>' composition. </p>
4772
4773 <p> For example The 'MS' (Mean Squared) setting is good for minimizing color
4774 error comparisons. While... The method 'RMS' (Root Mean Squared) for
4775 example is appropriate for calculating color vector distance, from a color
4776 difference image. This is equivalent to the color only component of the <a
4777 href="#fuzz" >-fuzz</a> factor color compare setting. </p>
4778
4779 <p>See also <a href="#grayscale" >-grayscale</a> which applies one of the above
4780 grayscaling formula directly to an image without setting the <a
4781 href="#intensity" >-intensity</a> setting.</p>
4782
4783 <p>The <a href="#colorspace" >-colorspace gray</a> image conversion also uses
4784 the current intensity setting, but will always convert the image to the
4785 appropriate sRGB or linear-RGB colorspace before appling the above
4786 function.</p>
4787
4788 <p>To print a complete list of possible pixel intensity setting methods, use <a href="#list">-list intensity</a>.</p>
4789
4790 <p>Operators affected by the <a href="#intensity" >-intensity</a> setting include:</p>
4791
4792 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>-adaptive-blur
4793 -adaptive-sharpen
4794 -black-threshold
4795 -clut (when mapping greyscale CLUT image to alpha channel if set by -channels)
4796 -colors for gray colorspace
4797 -compose {LightenIntensity, DarkenIntensity, CopyOpacity, CopyBlack}
4798 -contrast-stretch
4799 -distort {ErodeIntensity, DilateIntensity}
4800 -normalize
4801 -random-threshold
4802 -range-threshold
4803 -selective-blur
4804 -shade
4805 -threshold
4806 -tint
4807 -white-threshold
4808 </code></pre>
4809
4810 <div style="mx-auto my-3 text-center">
4811 <h2><a class="anchor" id="intent"></a>-intent <var>type</var></h2>
4812 </div>
4813
4814 <p class="lead">Use this type of rendering intent when managing the image color.</p>
4815
4816 <p>Use this option to affect the color management operation of an image (see
4817 <a href="#profile">-profile</a>). Choose from these intents: <code>Absolute,
4818 Perceptual, Relative, Saturation</code>.</p>
4819
4820 <p>The default intent is Perceptual for the sRGB colorspace and undefined for the RGB and gray colorspaces.</p>
4821
4822 <p>To print a complete list of rendering intents, use <a href="#list">-list intent</a>.</p>
4823
4824 <div style="mx-auto my-3 text-center">
4825 <h2><a class="anchor" id="interlace"></a>-interlace <var>type</var></h2>
4826 </div>
4827
4828 <p class="lead">The type of interlacing scheme.</p>
4829
4830 <p>Choose from:</p>
4831
4832 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>none
4833 line
4834 plane
4835 partition
4836 JPEG
4837 GIF
4838 PNG
4839 </code></pre>
4840
4841 <p>This option is used to specify the type of interlacing scheme for raw image
4842 formats such as <code>RGB</code> or <code>YUV</code>.</p>
4843
4844 <p><code>None</code> means do not interlace (RGBRGBRGBRGBRGBRGB...),</p>
4845
4846 <p><code>Line</code> uses scanline interlacing (RRR...GGG...BBB...RRR...GGG...BBB...), and.</p>
4847
4848 <p><code>Plane</code> uses plane interlacing (RRRRRR...GGGGGG...BBBBBB...).</p>
4849
4850 <p><code>Partition</code> is like plane except the different planes are saved to
4851 individual files (e.g. image.R, image.G, and image.B).</p>
4852
4853 <p>Use <code>Line</code> or <code>Plane</code> to create an <code>interlaced
4854 PNG</code> or <code>GIF</code> or <code>progressive JPEG</code> image.</p>
4855
4856 <p>To print a complete list of interlacing schemes, use <a href="#list">-list
4857 interlace</a>.</p>
4858
4859
4860 <div style="mx-auto my-3 text-center">
4861 <h2><a class="anchor" id="interline-spacing"></a>-interline-spacing <var>value</var></h2>
4862 </div>
4863
4864 <p class="lead">The space between two text lines.</p>
4865
4866 <div style="mx-auto my-3 text-center">
4867 <h2><a class="anchor" id="interpolate"></a>-interpolate <var>type</var></h2>
4868 </div>
4869
4870 <p class="lead">Set the pixel color interpolation method to use when looking up a color based on a floating point or real value.</p>
4871
4872 <p>When looking up the color of a pixel using a non-integer floating point
4873 value, you typically fall in between the pixel colors defined by the source
4874 image. This setting determines how the color is determined from the colors of
4875 the pixels surrounding that point. That is how to determine the color of a
4876 point that falls between two, or even four different colored pixels. </p>
4877
4878 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
4879 <dl class="row">
4880 <dt class="col-md-4">average</dt>
4881 <dd class="col-md-8">The average color of the surrounding four pixels</dd>
4882 <dt class="col-md-4">average4</dt>
4883 <dd class="col-md-8">The average color of the surrounding four pixels</dd>
4884 <dt class="col-md-4">average9</dt>
4885 <dd class="col-md-8">The average color of the surrounding nine pixels</dd>
4886 <dt class="col-md-4">average16</dt>
4887 <dd class="col-md-8">The average color of the surrounding sixteen pixels</dd>
4888 <dt class="col-md-4">background</dt>
4889 <dd class="col-md-8">&nbsp;</dd>
4890 <dt class="col-md-4">bilinear</dt>
4891 <dd class="col-md-8">A double linear interpolation of pixels (the default)</dd>
4892 <dt class="col-md-4">blend</dt>
4893 <dd class="col-md-8">&nbsp;</dd>
4894 <dt class="col-md-4">catrom</dt>
4895 <dd class="col-md-8">Fitted bicubic-spines of surrounding 16 pixels</dd>
4896 <dt class="col-md-4">integer</dt>
4897 <dd class="col-md-8">The color of the top-left pixel (floor function)</dd>
4898 <dt class="col-md-4">mesh</dt>
4899 <dd class="col-md-8">Divide area into two flat triangular interpolations</dd>
4900 <dt class="col-md-4">nearest-neighbor</dt>
4901 <dd class="col-md-8">The nearest pixel to the lookup point (rounded function)</dd>
4902 <dt class="col-md-4">spline</dt>
4903 <dd class="col-md-8">Direct spline curves (colors are blurred)</dd>
4904 </dl>
4905 </div>
4906
4907 <p>This most important for distortion operators such as <a href="#distort"
4908 >-distort</a>, <a href="#implode" >-implode</a>, <a href="#transform"
4909 >-transform</a> and <a href="#fx" >-fx</a>. </p>
4910
4911 <p>To print a complete list of interpolation methods, use <a href="#list">-list interpolate</a>.</p>
4912
4913 <p>See also <a href="#virtual-pixel" >-virtual-pixel</a>, for control of the
4914 lookup for positions outside the boundaries of the image. </p>
4915
4916 <div style="mx-auto my-3 text-center">
4917 <h2><a class="anchor" id="interpolative-resize"></a>-interpolative-resize <var>geometry</var></h2>
4918 </div>
4919
4920 <p class="lead">Resize with interpolation. See the <a href="#interpolate">-interpolate</a> setting.</p>
4921
4922 <div style="mx-auto my-3 text-center">
4923 <h2><a class="anchor" id="interword-spacing"></a>-interword-spacing <var>value</var></h2>
4924 </div>
4925
4926 <p class="lead">The space between two words.</p>
4927
4928 <div style="mx-auto my-3 text-center">
4929 <h2><a class="anchor" id="integral"></a>-integral</h2>
4930 </div>
4931
4932 <p class="lead">Calculate the sum of values (pixel values) in the image.</p>
4933
4934 <div style="mx-auto my-3 text-center">
4935 <h2><a class="anchor" id="kerning"></a>-kerning <var>value</var></h2>
4936 </div>
4937
4938 <p class="lead">The space between two letters.</p>
4939
4940 <div style="mx-auto my-3 text-center">
4941 <h2><a class="anchor" id="kmeans"></a>-kmeans <var>colors</var>{x<var>iterations</var>}{+<var>tolerance</var>}</h2>
4942 </div>
4943
4944 <p class="lead">Kmeans (iterative) color reduction (e.g. <code>-kmeans 5x300+0.0001</code>). Colors is the desired number of colors. Initial colors are found using color quantization. Iterations is the stopping number of iterations (default=300). Convergence is the stopping threshold on the color change between iterations (default=0.0001). Processing finishes, if either iterations or tolerance are reached. Use <code>-define kmeans:seed-colors=<var>color-list</var></code> to initialize the colors, where color-list is a semicolon delimited list of seed colors (e.g. <code>-define kmeans:seed-colors="red;sRGB(19,167,254);#00ffff</code>). A color list overrides the color quantization. A non-empty list of colors overrides the number of colors. Any unassigned initial colors are assigned random colors from the image.</p>
4945
4946 <div style="mx-auto my-3 text-center">
4947 <h2><a class="anchor" id="kuwahara"></a>-kuwahara <var>radius</var><br />-kuwahara <var>radius</var>{x<var>sigma</var>}</h2>
4948 </div>
4949
4950 <p class="lead">Edge preserving noise reduction filter.</p>
4951
4952 <p>The <var >radius</var> is more important than the <var >sigma</var>. If <var >sigma</var> is left off, it will be computed automatically from the <var >radius</var> as <var >sigma</var>=<var >radius</var>-0.5. The <var >sigma</var> provides a bit of additional smoothing control.</p>
4953
4954
4955 <div style="mx-auto my-3 text-center">
4956 <h2><a class="anchor" id="label"></a>-label <var>name</var></h2>
4957 </div>
4958
4959 <p class="lead">Assign a label to an image.</p>
4960
4961 <p>Use this option to assign a specific label to the image, as it is read in
4962 or created. You can use the <a href="#set" >-set</a> operation to re-assign
4963 a the labels of images already read in. Image formats such as TIFF, PNG,
4964 MIFF, supports saving the label information with the image.</p>
4965
4966 <p>When saving an image to a <var>PostScript</var> file, any label
4967 assigned to an image is used as a header string to print above the postscript
4968 image. </p>
4969
4970 <p>You can include the image filename, type, width, height, or other image
4971 attribute by embedding special format character. See <a href="../escape/index.html">Format and Print Image
4972 Properties</a> for details of the percent escape codes.</p>
4973
4974 <p>For example,</p>
4975
4976 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>-label "%m:%f %wx%h" bird.miff
4977 </code></pre>
4978
4979 <p>assigns an image label of <code>MIFF:bird.miff 512x480</code> to the
4980 "<code>bird.miff</code>" image and whose width is 512 and height is 480, as it
4981 is read in. If a <a href="#label">+label</a> option was used instead, any
4982 existing label present in the image would be used. You can remove all labels
4983 from an image by assigning the empty string. </p>
4984
4985 <p>A label is not drawn on the image, but is embedded in the image datastream
4986 via <var>Label</var> tag or similar mechanism. If you want the label to be
4987 visible on the image itself, use the <a href="#draw">-draw</a> option, or
4988 during the final processing in the creation of an image montage.</p>
4989
4990 <p>If the first character of <var>string</var> is <var>@</var>, the image label is read from a file titled by the
4991 remaining characters in the string. Labels in a file are literal, no embedded
4992 formatting characters are recognized.</p>
4993
4994
4995 <div style="mx-auto my-3 text-center">
4996 <h2><a class="anchor" id="lat"></a>-lat <var>width</var><br />-lat <var>width</var>x<var>height</var>{<var>+-</var>}<var>offset</var>{<var>%</var>}</h2>
4997 </div>
4998
4999 <p class="lead">Perform local adaptive threshold.</p>
5000
5001 <p>Adaptively threshold each pixel based on the value of pixels in a
5002 surrounding window. If the current pixel is lighter than this average plus
5003 the optional <code>offset</code>, then it is made white, otherwise it is made
5004 black. Small variations in pixel values such as found in scanned documents
5005 can be ignored if offset is positive. A negative offset will make it more
5006 sensitive to those small variations. </p>
5007
5008 <p>This is commonly used to threshold images with an uneven background. It is
5009 based on the assumption that average color of the small window is the
5010 the local background color, from which to separate the foreground color. </p>
5011
5012
5013 <div style="mx-auto my-3 text-center">
5014 <h2><a class="anchor" id="layers"></a>-layers <var>method</var></h2>
5015 </div>
5016
5017 <p class="lead">Handle multiple images forming a set of image layers or animation frames.</p>
5018
5019 <p>Perform various image operation methods to a ordered sequence of images
5020 which may represent either a set of overlaid 'image layers', a GIF disposal
5021 animation, or a fully-'coalesced' animation sequence. </p>
5022
5023 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
5024 <table class="table table-sm table-hover table-striped table-responsive">
5025 <tbody>
5026 <tr>
5027 <th style="width: 8%">Method</th>
5028 <th>Description</th>
5029 </tr>
5030
5031 <tr>
5032 <td>compare-any</td>
5033 <td>Crop the second and later frames to the smallest rectangle
5034 that contains all the differences between the two images. No GIF <a
5035 href="#dispose" >-dispose</a> methods are taken into account. </td>
5036 </tr>
5037
5038 <tr><td></td><td>This exactly the same as the <a href="#deconstruct"
5039 >-deconstruct</a> operator, and does not preserve animations normal
5040 working, especially when animation used layer disposal methods such as
5041 '<code>Previous</code>' or '<code>Background</code>'. </td>
5042 </tr>
5043
5044 <tr>
5045 <td>compare-clear</td>
5046 <td>As '<code>compare-any</code>' but crop to the bounds of any
5047 opaque pixels which become transparent in the second frame. That is the
5048 smallest image needed to mask or erase pixels for the next frame. </td>
5049 </tr>
5050
5051 <tr>
5052 <td>compare-overlay</td>
5053 <td>As '<code>compare-any</code>' but crop to pixels that add
5054 extra color to the next image, as a result of overlaying color pixels.
5055 That is the smallest single overlaid image to add or change colors. </td>
5056 </tr>
5057
5058 <tr><td></td><td>This can be used with the <a href="#compose" >-compose</a> alpha
5059 composition method '<code>change-mask</code>', to reduce the image to
5060 just the pixels that need to be overlaid. </td>
5061 </tr>
5062
5063 <tr>
5064 <td>coalesce</td>
5065 <td>Equivalent to a call to the <a href="#coalesce"
5066 >-coalesce</a> operator. Apply the layer disposal methods set in the
5067 current image sequence to form a fully defined animation sequence, as
5068 it should be displayed. Effectively converting a GIF animation into a
5069 'film strip'-like animation. </td>
5070 </tr>
5071
5072 <tr>
5073 <td>composite</td>
5074 <td>Alpha Composition of two image lists, separated by a
5075 "<code>null:</code>" image, with the destination image list first, and
5076 the source images last. An image from each list are composited
5077 together until one list is finished. The separator image and source
5078 image lists are removed. </td>
5079 </tr>
5080
5081
5082 <tr><td></td>
5083 <td>The <a href="#geometry" >-geometry</a> offset is adjusted according
5084 to <a href="#gravity" >-gravity</a> in accordance of the virtual
5085 canvas size of the first image in each list. Unlike a normal <a
5086 href="#composite" >-composite</a> operation, the canvas offset is also
5087 added to the final composite positioning of each image. </td> </tr>
5088
5089 <tr><td></td>
5090 <td>If one of the image lists only contains one image, that image is
5091 applied to all the images in the other image list, regardless of which
5092 list it is. In this case it is the image meta-data of the list which
5093 preserved. </td>
5094 </tr>
5095
5096
5097 <tr>
5098 <td>dispose</td>
5099 <td>This like '<code>coalesce</code>' but shows the look of
5100 the animation after the layer disposal method has been applied, before
5101 the next sub-frame image is overlaid. That is the 'dispose' image that
5102 results from the application of the GIF <a href="#dispose"
5103 >-dispose</a> method. This allows you to check what
5104 is going wrong with a particular animation you may be developing.
5105 </td>
5106 </tr>
5107
5108 <tr>
5109 <td>flatten</td>
5110 <td>Create a canvas the size of the first images virtual
5111 canvas using the current <a href="#background" >-background</a> color,
5112 and <a href="#compose" >-compose</a> each image in turn onto that
5113 canvas. Images falling outside that canvas is clipped. Final
5114 image will have a zero virtual canvas offset. </td>
5115 </tr>
5116
5117 <tr><td></td>
5118 <td>This usually used as one of the final 'image layering' operations
5119 overlaying all the prepared image layers into a final image. </td>
5120 </tr>
5121
5122 <tr><td></td>
5123 <td>For a single image this method can also be used to fillout a virtual
5124 canvas with real pixels, or to underlay an opaque color to remove
5125 transparency from an image.</td>
5126 </tr>
5127
5128
5129 <tr>
5130 <td>merge</td>
5131 <td>As 'flatten' method but merging all the given image
5132 layers to create a new layer image just large enough to hold all the
5133 image without clipping or extra space. The new images virtual offset
5134 will preserve the position of the new layer, even if this offset is
5135 negative. The virtual canvas size of the first image is preserved.
5136 </td>
5137 </tr>
5138
5139 <tr><td></td><td>Caution is advised when handling image layers with
5140 negative offsets as few image file formats handle them correctly.
5141 Following this operation method with <a href="#repage" >+repage</a>
5142 will remove the layer offset, and create an image in which all the
5143 overlaid image positions relative to each other is preserved, though
5144 not necessarily exactly where you specified them.
5145 </td>
5146 </tr>
5147
5148 <tr><td></td><td>See also 'trim-bounds' below which is closely related but
5149 without doing the'flatten' to merge the images together. </td>
5150 </tr>
5151
5152 <tr>
5153 <td>mosaic</td>
5154 <td>As 'flatten' method but expanding the initial canvas size
5155 of the first image in a positive direction only so as to hold all the
5156 image layers. However as a virtual canvas is 'locked' to the origin,
5157 by its own definition, image layers with a negative offsets will still
5158 become clipped by the top and left edges. See 'merge' or 'trim-bounds'
5159 if this could be a problem. </td>
5160
5161 </tr>
5162
5163 <tr><td></td><td>This method is commonly used to layout individual image
5164 using various offset but without knowing the final canvas size. The
5165 resulting image will, like 'flatten' not have any virtual offset, so
5166 can be saved to any image file format. </td>
5167 </tr>
5168
5169
5170 <tr>
5171 <td>optimize</td>
5172 <td>Optimize a coalesced animation, into GIF animation using
5173 a number of general techniques. This currently a short cut to
5174 apply both the '<code>optimize-frame</code>', and
5175 '<code>optimize-transparency</code>' methods but may be expanded to
5176 include other optimization methods as they are developed. </td>
5177 </tr>
5178
5179 <tr>
5180 <td>optimize-frame</td>
5181 <td>Optimize a coalesced animation, into GIF animation by
5182 reducing the number of pixels per frame as much as possible by
5183 attempting to pick the best layer disposal method to use, while ensuring
5184 the result will continue to animate properly. </td>
5185 </tr>
5186
5187 <tr><td></td><td> There is no guarantee that the best optimization is found.
5188 But then no reasonably fast GIF optimization algorithm can do this.
5189 However this does seem to do better than most other GIF frame
5190 optimizers seen. </td>
5191 </tr>
5192
5193 <tr>
5194 <td>optimize-plus</td>
5195 <td>As '<code>optimize-frame</code>' but attempt to improve the
5196 overall optimization by adding extra frames to the animation, without
5197 changing the final look or timing of the animation. The frames are
5198 added to attempt to separate the clearing of pixels from the
5199 overlaying of new additional pixels from one animation frame to the
5200 next. If this does not improve the optimization (for the next frame
5201 only), it will fall back to the results of the previous normal
5202 '<code>optimize-frame</code>' technique. </td>
5203 </tr>
5204
5205 <tr><td></td><td>There is the possibility that the change in the disposal
5206 style will result in a worsening in the optimization of later frames,
5207 though this is unlikely. In other words there no guarantee that it is
5208 better than the normal '<code>optimize-frame</code>' technique. For some
5209 animations however you can get a vast improvement in the final
5210 animation size. </td>
5211 </tr>
5212
5213 <tr>
5214 <td>optimize-transparency</td>
5215 <td>Given a GIF animation, replace any pixel in the sub-frame
5216 overlay images with transparency, if it does not change the resulting
5217 animation by more than the current <a href="#fuzz" >-fuzz</a> factor.
5218 </td>
5219 </tr>
5220
5221 <tr><td></td><td>This should allow a existing frame optimized GIF animation
5222 to compress into a smaller file size due to larger areas of one
5223 (transparent) color rather than a pattern of multiple colors repeating
5224 the current disposed image of the last frame. </td>
5225 </tr>
5226
5227 <tr>
5228 <td>remove-dups</td>
5229 <td>Remove (and merge time delays) of duplicate consecutive
5230 images, so as to simplify layer overlays of coalesced animations.
5231 </td>
5232 </tr>
5233
5234 <tr><td></td><td>Usually this a result of using a constant time delay
5235 across the whole animation, or after a larger animation was split into
5236 smaller sub-animations. The duplicate frames could also have been
5237 used as part of some frame optimization methods. </td>
5238 </tr>
5239
5240 <tr>
5241 <td>remove-zero</td>
5242 <td>Remove any image with a zero time delay, unless ALL the
5243 images have a zero time delay (and is not a proper timed animation, a
5244 warning is then issued). </td>
5245 </tr>
5246
5247 <tr><td></td><td>In a GIF animation, such images are usually frames which
5248 provide partial intermediary updates between the frames that are
5249 actually displayed to users. These frames are usually added for
5250 improved frame optimization in GIF animations. </td>
5251 </tr>
5252
5253 <tr>
5254 <td>trim-bounds</td>
5255 <td>Find the bounds of all the images in the current
5256 image sequence, then adjust the offsets so all images are contained on
5257 a minimal positive canvas. None of the image data is modified or
5258 merged, only the individual image virtual canvas size and offset.
5259 All the images is given the same canvas size, and will have
5260 a positive offset, but will remain in the same position relative to
5261 each other. As a result of the minimal canvas size at least one image
5262 will touch every edge of that canvas. The image data touching those
5263 edges however may be transparent. </td>
5264 </tr>
5265
5266 <tr><td></td><td>The result is much like if you used 'merge' followed by a
5267 <a href="#repage" >+repage</a> option, except that all the images
5268 have been kept separate. If 'flatten' is used after using
5269 'trim-bounds' you will get the same result. </td>
5270 </tr>
5271
5272 </tbody>
5273 </table>
5274 </div>
5275
5276 <p>To print a complete list of layer types, use <a href="#list">-list layers</a>.</p>
5277
5278 <p>The operators <a href="#coalesce" >-coalesce</a>, <a href="#deconstruct"
5279 >-deconstruct</a>, <a href="#flatten" >-flatten</a>, and <a href="#mosaic"
5280 >-mosaic</a> are only aliases for the above methods and may be deprecated in
5281 the future. Also see <a href="#page" >-page</a>, <a href="#repage"
5282 >-repage</a> operators, the <a href="#compose" >-compose</a> setting, and the
5283 GIF <a href="#dispose" >-dispose</a> and <a href="#delay" >-delay</a>
5284 settings. </p>
5285
5286
5287 <div style="mx-auto my-3 text-center">
5288 <h2><a class="anchor" id="level"></a>-level <var>black_point</var>{,<var>white_point</var>}{<var>%</var>}{,<var>gamma</var>}</h2>
5289 </div>
5290
5291 <p class="lead">Adjust the level of image channels.</p>
5292
5293 <p>Given one, two or three values delimited with commas: black-point,
5294 white-point, gamma (for example: 10,250,1.0 or 2%,98%,0.5). The black and
5295 white points range from 0 to <var>QuantumRange</var>, or from 0 to
5296 100%; if the white point is omitted it is set to (<var>QuantumRange</var> - black_point), so as to center contrast changes.
5297 If a <code>%</code> sign is present anywhere in the string, both black and white
5298 points are percentages of the full color range. Gamma will do a <a
5299 href="#gamma">-gamma</a> adjustment of the values. If it is omitted, the
5300 default of 1.0 (no gamma correction) is assumed.</p>
5301
5302 <p>In normal usage (<code>-level</code>) the image values are stretched so that
5303 the given '<code>black_point</code>' value in the original image is set to zero
5304 (or black), while the given '<code>white_point</code>' value is set to <var>QuantumRange</var> (or white). This provides you with direct
5305 contrast adjustments to the image. The '<code>gamma</code>' of the resulting
5306 image will then be adjusted. </p>
5307
5308 <p>From ImageMagick v6.4.1-9 using the plus form of the operator
5309 (<code>+level</code>) or adding the special '!' flag anywhere in the argument
5310 list, will cause the operator to do the reverse of the level adjustment. That
5311 is a zero, or <var>QuantumRange</var> value (black, and white, resp.)
5312 in the original image, is adjusted to the given level values, allowing you to
5313 de-contrast, or compress the channel values within the image. The
5314 '<code>gamma</code>' is adjusted before the level adjustment to de-contrast the
5315 image is made. </p>
5316
5317 <p>Only the channels defined by the current <a href="#channel">-channel</a>
5318 setting are adjusted (defaults to RGB color channels only), allowing you to
5319 limit the effect of this operator. </p>
5320
5321 <p>Please note that the transparency channel is treated as 'matte'
5322 values (0 is opaque) and not as 'alpha' values (0 is transparent).</p>
5323
5324
5325 <div style="mx-auto my-3 text-center">
5326 <h2><a class="anchor" id="level-colors"></a>-level-colors {<var>black_color</var>}{,}{<var>white_color</var>}</h2>
5327 </div>
5328
5329 <p class="lead">Adjust the level of an image using the provided dash separated colors.</p>
5330
5331 <p>This function is exactly like <a href="#level">-level</a>, except that the
5332 value for each color channel is determined by the
5333 '<code>black_color</code>' and '<code>white_color</code>' colors given (as
5334 described under the <a href="#fill">-fill</a> option). </p>
5335
5336 <p>This effectively means the colors provided to <code>-level-colors</code>
5337 is mapped to become 'black' and 'white' respectively, with all the other
5338 colors linearly adjusted (or clipped) to match that change. Each channel is
5339 adjusted separately using the channel values of the colors specified. </p>
5340
5341 <p>On the other hand the plus form of the operator (<code>+level-colors</code>)
5342 will map the image color 'black' and 'white' to the given colors
5343 respectively, resulting in a gradient (de-contrasting) tint of the image to
5344 those colors. This can also be used to convert a plain grayscale image into a
5345 one using the gradient of colors specified. </p>
5346
5347 <p>By supplying a single color with a comma separator either before or after
5348 that color, will just replace the respective 'black' or 'white' point
5349 respectively. But if no comma separator is provided, the given color is
5350 used for both the black and white color points, making the operator either
5351 threshold the images around that color (- form) or set all colors to that
5352 color (+ form). </p>
5353
5354
5355 <div style="mx-auto my-3 text-center">
5356 <h2><a class="anchor" id="limit"></a>-limit <var>type value</var></h2>
5357 </div>
5358
5359 <p class="lead">Set the pixel cache resource limit.</p>
5360
5361 <p>Choose from: <code>width</code>, <code>height</code>, <code>area</code>, <code>memory</code>, <code>map</code>, <code>disk</code>, <code>file</code>, <code>thread</code>, <code>throttle</code>, or <code>time</code>.</p>
5362
5363 <p>The value for <code>file</code> is in number of files. The other limits are
5364 in bytes. Define arguments for the memory, map, area, and disk resource limits
5365 with SI prefixes (.e.g 100MB).</p>
5366
5367 <p>By default the limits are 768 files, 3GB of image area, 1.5GiB memory, 3GiB
5368 memory map, and 18.45EB of disk. These limits are adjusted relative to the
5369 available resources on your computer if this information is available. When
5370 any limit is reached, ImageMagick fails in some fashion but attempts to take
5371 compensating actions, if possible. For example, the following limits
5372 memory:</p>
5373
5374 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>-limit memory 32MiB -limit map 64MiB
5375 </code></pre>
5376
5377 <p>Use <a href="#list">-list resource</a> to list the current limits. For example, our system shows these limits:</p>
5378
5379 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><samp>$ magick identify -list resource
5380 Resource limits:
5381 Width: 100MP
5382 Height: 100MP
5383 Area: 25.181GB
5384 Memory: 11.726GiB
5385 Map: 23.452GiB
5386 Disk: unlimited
5387 File: 768
5388 Thread: 12
5389 Throttle: 0
5390 Time: unlimited
5391 </samp></pre>
5392
5393 <p>Requests for pixel storage to keep intermediate images are satisfied by one
5394 of three resource categories: in-memory pool, memory-mapped files pool, and
5395 disk pool (in that order) depending on the <a href="#limit">-limit</a> settings
5396 and whether the system honors a resource request. If the total size of
5397 allocated pixel storage in the given pool reaches the corresponding limit, the
5398 request is passed to the next pool. Additionally, requests that exceed the
5399 <code>area</code> limit automagically are allocated on disk.</p>
5400
5401 <p>To illustrate how ImageMagick utilizes resource limits, consider a typical
5402 image resource request. First, ImageMagick tries to allocate the pixels in
5403 memory. The request might be denied if the resource request exceeds the
5404 <code>memory</code> limit or if the system does not honor the request. If
5405 a memory request is not honored, the pixels are allocated to disk and the file
5406 is memory-mapped. However, if the allocation request exceeds the
5407 <code>map</code> limit, the resource allocation goes to disk. In all cases, if
5408 the resource request exceeds the <code>area</code> limit, the pixels are
5409 automagically cached to disk. If the disk has a hard limit, the program
5410 fails.</p>
5411
5412 <p>In most cases you simply do not need to concern yourself with resource
5413 limits. ImageMagick chooses reasonable defaults and most images do not tax
5414 your computer resources. Where limits do come in handy is when you process
5415 images that are large or on shared systems where ImageMagick can consume all
5416 or most of the available memory. In this case, the ImageMagick workflow slows
5417 other processes or, in extreme cases, brings the system to a halt. Under
5418 these circumstances, setting limits give some assurances that the ImageMagick
5419 workflow will not interfere with other concurrent uses of the computer. For
5420 example, assume you have a web interface that processes images uploaded from
5421 the Internet. To assure ImageMagick does not exceed 10MiB of memory you can
5422 simply set the area limit to 10MiB:</p>
5423
5424 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>-limit area 10MB
5425 </code></pre>
5426
5427 <p>Now whenever a large image is processed, the pixels are automagically
5428 cached to disk instead of memory. This of course implies that large images
5429 typically process very slowly, simply because pixel processing in memory can
5430 be an order of magnitude faster than on disk. Because your web site users
5431 might inadvertently upload a huge image to process, you should set a disk
5432 limit as well:</p>
5433
5434 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>-limit area 10MB -limit disk 500MB
5435 </code></pre>
5436
5437 <p>Here ImageMagick stops processing if an image requires more than 500MB of disk storage.</p>
5438
5439 <p>In addition to command-line resource limit option, resources can be set
5440 with <a href="../resources/index.html#environment" >environment variables</a>. Set the
5441 environment variables <code>MAGICK_AREA_LIMIT</code>,
5442 <code>MAGICK_DISK_LIMIT</code>, <code>MAGICK_FILE_LIMIT</code>,
5443 <code>MAGICK_MEMORY_LIMIT</code>, <code>MAGICK_MAP_LIMIT</code>,
5444 <code>MAGICK_THREAD_LIMIT</code>, <code>MAGICK_TIME_LIMIT</code> for limits of
5445 image area, disk space, open files, heap memory, memory map, number of threads
5446 of execution, and maximum elapsed time in seconds respectively.</p>
5447
5448 <p>Note, you can restrict limits relative to any <a href="../security-policy/index.html">security policies</a>, but you cannot relax them.</p>
5449
5450 <p> Inquisitive users can try adding <a href="#debug">-debug cache</a> to
5451 their commands and then scouring the generated output for references to the
5452 pixel cache, in order to determine how the pixel cache was allocated and how
5453 resources were consumed. Advanced Linux/Linux users can pipe that output
5454 through <code>grep memory|open|destroy|disk</code> for more readable sifting.
5455 </p>
5456
5457 <p>For more about ImageMagick's use of resources, see the section <b>Cache
5458 Storage and Resource Requirements</b> on the <a href="../architecture/index.html#cache">Architecture</a> page. </p>
5459
5460 <div style="mx-auto my-3 text-center">
5461 <h2><a class="anchor" id="linear-stretch"></a>-linear-stretch <var>black-point</var><br />-linear-stretch <var>black-point</var>{x<var>white-point</var>}{<var>%</var>}</h2>
5462 </div>
5463
5464 <p class="lead">Linear with saturation stretch.</p>
5465
5466 <p>This is very similar to <a href="#contrast-stretch" >-contrast-stretch</a>,
5467 and uses a 'histogram bin' to determine the range of color values that needs to
5468 be stretched. However it then stretches those colors using the <a
5469 href="#level" >-level</a> operator.</p>
5470
5471 <p>As such while the initial determination may have 'binning' round off
5472 effects, the image colors are stretched mathematically, rather than using the
5473 histogram bins. This makes the operator more accurate. </p>
5474
5475 <p>note however that a <a href="#linear-stretch" >-linear-stretch</a> of
5476 '<code>0</code>' does nothing, while a value of '<code>1</code>' does a near
5477 perfect stretch of the color range. </p>
5478
5479 <p>See also <a href="#auto-level" >-auto-level</a> for a 'perfect'
5480 normalization of mathematical images. </p>
5481
5482 <p>This operator is under review for re-development. </p>
5483
5484
5485 <div style="mx-auto my-3 text-center">
5486 <h2><a class="anchor" id="linewidth"></a>-linewidth</h2>
5487 </div>
5488
5489 <p class="lead">The line width for subsequent draw operations.</p>
5490
5491 <div style="mx-auto my-3 text-center">
5492 <h2><a class="anchor" id="liquid-rescale"></a>-liquid-rescale <var>geometry</var></h2>
5493 </div>
5494
5495 <p class="lead">Rescale image with seam-carving.</p>
5496
5497 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument.</p>
5498
5499 <div style="mx-auto my-3 text-center">
5500 <h2><a class="anchor" id="list"></a>-list <var>type</var></h2>
5501 </div>
5502
5503 <p class="lead">Print a list of supported arguments for various options or settings. Choose from these list types:</p>
5504
5505 <pre class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
5506 Align
5507 Alpha
5508 Boolean
5509 Cache
5510 Channel
5511 Class
5512 ClipPath
5513 Coder
5514 Color
5515 Colorspace
5516 Command
5517 Complex
5518 Compose
5519 Compress
5520 Configure
5521 DataType
5522 Debug
5523 Decoration
5524 Delegate
5525 Direction
5526 Dispose
5527 Distort
5528 Dither
5529 Endian
5530 Evaluate
5531 FillRule
5532 Filter
5533 Font
5534 Format
5535 Function
5536 Gravity
5537 Intensity
5538 Intent
5539 Interlace
5540 Interpolate
5541 Kernel
5542 Layers
5543 LineCap
5544 LineJoin
5545 List
5546 Locale
5547 LogEvent
5548 Log
5549 Magic
5550 Method
5551 Metric
5552 Mime
5553 Mode
5554 Morphology
5555 Module
5556 Noise
5557 Orientation
5558 PixelIntensity
5559 Policy
5560 PolicyDomain
5561 PolicyRights
5562 Preview
5563 Primitive
5564 QuantumFormat
5565 Resource
5566 SparseColor
5567 Statistic
5568 Storage
5569 Stretch
5570 Style
5571 Threshold
5572 Type
5573 Units
5574 Validate
5575 VirtualPixel
5576 </pre>
5577
5578 <p>These lists vary depending on your version of ImageMagick. Use "<code>-list
5579 list</code>" to get a complete listing of all the "<code>-list</code>" arguments
5580 available:</p>
5581
5582 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick identify -list list
5583 </samp></pre>
5584
5585 <div style="mx-auto my-3 text-center">
5586 <h2><a class="anchor" id="log"></a>-log <var>string</var></h2>
5587 </div>
5588
5589 <p class="lead">Specify format for debug log.</p>
5590
5591 <p>This option specifies the format for the log printed when the <a
5592 href="#debug">-debug</a> option is active.</p>
5593
5594 <p>You can display the following components by embedding special format
5595 characters:</p>
5596
5597 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
5598 <dl class="row">
5599 <dt class="col-md-4">%d</dt><dd class="col-md-8">domain</dd>
5600 <dt class="col-md-4">%e</dt><dd class="col-md-8">event</dd>
5601 <dt class="col-md-4">%f</dt><dd class="col-md-8">function</dd>
5602 <dt class="col-md-4">%l</dt><dd class="col-md-8">line</dd>
5603 <dt class="col-md-4">%m</dt><dd class="col-md-8">module</dd>
5604 <dt class="col-md-4">%p</dt><dd class="col-md-8">process ID</dd>
5605 <dt class="col-md-4">%r</dt><dd class="col-md-8">real CPU time</dd>
5606 <dt class="col-md-4">%t</dt><dd class="col-md-8">wall clock time</dd>
5607 <dt class="col-md-4">%u</dt><dd class="col-md-8">user CPU time</dd>
5608 <dt class="col-md-4">%%</dt><dd class="col-md-8">percent sign</dd>
5609 <dt class="col-md-4">\n</dt><dd class="col-md-8">newline</dd>
5610 <dt class="col-md-4">\r</dt><dd class="col-md-8">carriage return</dd>
5611 </dl>
5612 </div>
5613
5614 <p>For example:</p>
5615
5616 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick -debug coder -log "%u %m:%l %e" in.gif out.png
5617 </samp></pre>
5618
5619 <p>The default behavior is to print all of the components.</p>
5620
5621 <div style="mx-auto my-3 text-center">
5622 <h2><a class="anchor" id="loop"></a>-loop <var>iterations</var></h2>
5623 </div>
5624
5625 <p class="lead">Add Netscape loop extension to your GIF animation.</p>
5626
5627 <p>Set iterations to zero to repeat the animation an infinite number of times,
5628 otherwise the animation repeats itself up to <var>iterations</var>
5629 times.</p>
5630
5631 <div style="mx-auto my-3 text-center">
5632 <h2><a class="anchor" id="lowlight-color"></a>-lowlight-color <var>color</var></h2>
5633 </div>
5634
5635 <p class="lead">When comparing images, de-emphasize pixel differences with this color.</p>
5636
5637 <div style="mx-auto my-3 text-center">
5638 <h2><a class="anchor" id="magnify"></a>-magnify</h2>
5639 </div>
5640
5641 <p class="lead">Double or triple the size of the image with pixel art scaling. Specify an alternative scaling method with <code>-define magnify:method=<var>method</var></code> Choose from these methods: <code>eagle2X, eagle3X, eagle3XB, epb2X, fish2X, hq2X, scale2X, scale3X, xbr2X</code>. The default is scale2X.</p>
5642
5643
5644 <div style="mx-auto my-3 text-center">
5645 <h2><a class="anchor" id="map"></a>-map <var>type</var></h2>
5646 </div>
5647
5648 <p class="lead">Display image using this <var>type</var>.</p>
5649
5650 <p>Choose from these <var>Standard Colormap</var> types:</p>
5651
5652 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>best
5653 default
5654 gray
5655 red
5656 green
5657 blue
5658 </code></pre>
5659
5660 <p>The <var>X server</var> must support the <var>Standard
5661 Colormap</var> you choose, otherwise an error occurs. Use <code>list</code> as
5662 the type and <code>display</code> searches the list of colormap types in
5663 <code>top-to-bottom</code> order until one is located. See <var>xstdcmap(1)</var> for one way of creating Standard Colormaps.</p>
5664
5665
5666 <div style="mx-auto my-3 text-center">
5667 <h2><a class="anchor" id="map_stream_"></a>-map <var>components</var></h2>
5668 </div>
5669
5670 <p class="lead">Pixel map.</p>
5671
5672 <p>Here are the valid components of a map:</p>
5673
5674 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
5675 <dl class="row">
5676 <dt class="col-md-4">r</dt><dd class="col-md-8"> red pixel component</dd>
5677 <dt class="col-md-4">g</dt><dd class="col-md-8"> green pixel component</dd>
5678 <dt class="col-md-4">b</dt><dd class="col-md-8"> blue pixel component</dd>
5679 <dt class="col-md-4">a</dt><dd class="col-md-8"> alpha pixel component (0 is transparent)</dd>
5680 <dt class="col-md-4">o</dt><dd class="col-md-8"> opacity pixel component (0 is opaque)</dd>
5681 <dt class="col-md-4">i</dt><dd class="col-md-8"> grayscale intensity pixel component</dd>
5682 <dt class="col-md-4">c</dt><dd class="col-md-8"> cyan pixel component</dd>
5683 <dt class="col-md-4">m</dt><dd class="col-md-8"> magenta pixel component</dd>
5684 <dt class="col-md-4">y</dt><dd class="col-md-8"> yellow pixel component</dd>
5685 <dt class="col-md-4">k</dt><dd class="col-md-8"> black pixel component</dd>
5686 <dt class="col-md-4">p</dt><dd class="col-md-8"> pad component (always 0)</dd>
5687 </dl>
5688 </div>
5689
5690 <p>You can specify as many of these components as needed in any order (e.g.
5691 bgr). The components can repeat as well (e.g. rgbr).</p>
5692
5693
5694 <div style="mx-auto my-3 text-center">
5695 <h2><a class="anchor" id="mattecolor"></a>-mattecolor <var>color</var></h2>
5696 </div>
5697
5698 <p class="lead">Specify the color to be used with the <a href="#frame">-frame</a> option.</p>
5699
5700 <p>The color is specified using the format described under the <a href="#fill">-fill</a> option.</p>
5701
5702 <p>The default matte color is <code>#BDBDBD</code>, <span
5703 style="background-color: #bdbdbd;">this shade of gray</span>.</p>
5704
5705 <div style="mx-auto my-3 text-center">
5706 <h2><a class="anchor" id="maximum"></a>-maximum</h2>
5707 </div>
5708
5709 <p class="lead">Return the maximum intensity of an image sequence.</p>
5710
5711 <p>Select the 'maximum' value from all the surrounding pixels. </p>
5712
5713 <p>This is legacy option from the <a href="#statistic" >method</a> of the same
5714 name. </p>
5715
5716 <div style="mx-auto my-3 text-center">
5717 <h2><a class="anchor" id="median"></a>-median <var>geometry</var></h2>
5718 </div>
5719
5720 <p class="lead">Apply a median filter to the image.</p>
5721
5722 <p>Select the 'middle' value from all the surrounding pixels. </p>
5723
5724 <p>This is legacy option from the <a href="#statistic" >method</a> of the same
5725 name. </p>
5726
5727 <div style="mx-auto my-3 text-center">
5728 <h2><a class="anchor" id="mean-shift"></a>-mean-shift <var>width</var>x<var>height</var>{<var>+distance</var>&#123%}</h2>
5729 </div>
5730
5731 <p class="lead">Image noise removal and color reduction/segmentation (e.g. -mean-shift 7x7+10%).</p>
5732
5733 <p><var>width</var>x<var>height</var> is the window size and <var>distance</var> is the color distance measured in the range 0 to 1 or 0 to 100%</p>
5734
5735 <p>The mean shift algorithm is iterative and thus slower the larger the window size. For each pixel, it gets all the pixels in the window centered at the pixel and excludes those that are outside the <var>radius=sqrt((width-1)(height-1)/4)</var> surrounding the pixel. From those pixels, it finds which of them are within the specified squared color distance from the current mean. It then computes a new x,y centroid from those coordinates and a new mean. This new x,y centroid is used as the center for a new window. This process is iterated until it converges and the final mean is then used to replace the original pixel value. It repeats this process for the next pixel, etc, until it processes all pixels in the image. Results are better when using other colorspaces rather than RGB. Recommend YIQ, YUV or YCbCr, which seem to give equivalent results.</p>
5736
5737 <div style="mx-auto my-3 text-center">
5738 <h2><a class="anchor" id="metric"></a>-metric <var>type</var></h2>
5739 </div>
5740
5741 <p class="lead">Output to STDERR a measure of the differences between images according to the <var>type</var> given metric.</p>
5742
5743 <p>Choose from:</p>
5744
5745 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
5746 <dl class="row">
5747 <dt class="col-md-4">AE</dt><dd class="col-md-8"> the magnitude of pixel differences between two images (-fuzz affected)</dd>
5748 <dt class="col-md-4">DPC</dt><dd class="col-md-8"> discrete phase correlation</dd>
5749 <dt class="col-md-4">DSSIM</dt><dd class="col-md-8"> structural dissimilarity index</dd>
5750 <dt class="col-md-4">FUZZ</dt><dd class="col-md-8"> mean color distance</dd>
5751 <dt class="col-md-4">MAE</dt><dd class="col-md-8"> mean absolute error (normalized), average channel error distance</dd>
5752 <dt class="col-md-4">MEPP</dt><dd class="col-md-8"> mean error per pixel (normalized mean error, normalized peak error)</dd>
5753 <dt class="col-md-4">MSE</dt><dd class="col-md-8"> mean error squared, average of the channel error squared</dd>
5754 <dt class="col-md-4">NCC</dt><dd class="col-md-8"> normalized cross correlation</dd>
5755 <dt class="col-md-4">PAE</dt><dd class="col-md-8"> peak absolute (normalized peak absolute)</dd>
5756 <dt class="col-md-4">PDC</dt><dd class="col-md-8"> the total number of pixels whose values differ between two images (-fuzz affected)</dd>
5757 <dt class="col-md-4">PHASE</dt><dd class="col-md-8"> phase correlation</dd>
5758 <dt class="col-md-4">PHASH</dt><dd class="col-md-8"> perceptual hash for the sRGB and HCLp colorspaces. Specify an alternative colorspace with <code>-define phash:colorspaces=<var>colorspace,colorspace,...</var></code></dd>
5759 <dt class="col-md-4">PSNR</dt><dd class="col-md-8"> peak signal to noise ratio</dd>
5760 <dt class="col-md-4">RMSE</dt><dd class="col-md-8"> root mean squared (normalized root mean squared)</dd>
5761 <dt class="col-md-4">SSIM</dt><dd class="col-md-8"> structural similarity index</dd>
5762 </dl>
5763 </div>
5764
5765 <p>Control the '<code>AE</code>' (how much do pixels differ)) and '<code>PDC</code>' (how many pixels differ) with the <a href="#fuzz" >-fuzz</a> factor (ignore pixels which
5766 only changed by a small amount). Use '<code>PAE</code>' to find the
5767 size of the <a href="#fuzz" >-fuzz</a> factor needed to make all pixels
5768 'similar', while '<code>MAE</code>' determines the factor needed
5769 for about half the pixels to be similar. </p>
5770
5771 <p>The <code>MEPP</code> metric returns three different metrics
5772 ('<code>MAE</code>', '<code>MAE</code>' normalized, and '<code>PAE</code>'
5773 normalized) from a single comparison run. </p>
5774
5775 <p>The <code>SSIM</code> and <code>DSSIM</code> metrics respect these defines:
5776 <code>-define compare:ssim-radius</code>, <code>-define compare:ssim-sigma</code>,
5777 <code>-define compare:ssim-k1</code>, and <code>-define compare:ssim-k2</code>.</p>
5778
5779 <p>To print a complete list of metrics, use the <a href="#list">-list
5780 metric</a> option.</p>
5781
5782
5783 <div style="mx-auto my-3 text-center">
5784 <h2><a class="anchor" id="minimum"></a>-minimum</h2>
5785 </div>
5786
5787 <p class="lead">Return the minimum intensity of an image sequence.</p>
5788
5789 <p>Select the 'minimal' value from all the surrounding pixels. </p>
5790
5791 <p>This is legacy option from the <a href="#statistic" >method</a> of the same
5792 name. </p>
5793
5794
5795
5796 <div style="mx-auto my-3 text-center">
5797 <h2><a class="anchor" id="mode"></a>-mode <var>geometry</var></h2>
5798 </div>
5799
5800 <p class="lead">Make each pixel the \'predominant color\' of the neighborhood.'</p>
5801
5802 <div style="mx-auto my-3 text-center">
5803 <h2>-mode <var>value</var></h2>
5804 </div>
5805
5806 <p class="lead">Mode of operation.</p>
5807
5808 <p>Choose the <var>value</var> from these styles: <code>Frame,
5809 Unframe, or Concatenate</code></p>
5810
5811 <p>Use the <a href="#list" >-list</a> option with a '<code>Mode</code>' argument
5812 for a list of <a href="#mode" >-mode</a> arguments available in your
5813 ImageMagick installation.</p>
5814
5815
5816 <div style="mx-auto my-3 text-center">
5817 <h2><a class="anchor" id="modulate"></a>-modulate <var>brightness</var>[,<var>saturation</var>,<var>hue</var>]</h2>
5818 </div>
5819
5820 <p class="lead">Vary the <var>brightness</var>, <var>saturation</var>, and <var>hue</var> of an image.</p>
5821
5822 <p>The arguments are given as a percentages of variation. A value of 100 means
5823 no change, and any missing values are taken to mean 100.</p>
5824
5825 <p>The <var>brightness</var> is a multiplier of the overall
5826 brightness of the image, so 0 means pure black, 50 is half as bright, 200 is
5827 twice as bright. To invert its meaning <a href="#negate">-negate</a> the image
5828 before and after. </p>
5829
5830 <p>The <var>saturation</var> controls the amount of color in an
5831 image. For example, 0 produce a grayscale image, while a large value such as
5832 200 produce a very colorful, 'cartoonish' color.</p>
5833
5834 <p>The <var>hue</var> argument causes a "rotation" of the colors
5835 within the image by the amount specified. For example, 50 results in
5836 a counter-clockwise rotation of 90, mapping red shades to purple, and so on.
5837 A value of either 0 or 200 results in a complete 180 degree rotation of the
5838 image. Using a value of 300 is a 360 degree rotation resulting in no change to
5839 the original image. </p>
5840
5841 <p>For example, to increase the color brightness by 20% and decrease the color
5842 saturation by 10% and leave the hue unchanged, use <a
5843 href="#modulate">-modulate 120,90</a>.</p>
5844
5845 <p>Use <a href="#set">-set</a> attribute of '<code>option:modulate:colorspace</code>' to specify which colorspace to
5846 modulate. Choose from <code>HCL</code>, <code>HCLp</code>, <code>HSB</code>, <code>HSI</code>, <code>HSL</code> (the default), <code>HSV</code>, <code>HWB</code>, or <code>LCH</code> (LCHab). For example,</p>
5847
5848 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick image.png -set option:modulate:colorspace hsb -modulate 120,90 modulate.png
5849 </samp></pre>
5850
5851 <div style="mx-auto my-3 text-center">
5852 <h2><a class="anchor" id="moments"></a>-moments</h2>
5853 </div>
5854
5855 <p class="lead">Report image moments and perceptual hash.</p>
5856
5857
5858 <div style="mx-auto my-3 text-center">
5859 <h2><a class="anchor" id="monitor"></a>-monitor</h2>
5860 </div>
5861
5862 <p class="lead">Monitor progress.</p>
5863
5864
5865 <div style="mx-auto my-3 text-center">
5866 <h2><a class="anchor" id="monochrome"></a>-monochrome</h2>
5867 </div>
5868
5869 <p class="lead">Transform the image to black and white.</p>
5870
5871 <div style="mx-auto my-3 text-center">
5872 <h2><a class="anchor" id="morph"></a>-morph <var>frames</var></h2>
5873 </div>
5874
5875 <p class="lead">Morphs an image sequence.</p>
5876
5877 <p>Both the image pixels and size are linearly interpolated to give the
5878 appearance of a metamorphosis from one image to the next, over all the images
5879 in the current image list. The added images are the equivalent of a <a
5880 href="#blend">-blend</a> composition. The <var>frames</var>
5881 argument determine how many images to interpolate between each image. </p>
5882
5883
5884 <div style="mx-auto my-3 text-center">
5885 <h2><a class="anchor" id="morphology"></a>-morphology</h2>
5886 <h2>-morphology <var>method</var> <var>kernel</var></h2>
5887 </div>
5888
5889 <p class="lead">Apply a morphology method to the image.</p>
5890
5891 <p>See <a href="https://usage.imagemagick.org/morphology/" >IM Usage Examples, Morphology</a>. </p>
5892
5893
5894 <div style="mx-auto my-3 text-center">
5895 <h2><a class="anchor" id="mosaic"></a>-mosaic</h2>
5896 </div>
5897
5898 <p class="lead">A simple alias for the <a href="#layers" >-layers</a> method "mosaic"</p>
5899
5900
5901 <div style="mx-auto my-3 text-center">
5902 <h2><a class="anchor" id="motion-blur"></a>-motion-blur <var>radius</var><br />-motion-blur <var>radius</var>{x<var>sigma</var>}+<var>angle</var></h2>
5903 </div>
5904
5905 <p class="lead">Simulate motion blur.</p>
5906
5907 <p>Blur with the given radius, standard deviation (sigma), and angle. The
5908 angle given is the angle toward which the image is blurred. That is the
5909 direction people would consider the object is coming from. </p>
5910
5911 <p>Note that the blur is not uniform distribution, giving the motion a
5912 definite sense of direction of movement. </p>
5913
5914 <p>The <a href="#virtual-pixel">-virtual-pixel</a> setting will determine how
5915 pixels which are outside the image proper are blurred into the final result.
5916 </p>
5917
5918 <div style="mx-auto my-3 text-center">
5919 <h2><a class="anchor" id="name"></a>-name</h2>
5920 </div>
5921
5922 <p class="lead">Name an image.</p>
5923 <div style="mx-auto my-3 text-center">
5924 <h2><a class="anchor" id="negate"></a>-negate</h2>
5925 </div>
5926
5927 <p class="lead">Replace each pixel with its complementary color.</p>
5928
5929 <p>The red, green, and blue intensities of an image are negated. White becomes
5930 black, yellow becomes blue, etc. Use <a href="#negate">+negate</a> to only
5931 negate the grayscale pixels of the image.</p>
5932
5933 <div style="mx-auto my-3 text-center">
5934 <h2><a class="anchor" id="noise"></a>-noise <var>geometry</var><br/>
5935 +noise <var>type</var></h2>
5936 </div>
5937
5938 <p class="lead">Add or reduce noise in an image.</p>
5939
5940 <p>The principal function of noise peak elimination filter is to smooth the
5941 objects within an image without losing edge information and without creating
5942 undesired structures. The central idea of the algorithm is to replace a pixel
5943 with its next neighbor in value within a pixel window, if this pixel has been
5944 found to be noise. A pixel is defined as noise if and only if this pixel is
5945 a maximum or minimum within the pixel window.</p>
5946
5947 <p>Use <code><a href="#noise">-noise</a> <var>radius</var></code> to
5948 specify the width of the neighborhood when reducing noise. This is equivalent
5949 to using a <code><a href="#statistic" >-statistic</a> NonPeak</code> operation,
5950 which should be used in preference.</p>
5951
5952 <p>Use <a href="#noise">+noise</a> followed by a noise <var>type</var> to add noise to an image. Choose from these noise
5953 types:</p>
5954
5955 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>Gaussian
5956 Impulse
5957 Laplacian
5958 Multiplicative
5959 Poisson
5960 Random
5961 Uniform
5962 </code></pre>
5963
5964 <p>The amount of noise added can be controlled by the <code><a
5965 href="#attenuate" >-attenuate</a></code> setting. If unset the value is
5966 equivalent to 1.0, or a maximum noise addition.</p>
5967
5968 <p>Note that Random will replace the image with noise rather than add noise to the image. Use Uniform, if you wish to add random noise to the image.</p>
5969
5970 <p>To print a complete list of noises, use the <a href="#list">-list noise</a> option.</p>
5971
5972 <p>Also see the <a href="#evaluate">-evaluate</a> noise functions that allows
5973 the use of a controlling value to specify the amount of noise that should be
5974 added to an image. </p>
5975
5976
5977 <div style="mx-auto my-3 text-center">
5978 <h2><a class="anchor" id="normalize"></a>-normalize</h2>
5979 </div>
5980
5981 <p class="lead">Increase the contrast in an image by <var>stretching</var> the range of intensity values.</p>
5982
5983 <p>The intensity values are stretched to cover the entire range of possible
5984 values. While doing so, black-out at most <var>2%</var> of the pixels and
5985 white-out at most <var>1%</var> of the pixels.</p>
5986
5987 <p>Note that as of ImageMagick 6.4.7-0, <a href="#normalize" >-normalize</a>
5988 is equivalent to <a href="#contrast-stretch" >-contrast-stretch 2%x1%</a>.
5989 (Before this version, it was equivalent to <a href="#contrast-stretch"
5990 >-contrast-stretch 2%x99%</a>).</p>
5991
5992 <p>All the channels are normalized in concert by the same amount so as to
5993 preserve color integrity, when the default <a href="#channel" >+channel</a>
5994 setting is in use. Specifying any other <a href="#channel" >-channel</a>
5995 setting will normalize the RGB channels independently.</p>
5996
5997 <p>See <a href="#contrast-stretch" >-contrast-stretch</a> for more details.
5998 Also see <a href="#auto-level" >-auto-level</a> for a 'perfect' normalization
5999 that is better suited to mathematically generated images. </p>
6000
6001 <p>This operator is under review for re-development. </p>
6002
6003
6004 <div style="mx-auto my-3 text-center">
6005 <h2><a class="anchor" id="opaque"></a>-opaque <var>color</var></h2>
6006 </div>
6007
6008 <p class="lead">Change this color to the fill color within the image.</p>
6009
6010 <p>The <var>color</var> argument is defined using the format
6011 described under the <a href="#fill" >-fill</a> option. The <a href="#fuzz"
6012 >-fuzz</a> setting can be used to match and replace colors similar to the one
6013 given.</p>
6014
6015 <p>Use <a href="#opaque">+opaque</a> to paint any pixel that does not match
6016 the target color. </p>
6017
6018 <p>The <a href="#transparent">-transparent</a> operator is exactly the same
6019 as <a href="#opaque" >-opaque</a> but replaces the matching color with
6020 transparency rather than the current <a href="#fill">-fill</a> color setting.
6021 To ensure that it can do this it also ensures that the image has an alpha
6022 channel enabled, as per "<code><a href="#alpha" >-alpha</a> set</code>", for
6023 the new transparent colors, and does not require you to modify the <a
6024 href="#channel">-channel</a> to enable alpha channel handling. </p>
6025
6026
6027 <div style="mx-auto my-3 text-center">
6028 <h2><a class="anchor" id="ordered-dither"></a>-ordered-dither <var>threshold_map</var>{,<var>level</var>...}</h2>
6029 </div>
6030
6031 <p class="lead">Dither the image using a pre-defined ordered dither <var>threshold map</var> specified, and a uniform color map with the
6032 given number of <var>levels</var> per color channel.</p>
6033
6034 <p>You can choose from these standard threshold maps:</p>
6035
6036 <pre class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;"><code>
6037 threshold 1x1 Threshold 1x1 (non-dither)
6038 checks 2x1 Checkerboard 2x1 (dither)
6039 o2x2 2x2 Ordered 2x2 (dispersed)
6040 o3x3 3x3 Ordered 3x3 (dispersed)
6041 o4x4 4x4 Ordered 4x4 (dispersed)
6042 o8x8 8x8 Ordered 8x8 (dispersed)
6043 h4x4a 4x1 Halftone 4x4 (angled)
6044 h6x6a 6x1 Halftone 6x6 (angled)
6045 h8x8a 8x1 Halftone 8x8 (angled)
6046 h4x4o Halftone 4x4 (orthogonal)
6047 h6x6o Halftone 6x6 (orthogonal)
6048 h8x8o Halftone 8x8 (orthogonal)
6049 h16x16o Halftone 16x16 (orthogonal)
6050 c5x5b c5x5 Circles 5x5 (black)
6051 c5x5w Circles 5x5 (white)
6052 c6x6b c6x6 Circles 6x6 (black)
6053 c6x6w Circles 6x6 (white)
6054 c7x7b c7x7 Circles 7x7 (black)
6055 c7x7w Circles 7x7 (white)
6056 </code></pre>
6057
6058 <p> The <code>threshold</code> generated a simple 50% threshold of the image.
6059 This could be used with <var >level</var> to do the equivalent of <a
6060 href="#posterize" >-posterize</a> to reduce an image to basic primary colors.
6061 </p>
6062
6063 <p>The <code>checks</code> pattern produces a 3 level checkerboard dither
6064 pattern. That is a grayscale will become a pattern of solid black, solid
6065 white, and mid-tone colors into a checkerboard pattern of black and white.
6066 </p>
6067
6068 <p>You can define your own <var >threshold map</var> for ordered
6069 dithering and halftoning your images, in either personal or system
6070 <code>thresholds.xml</code> XML file. See <a href="../resources/index.html" >Resources</a>
6071 for more details of configuration files. </p>
6072
6073 <p>To print a complete list of the thresholds that have been defined, use the
6074 <a href="#list" >-list threshold</a> option.</p>
6075
6076 <p>Note that at this time the same threshold dithering map is used for all
6077 color channels, no attempt is made to offset or rotate the map for different
6078 channels is made, to create an offset printing effect. Also as the maps are
6079 simple threshold levels, the halftone and circle maps will create incomplete
6080 circles along the edges of a colored area. Also all the effects are purely
6081 on/off boolean effects, without anti-aliasing to make the circles smooth
6082 looking. Large dots can be made to look better with a small amount of blurring
6083 after being created. </p>
6084
6085
6086 <div style="mx-auto my-3 text-center">
6087 <h2><a class="anchor" id="orient"></a>-orient <var>image orientation</var></h2>
6088 </div>
6089
6090 <p class="lead">Specify orientation of a digital camera image.</p>
6091
6092 <p>Note, this is a setting. This merely sets the orientation metadata, and does not change the image.</p>
6093
6094 <p>Here are the allowed orientations and the EXIF codes and descriptions how to re-orient the image:</p>
6095
6096 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
6097 <dl class="row">
6098 <dt class="col-md-4">Undefined</dt><dd class="col-md-8">no tag: Undefined</dd>
6099 <dt class="col-md-4">top-left</dt><dd class="col-md-8">1: Do nothing</dd>
6100 <dt class="col-md-4">top-right</dt><dd class="col-md-8">2: Flip horizontally</dd>
6101 <dt class="col-md-4">bottom-right</dt><dd class="col-md-8">3: Rotate 180 degrees</dd>
6102 <dt class="col-md-4">bottom-left</dt><dd class="col-md-8">4: Flip vertically</dd>
6103 <dt class="col-md-4">left-top</dt><dd class="col-md-8">5: Rotate 90 degrees and flip horizontally (transpose)</dd>
6104 <dt class="col-md-4">right-top</dt><dd class="col-md-8">6: Rotate 90 degrees</dd>
6105 <dt class="col-md-4">right-bottom</dt><dd class="col-md-8">7: Rotate 90 degrees and flip vertically (transverse)</dd>
6106 <dt class="col-md-4">left-bottom</dt><dd class="col-md-8">8: Rotate 270 degrees</dd>
6107 </dl>
6108 </div>
6109
6110
6111 <p>To print a complete list of orientations, use the <a href="#list" >-list
6112 orientation</a> option.</p>
6113
6114
6115 <div style="mx-auto my-3 text-center">
6116 <h2><a class="anchor" id="page"></a>-page <var>geometry</var><br/>
6117 -page <var>media</var>[<var>offset</var>][{<var>^!&lt;&gt;</var>}]<br/>
6118 +page
6119 </h2>
6120 </div>
6121
6122 <p class="lead">Set the size and location of an image on the larger virtual canvas.</p>
6123
6124 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument.</p>
6125
6126 <p>For convenience you can specify the page size using <var>media</var> (see below). Offsets can then be added as with other
6127 <var>geometry</var> arguments (e.g. <a
6128 href="#page">-page</a> <code>Letter+43+43</code>).</p>
6129
6130 <p>Use <var>media</var> as shorthand to specify the dimensions (<var>width</var>x<var>height</var>) of the <var>PostScript</var> page in dots per inch or a TEXT page in pixels.
6131 The choices for paper sizes are: <code>4x6</code>, <code>5x7</code>, <code>7x9</code>, <code>8x10</code>, <code>9x11</code>, <code>9x12</code>, <code>10x13</code>, <code>10x14</code>, <code>11x17</code>, <code>4A0</code>, <code>2A0</code>, <code>a0</code>, <code>a1</code>, <code>a2</code>, <code>a3</code>, <code>a4</code>, <code>a4small</code>, <code>a5</code>, <code>a6</code>, <code>a7</code>, <code>a8</code>, <code>a9</code>, <code>a10</code>, <code>archa</code>, <code>archb</code>, <code>archC</code>, <code>archd</code>, <code>arche</code>, <code>b0</code>, <code>b1</code>, <code>b10</code>, <code>b2</code>, <code>b3</code>, <code>b4</code>, <code>b5</code>, <code>b6</code>, <code>b7</code>, <code>b8</code>, <code>b9</code>, <code>c0</code>, <code>c1</code>, <code>c2</code>, <code>c3</code>, <code>c4</code>, <code>c5</code>, <code>c6</code>, <code>c7</code>, <code>csheet</code>, <code>dsheet</code>, <code>esheet</code>, <code>executive</code>, <code>flsa</code>, <code>flse</code>, <code>folio</code>, <code>halfletter</code>, <code>isob0</code>, <code>isob1</code>, <code>isob10</code>, <code>isob2</code>, <code>isob3</code>, <code>isob4</code>, <code>isob5</code>, <code>isob6</code>, <code>isob7</code>, <code>isob8</code>, <code>isob9</code>, <code>jisb0</code>, <code>jisb1</code>, <code>jisb2</code>, <code>jisb3</code>, <code>jisb4</code>, <code>jisb5</code>, <code>jisb6</code>, <code>ledger</code>, <code>legal</code>, <code>letter</code>, <code>lettersmall</code>, <code>monarch</code>, <code>quarto</code>, <code>statement</code>, <code>tabloid</code>. To determine the corresponding size in pixels at 72DPI, use this command for example:</p>
6132 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><pre><samp>$ magick xc: -format "%[papersize:a4]" info:</samp></pre></pre>
6133
6134 <p>This option is also used to place subimages when writing to a multi-image
6135 format that supports offsets, such as GIF89 and MNG. When used for this
6136 purpose the offsets are always measured from the top left corner of the canvas
6137 and are not affected by the <a href="#gravity">-gravity</a> option. To
6138 position a GIF or MNG image, use <a href="#page">-page</a><var>{+-}x{+-}y</var> (e.g. -page +100+200). When writing to a MNG
6139 file, a <a href="#page">-page</a> option appearing ahead of the first image in
6140 the sequence with nonzero width and height defines the width and height values
6141 that are written in the <code>MHDR</code> chunk. Otherwise, the MNG width and
6142 height are computed from the bounding box that contains all images in the
6143 sequence. When writing a GIF89 file, only the bounding box method is used to
6144 determine its dimensions.</p>
6145
6146 <p>For a PostScript page, the image is sized as in <a
6147 href="#geometry">-geometry</a> but positioned relative to the <var>lower
6148 left-hand corner</var> of the page by {+-}<code>x</code><var>offset</var>{+-}<code>y</code> <var>offset</var>. Use <a
6149 href="#page">-page 612x792</a>, for example, to center the image within the
6150 page. If the image size exceeds the PostScript page, it is reduced to fit the
6151 page. The default gravity for the <a href="#page">-page</a> option is <var>NorthWest</var>, i.e., positive <code>x</code> and <code>y</code> <var>offset</var> are measured rightward and downward from the top left
6152 corner of the page, unless the <a href="#gravity">-gravity</a> option is
6153 present with a value other than <var>NorthWest</var>.</p>
6154
6155 <p>The default page dimensions for a TEXT image is 612x792.</p>
6156
6157 <p>This option is used in concert with <a href="#density">-density</a>.</p>
6158
6159 <p>Use <a href="#page">+page</a> to remove the page settings for an image.</p>
6160
6161 <p>To print a complete list of pagesizes, use <a href="#list">-list pagesize</a> option.</p>
6162
6163 <div style="mx-auto my-3 text-center">
6164 <h2><a class="anchor" id="paint"></a>-paint <var>radius</var></h2>
6165 </div>
6166
6167 <p class="lead">Simulate an oil painting.</p>
6168
6169 <p>Each pixel is replaced by the most frequent color in a circular
6170 neighborhood whose width is specified with <var>radius</var>.</p>
6171
6172 <div style="mx-auto my-3 text-center">
6173 <h2><a class="anchor" id="path"></a>-path <var>path</var></h2></div>
6174
6175 <p class="lead">Write images to this path on disk.</p>
6176
6177 <div style="mx-auto my-3 text-center">
6178 <h2><a class="anchor" id="pause_animate_"></a>-pause <var>seconds</var></h2>
6179 </div>
6180
6181 <p class="lead">Pause between animation loops</p>
6182
6183 <p>Pause for the specified number of seconds before repeating the animation.</p>
6184
6185 <div style="mx-auto my-3 text-center">
6186 <h2><a class="anchor" id="pause_import_"></a>-pause <var>seconds</var></h2>
6187 </div>
6188
6189 <p class="lead">Pause between snapshots.</p>
6190
6191 <p>Pause for the specified number of seconds before taking the next snapshot.</p>
6192
6193 <div style="mx-auto my-3 text-center">
6194 <h2><a class="anchor" id="perceptible"></a>-perceptible <var>epsilon</var></h2>
6195 </div>
6196
6197 <p class="lead">Set each pixel whose value is less than |<var>epsilon</var>| to <var>-epsilon</var> or <var>epsilon</var> (whichever is closer) otherwise the pixel value remains unchanged.</p>
6198
6199 <div style="mx-auto my-3 text-center">
6200 <h2><a class="anchor" id="ping"></a>-ping</h2>
6201 </div>
6202
6203 <p class="lead">Efficiently determine these image characteristics: image number, the file name, the width and height of the image, whether the image is colormapped or not, the number of colors in the image, the number of bytes in the image, the format of the image (JPEG, PNM, etc.). Use <code>+ping</code> to ensure accurate image properties.</p>
6204
6205 <div style="mx-auto my-3 text-center">
6206 <h2><a class="anchor" id="pointsize"></a>-pointsize <var>value</var></h2>
6207 </div>
6208
6209 <p class="lead">Pointsize of the PostScript, X11, or TrueType font.</p>
6210
6211 <div style="mx-auto my-3 text-center">
6212 <h2><a class="anchor" id="polaroid"></a>-polaroid <var>angle</var></h2>
6213 </div>
6214
6215 <p class="lead">Simulate a Polaroid picture.</p>
6216
6217 <p>Use <code>+polaroid</code> to rotate the image at a random angle between -15 and +15 degrees.</p>
6218
6219 <div style="mx-auto my-3 text-center">
6220 <h2><a class="anchor" id="poly"></a>-poly <var>"wt,exp ..."</var></h2>
6221 </div>
6222
6223 <p class="lead">Combines multiple images according to a weighted sum of polynomials; one floating point weight (coefficient) and one floating point polynomial exponent (power) for each image expressed as comma separated pairs.</p>
6224
6225 <p> The weights should typically be fractions between -1 and 1. But the sum of weights should be 1 or at least between 0 and 1 to avoid clamping in non-hdri mode at black and white.</p>
6226
6227 <p>The exponents may be positive, negative or zero. A negative exponent is equivalent to 1 divided by the image raised to the corresponding positive exponent. A zero exponent always produces 1 scaled by quantumrange to white, i.e. wt*white, no matter what the image.</p>
6228
6229 <p>The format is: <var>output = wt1*image1^exp1 + wt2*image2^exp2 </var>...</p>
6230
6231 <p>Some simple uses are:</p>
6232 <ul>
6233 <li>A weighted sum of each image provided all weights add to unity and all exponents=1. If the weights are all equal to 1/(number of images), then this is equivalent to <a href="#profile">-evaluate-sequence</a> <var>mean</var>.</li>
6234 <li>The sum of squares of two or more images, provided the weights are equal (and sum to 1 to avoid clamping) and the exponents equal 2.</li>
6235 </ul>
6236
6237 <p>Note that one may add a constant color to the expression simply by using xc:somecolor for one of the images and specifying the desired weight and exponent equal to 0.</p>
6238
6239 <p>Similarly one may add white to the expression by simply using null: (or xc:white) for one of the images with the appropriate weight and exponent equal to 0.</p>
6240
6241
6242 <div style="mx-auto my-3 text-center">
6243 <h2><a class="anchor" id="posterize"></a>-posterize <var>levels</var></h2>
6244 </div>
6245
6246 <p class="lead">Reduce the image to a limited number of color levels per channel.</p>
6247
6248 <p>Very low values of <var>levels</var>, e.g., 2, 3, 4, have the most
6249 visible effect.</p>
6250
6251 <div style="mx-auto my-3 text-center">
6252 <h2><a class="anchor" id="precision"></a>-precision <var>value</var></h2>
6253 </div>
6254
6255 <p class="lead">Set the maximum number of significant digits to be printed.</p>
6256
6257 <div style="mx-auto my-3 text-center">
6258 <h2><a class="anchor" id="preview"></a>-preview <var>type</var></h2>
6259 </div>
6260
6261 <p class="lead">Image preview type.</p>
6262
6263 <p>Use this option to affect the preview operation of an image (e.g.
6264 <pre><samp>$ magick file.png -preview Gamma Preview:gamma.png</samp></pre>). Choose from
6265 these previews:</p>
6266
6267 <pre class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;"><code>
6268 AddNoise
6269 Blur
6270 Brightness
6271 Charcoal
6272 Despeckle
6273 Dull
6274 EdgeDetect
6275 Gamma
6276 Grayscale
6277 Hue
6278 Implode
6279 JPEG
6280 OilPaint
6281 Quantize
6282 Raise
6283 ReduceNoise
6284 Roll
6285 Rotate
6286 Saturation
6287 Segment
6288 Shade
6289 Sharpen
6290 Shear
6291 Solarize
6292 Spiff
6293 Spread
6294 Swirl
6295 Threshold
6296 Wave
6297 </code></pre>
6298
6299 <p>To print a complete list of previews, use the <a href="#list">-list preview</a> option.</p>
6300
6301 <p>The default preview is <code>JPEG</code>.</p>
6302
6303 <div style="mx-auto my-3 text-center">
6304 <h2><a class="anchor" id="print"></a>-print <var>string</var></h2>
6305 </div>
6306
6307 <p class="lead">Interpret string and print to console.</p>
6308
6309 <div style="mx-auto my-3 text-center">
6310 <h2><a class="anchor" id="process"></a>-process <var>command</var></h2>
6311 </div>
6312
6313 <p class="lead">Process the image with a custom image filter.</p>
6314
6315 <p>The command arguments has the form <code>"module arg1 arg2 arg3 ...
6316 argN"</code> where <code>module</code> is the name of the module to invoke (e.g.
6317 "Analyze") and arg1 arg2 arg3 ... argN are an arbitrary number of arguments to
6318 pass to the process module.</p>
6319
6320 <div style="mx-auto my-3 text-center">
6321 <h2><a class="anchor" id="profile"></a>-profile <var>filename</var><br/>
6322 +profile <var>profile_name</var></h2>
6323 </div>
6324
6325 <p class="lead">Manage ICM, IPTC, or generic profiles in an image.</p>
6326
6327 <p>Using <a href="#profile">-profile</a> <var>filename</var> adds an
6328 ICM (ICC color management), IPTC (newswire information), or a generic profile
6329 to the image.</p>
6330
6331 <p>Use <a href="#profile">+profile <var>profile_name</var></a> to
6332 remove the indicated profile. ImageMagick uses standard filename globbing, so
6333 wildcard expressions may be used to remove more than one profile. Here we
6334 remove all profiles from the image except for the XMP profile: <code>+profile
6335 "!xmp,*"</code>. </p>
6336
6337 <p>Use <pre><samp>$ magick identify -verbose</samp></pre> to find out which profiles are in the
6338 image file. Use <a href="#strip">-strip</a> to remove all profiles (and
6339 comments).</p>
6340
6341 <p>To extract a profile, the <a href="#profile">-profile</a> option is not
6342 used. Instead, simply write the file to an image format such as <var>APP1, 8BIM, ICM,</var> or <var>IPTC</var>.</p>
6343
6344 <p>For example, to extract the Exif data (which is stored in JPEG files in the
6345 <var>APP1</var> profile), use.</p>
6346
6347 <p>Set <code>-define precision:highres-transform=true</code> to increase the transform precision. Note, there is a slight performance penalty as the high-precision transform is floating point rather than unsigned.</p>
6348
6349 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick cockatoo.jpg profile.exif
6350 </samp></pre>
6351
6352 <p>It is important to note that results may depend on whether or not the
6353 original image already has an included profile. Also, keep in mind that <a
6354 href="#profile">-profile</a> is an "operator" (as opposed to a "setting") and
6355 therefore a conversion is made each time it is encountered, in order, in the
6356 command-line. For instance, in the following example, if the original image is
6357 CMYK with profile, a CMYK-CMYK-RGB conversion results.</p>
6358
6359 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick CMYK.tif -profile "CMYK.icc" -profile "RGB.icc" RGB.tiff
6360 </samp></pre>
6361
6362 <p>Furthermore, since ICC profiles are not necessarily symmetric, extra
6363 conversion steps can yield unwanted results. CMYK profiles are often very
6364 asymmetric since they involve 3−&gt;4 and 4−&gt;3 channel mapping.
6365 </p>
6366
6367 <div style="mx-auto my-3 text-center">
6368 <h2><a class="anchor" id="quality"></a>-quality <var>value</var></h2>
6369 </div>
6370
6371 <p class="lead">control the compression quality of JPEG, PNG, HEIC, and WebP image files when you are creating or saving them. This option is important for managing the trade-off between image quality and file size.</p>
6372
6373 <p>For the JPEG and MPEG image formats, quality is 1 (lowest image quality and
6374 highest compression) to 100 (best quality but least effective compression).
6375 The default is to use the estimated quality of your input image if it can
6376 be determined, otherwise 92. When the quality is 90 or greater, then the
6377 chroma channels are not downsampled.
6378 Use the <a href="#sampling-factor">-sampling-factor</a> option to specify the
6379 factors for chroma downsampling.</p>
6380
6381 <p>For the JPEG-2000 image format, quality is mapped using a non-linear
6382 equation to the compression ratio required by the Jasper library. This
6383 non-linear equation is intended to loosely approximate the quality provided by
6384 the JPEG v1 format. The default quality value 100, a request for non-lossy
6385 compression. A quality of 75 results in a request for 16:1 compression.</p>
6386
6387 <p>For the MNG and PNG image formats, the quality value sets the zlib
6388 compression level (quality / 10) and filter-type (quality % 10). The default
6389 PNG "quality" is 75, which means compression level 7 with adaptive PNG
6390 filtering, unless the image has a color map, in which case it means
6391 compression level 7 with no PNG filtering.</p>
6392
6393 <p>For compression level 0 (quality value less than 10), the Huffman-only
6394 strategy is used, which is fastest but not necessarily the worst
6395 compression.</p>
6396
6397 <p>If filter-type is 4 or less, the specified PNG filter-type is used for
6398 all scanlines:</p>
6399
6400 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
6401 <dl class="row">
6402 <dt class="col-md-4">0</dt><dd class="col-md-8">none</dd>
6403 <dt class="col-md-4">1</dt><dd class="col-md-8">sub</dd>
6404 <dt class="col-md-4">2</dt><dd class="col-md-8">up</dd>
6405 <dt class="col-md-4">3</dt><dd class="col-md-8">average</dd>
6406 <dt class="col-md-4">4</dt><dd class="col-md-8">Paeth</dd>
6407 </dl>
6408 </div>
6409
6410 <p>If filter-type is 5, adaptive filtering is used when quality is greater
6411 than 50 and the image does not have a color map, otherwise no filtering is
6412 used.</p>
6413
6414 <p>If filter-type is 6, adaptive filtering
6415 with <var>minimum-sum-of-absolute-values</var> is used.</p>
6416
6417 <p>Only if the output is MNG, if filter-type is 7, the LOCO color
6418 transformation (intrapixel differencing) and adaptive filtering
6419 with <var>minimum-sum-of-absolute-values</var> are used.</p>
6420
6421 <p>If the filter-type is 8 the zlib Z_RLE compression strategy (or the
6422 Z_HUFFMAN_ONLY strategy, when compression level is 0) is used with
6423 adaptive PNG filtering.</p>
6424
6425 <p>If the filter-type is 9 the zlib Z_RLE compression strategy (or the
6426 Z_HUFFMAN_ONLY strategy, when compression level is 0) is used with
6427 no PNG filtering.</p>
6428
6429 <p>The quality setting has no effect on the appearance or signature of PNG
6430 and MNG images, since the compression is always lossless.</p>
6431
6432 <p>Not all combinations of compression level, strategy, and PNG filter type
6433 can be obtained using the -quality option. For more precise control,
6434 you can use the PNG:compression-level=N, PNG:compression-strategy=N, and
6435 PNG:compression-filter=N defines, respectively, instead.
6436 See <a href="#define">-define</a>. Values from the defines take precedence
6437 over values from the -quality option.</p>
6438
6439 <p>For further information, see
6440 the <a href="http://www.w3.org/pub/WWW/TR">PNG</a> specification.</p>
6441
6442 <p>For the MIFF and TIFF image formats, quality/10 is the <a href="#compress">Zip/BZip</a> compression level, which is 0 (worst but fastest compression) to 9 (best but slowest). It has no effect on the image appearance, since the compression is always lossless.</p>
6443
6444 <p>For the BPG image format, quality/2 is the actual BPG compression level (range from 0 to 51).</p>
6445
6446 <div style="mx-auto my-3 text-center">
6447 <h2><a class="anchor" id="quantize"></a>-quantize <var>colorspace</var></h2>
6448 </div>
6449
6450 <p class="lead">Reduce colors using this colorspace.</p>
6451
6452 <p>This setting defines the colorspace used to sort out and reduce the number
6453 of colors needed by an image (for later dithering) by operators such as <a
6454 href="#colors" >-colors</a>, Note that color reduction also happens
6455 automatically when saving images to color-limited image file formats, such as
6456 GIF, and PNG8.</p>
6457
6458
6459 <div style="mx-auto my-3 text-center">
6460 <h2><a class="anchor" id="quiet"></a>-quiet</h2>
6461 </div>
6462
6463 <p class="lead">Suppress all warning messages. Error messages are still reported.</p>
6464
6465 <p>The <a href="#virtual-pixel">-virtual-pixel</a> setting will determine how
6466 pixels which are outside the image proper are blurred into the final result.
6467 </p>
6468
6469
6470 <div style="mx-auto my-3 text-center">
6471 <h2><a class="anchor" id="raise"></a>-raise <var>thickness</var></h2>
6472 </div>
6473
6474 <p class="lead">Lighten or darken image edges.</p>
6475
6476 <p>This will create a 3-D effect. Use <a href="#raise">-raise</a> to create
6477 a raised effect, otherwise use <a href="#raise">+raise</a>. </p>
6478
6479 <p>Unlike the similar <a href="#frame">-frame</a> option, <a
6480 href="#raise">-raise</a> does not alter the dimensions of the image.</p>
6481
6482 <div style="mx-auto my-3 text-center">
6483 <h2><a class="anchor" id="random-threshold"></a>-random-threshold <var>low</var>x<var>high</var></h2>
6484 </div>
6485
6486 <p class="lead">Apply a random threshold to the image.</p>
6487
6488 <div style="mx-auto my-3 text-center">
6489 <h2><a class="anchor" id="range-threshold"></a>-range-threshold <var>low-black</var>,<var>low-white</var>,<var>high-white</var>,<var>high-black</var></h2>
6490 </div>
6491
6492 <p class="lead">Perform either hard or soft thresholding within some range of values in an image.</p>
6493
6494 <div style="mx-auto my-3 text-center">
6495 <h2><a class="anchor" id="read"></a>-read <var>filename</var></h2>
6496 </div>
6497
6498 <p class="lead">Explicit read of an image rather than an implicit read.</p>
6499 <p>This option allows you to read from filenames that start with an 'option' character, and which otherwise could be mistaken as an option (unknown or otherwise).</p>
6500
6501 <div style="mx-auto my-3 text-center">
6502 <h2><a class="anchor" id="read-mask"></a>-read-mask <var>filename</var></h2>
6503 </div>
6504
6505 <p class="lead">Prevent updates to image pixels specified by the mask.</p>
6506
6507 <p>This the same as using a mask used for composite masking operations, with
6508 grayscale values causing blended updates of the image the mask is attached to.
6509 </p>
6510
6511 <p>Use <a href="#read-mask">+read-mask</a> to remove the mask from images.</p>
6512
6513 <p>Also see <a href="#clip-mask">-clip-mask</a> which work in the same way,
6514 but with strict boolean masking. </p>
6515
6516 <div style="mx-auto my-3 text-center">
6517 <h2><a class="anchor" id="red-primary"></a>-red-primary <var>x,y</var></h2>
6518 </div>
6519
6520 <p class="lead">Set the red chromaticity primary point.</p>
6521
6522 <div style="mx-auto my-3 text-center">
6523 <h2><a class="anchor" id="regard-warnings"></a>-regard-warnings</h2>
6524 </div>
6525
6526 <p class="lead">Pay attention to warning messages.</p>
6527
6528 <p>This option causes some warnings in some image formats to be treated
6529 as errors. </p>
6530
6531 <div style="mx-auto my-3 text-center">
6532 <h2><a class="anchor" id="remap"></a>-remap <var>filename</var></h2>
6533 </div>
6534
6535 <p class="lead">Reduce the number of colors in an image to the colors used by this image.</p>
6536
6537 <p>If the <a href="#dither">-dither</a> setting is enabled (the default) then
6538 the given colors are dithered over the image as necessary, otherwise the closest
6539 color (in RGB colorspace) is selected to replace that pixel in the image. </p>
6540
6541 <p>As a side effect of applying a <a href="#remap">-remap</a> of colors across all
6542 images in the current image sequence, all the images will have the same color
6543 table. That means that when saved to a file format such as GIF, it will use
6544 that color table as a single common or global color table, for all the images,
6545 without requiring extra local color tables. </p>
6546
6547 <p>Use <a href="#remap">+remap</a> to reduce all images in the current image
6548 sequence to use a common color map over all the images. This equivalent to
6549 appending all the images together (without extra background colors) and color
6550 reducing those images using <a href="#colors">-colors</a> with a 256 color
6551 limit, then <a href="#remap">-remap</a> those colors over the original list of
6552 images. This ensures all the images follow a single color map. </p>
6553
6554 <p>If the number of colors over all the images is less than 256, then <a
6555 href="#remap">+remap</a> should not perform any color reduction or dithering, as
6556 no color changes are needed. In that case, its only effect is to force the use
6557 of a global color table. This recommended after using either <a
6558 href="#colors">-colors</a> or <a href="#ordered-dither">-ordered-dither</a> to
6559 reduce the number of colors in an animated image sequence. </p>
6560
6561 <p>Note, the remap image colormap has at most 8-bits of precision. Deeper color maps are automagically coalesced with other colors to meet this requirement.</p>
6562
6563 <div style="mx-auto my-3 text-center">
6564 <h2><a class="anchor" id="region"></a>-region <var>geometry</var></h2>
6565 </div>
6566
6567 <p class="lead">Set a region in which subsequent operations apply.</p>
6568
6569 <p>The <var>x</var> and <var>y</var> offsets are treated
6570 in the same manner as in <a href="#crop">-crop</a>.</p>
6571
6572 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument.</p>
6573
6574 <p>Use <code>+region</code> to remove any previously set regions.</p>
6575
6576 <div style="mx-auto my-3 text-center">
6577 <h2><a class="anchor" id="remote"></a>-remote</h2>
6578 </div>
6579
6580 <p class="lead">Perform a remote operation.</p>
6581
6582 <p>The only command recognized is the name of an image file to load.</p>
6583
6584 <p>If you have more than one <a href="../display/index.html">display</a> application
6585 running simultaneously, use the <a href="#window"> window</a> option to
6586 specify which application to control.</p>
6587
6588 <div style="mx-auto my-3 text-center">
6589 <h2><a class="anchor" id="render"></a>-render</h2>
6590 </div>
6591
6592 <p class="lead">Render vector operations.</p>
6593
6594 <p>Use <a href="#render">+render</a> to turn off rendering vector operations.
6595 This useful when saving the result to vector formats such as MVG or SVG.</p>
6596
6597 <div style="mx-auto my-3 text-center">
6598 <h2><a class="anchor" id="repage"></a>-repage <var>geometry</var></h2>
6599 </div>
6600
6601 <p class="lead">Adjust the canvas and offset information of the image.</p>
6602
6603 <p>This option is like <a href="#page">-page</a> but acts as an image operator
6604 rather than a setting. You can separately set the canvas size or the offset
6605 of the image on that canvas by only providing those components. </p>
6606
6607 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument.</p>
6608
6609 <p>If a <code>!</code> flag is given the offset given is added to the existing
6610 offset to move the image relative to its previous position. This useful for
6611 animation sequences. </p>
6612
6613 <p>A given a canvas size of zero such as '<code>0x0</code>' forces it to
6614 recalculate the canvas size so the image (at its current offset) will appear
6615 completely on that canvas (unless it has a negative offset).</p>
6616
6617 <p>Use <a href="#repage">+repage</a> to completely remove/reset the virtual
6618 canvas meta-data from the images. </p>
6619
6620 <p>The <a href="#set">-set</a> '<code>page</code>' option can be used to
6621 directly assign virtual canvas meta-data. </p>
6622
6623
6624 <div style="mx-auto my-3 text-center">
6625 <h2><a class="anchor" id="resample"></a>-resample <var>horizontal</var>x<var>vertical</var></h2>
6626 </div>
6627
6628 <p class="lead">Resample image to specified horizontal and vertical resolution.</p>
6629
6630 <p>Resize the image so that its rendered size remains the same as the original
6631 at the specified target resolution. For example, if a 300 DPI image renders at
6632 3 inches by 2 inches on a 300 DPI device, when the image has been resampled to
6633 72 DPI, it will render at 3 inches by 2 inches on a 72 DPI device. Note that
6634 only a small number of image formats (e.g. JPEG, PNG, and TIFF) are capable of
6635 storing the image resolution. For formats which do not support an image
6636 resolution, the original resolution of the image must be specified via <a
6637 href="#density">-density</a> on the command line prior to specifying the
6638 resample resolution.</p>
6639
6640 <p>Note that Photoshop stores and obtains image resolution from a proprietary
6641 embedded profile. If this profile exists in the image, then Photoshop will
6642 continue to treat the image using its former resolution, ignoring the image
6643 resolution specified in the standard file header.</p>
6644
6645 <div style="mx-auto my-3 text-center">
6646 <h2><a class="anchor" id="reshape"></a>-reshape <var>geometry</var></h2>
6647 </div>
6648
6649 <p class="lead">Reshape an image.</p>
6650
6651 <div style="mx-auto my-3 text-center">
6652 <h2><a class="anchor" id="resize"></a>-resize <var>geometry</var></h2>
6653 </div>
6654
6655 <p class="lead">Resize an image.</p>
6656
6657 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument. Offsets, if present in the geometry string, are
6658 ignored, and the <a href="#gravity">-gravity</a> option has no effect.</p>
6659
6660 <p>If the <a href="#filter">-filter</a> option
6661 or <code>-define filter:option=value</code> precedes the <a
6662 href="#resize">-resize</a> option, the image is resized with the specified
6663 orthogonal filter.</p>
6664
6665 <p>Many image processing algorithms assume your image is in a linear-light
6666 coding. If your image is gamma-corrected, you can remove the nonlinear gamma
6667 correction, apply the transform, then restore it like this:</p>
6668
6669 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick portrait.jpg -gamma .45455 -resize 25% -gamma 2.2 \
6670 -quality 92 passport.jpg
6671 </samp></pre>
6672
6673 <p>Note, some resampling functions are damped oscillations in approximation of a Sinc function. As such, you may get negative lobes if your release of ImageMagick is HDRI-enabled. To eliminate them, add <a href="#clamp">-clamp</a> to your command-line.</p>
6674
6675 <div style="mx-auto my-3 text-center">
6676 <h2><a class="anchor" id="respect-parentheses"></a>-respect-parentheses</h2>
6677 </div>
6678
6679 <p class="lead">Settings remain in effect until parenthesis boundary.</p>
6680
6681 <div style="mx-auto my-3 text-center">
6682 <h2><a class="anchor" id="reverse"></a>-reverse</h2>
6683 </div>
6684
6685 <p class="lead">Reverse the order of images in the current image list.</p>
6686
6687
6688 <div style="mx-auto my-3 text-center">
6689 <h2><a class="anchor" id="roll"></a>-roll {<var>+-</var>}<var>x</var>{<var>+-</var>}<var>y</var></h2>
6690 </div>
6691
6692 <p class="lead">Roll an image vertically or horizontally by the amount given.</p>
6693
6694 <p>A negative <var>x</var> offset rolls the image right-to-left.
6695 A negative <var>y</var> offset rolls the image bottom-to-top.</p>
6696
6697
6698 <div style="mx-auto my-3 text-center">
6699 <h2><a class="anchor" id="rotate"></a>-rotate <var>degrees</var>{<var>&lt;</var>}{<var>&gt;</var>}</h2>
6700 </div>
6701
6702 <p class="lead">Apply Paeth image rotation (using shear operations) to the image.</p>
6703
6704 <p>Use <code>&gt;</code> to rotate the image only if its width exceeds the
6705 height. <code>&lt;</code> rotates the image <var>only</var> if its width is less
6706 than the height. For example, if you specify <code>-rotate "-90&gt;"</code> and
6707 the image size is 480x640, the image is not rotated. However, if the image is
6708 640x480, it is rotated by -90 degrees. If you use <code>&gt;</code> or
6709 <code>&lt;</code>, enclose it in quotation marks to prevent it from being
6710 misinterpreted as a file redirection.</p>
6711
6712 <p>Empty triangles in the corners, left over from rotating the image, are
6713 filled with the <code>background</code> color. </p>
6714
6715 <p>See also the <a href="#distort">-distort</a> operator and specifically the
6716 '<code>ScaleRotateTranslate</code>' distort method. </p>
6717
6718 <p>The page or virtual canvas information of the image is also rotated. Use a <a href="#repage">+repage</a> to remove the virtual canvas page information if it is unwanted.</p>
6719
6720 <div style="mx-auto my-3 text-center">
6721 <h2><a class="anchor" id="rotational-blur"></a>-rotational-blur <var>angle</var></h2>
6722 </div>
6723
6724 <p class="lead">Blur around the center of the image.</p>
6725
6726 <p>This operation used to be called "-radial-blur".</p>
6727
6728 <div style="mx-auto my-3 text-center">
6729 <h2><a class="anchor" id="sample"></a>-sample <var>geometry</var></h2>
6730 </div>
6731
6732 <p class="lead">Minify / magnify the image with pixel subsampling and pixel replication, respectively.</p>
6733
6734 <p>Change the image size simply by directly sampling the pixels original
6735 from the image. When magnifying, pixels are replicated in blocks. When
6736 minifying, pixels are sub-sampled (i.e., some rows and columns are skipped
6737 over). </p>
6738
6739 <p>The results are thus equivalent to using <a href="#resize">-resize</a> with
6740 a <a href="#filter">-filter</a> setting of <code>point</code> (nearest
6741 neighbor), though <a href="#sample">-sample</a> is a lot faster, as it
6742 avoids all the filter processing of the image. As such it completely ignores
6743 the current <a href="#filter">-filter</a> setting. </p>
6744
6745 <p>The key feature of the <a href="#sample">-sample</a> is that no new colors
6746 will be added to the resulting image, though some colors may disappear. </p>
6747
6748 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument. Offsets, if present in the geometry string, are
6749 ignored, unlike <a href="#resize">-resize</a>. </p>
6750
6751
6752 <p>The actual sampling point is the middle of the sub-region being sampled.
6753 As such a single pixel sampling of an image will take the middle pixel, (or
6754 top-left-middle if image has even dimensions). However the <a
6755 href="#define">-define</a> '<code>sample:offset</code>' can be set to modify
6756 this position some other location within each sub-region being sampled, as
6757 a percentage offset.</p>
6758
6759 <p>By default this value is '<code>50</code>' for the midpoint, but could be set
6760 to '<code>0</code>' for top-left, '<code>100</code>' for bottom-right, or with
6761 separate X and Y offsets such as '<code>0x50</code>' for left-middle edge of
6762 sampling sub-region.</p>
6763
6764
6765 <div style="mx-auto my-3 text-center">
6766 <h2><a class="anchor" id="sampling-factor"></a>-sampling-factor <var>horizontal-factor</var>x<var>vertical-factor</var></h2>
6767 </div>
6768
6769 <p class="lead">Sampling factors used by JPEG or MPEG-2 encoder and YUV decoder/encoder.</p>
6770
6771 <p>This option specifies the sampling factors to be used by the JPEG encoder
6772 for chroma downsampling. If this option is omitted, the JPEG library will use
6773 its own default values. When reading or writing the YUV format and when
6774 writing the M2V (MPEG-2) format, use <a
6775 href="#sampling-factor">-sampling-factor 2x1</a> or <a
6776 href="#sampling-factor">-sampling-factor 4:2:2</a> to specify the 4:2:2
6777 downsampling method.</p>
6778
6779 <div style="mx-auto my-3 text-center">
6780 <h2><a class="anchor" id="scale"></a>-scale <var>geometry</var></h2>
6781 </div>
6782
6783 <p class="lead">Minify / magnify the image with pixel block averaging and pixel replication, respectively.</p>
6784
6785 <p>Change the image size simply by replacing pixels by averaging pixels
6786 together when minifying, or replacing pixels when magnifying. </p>
6787
6788 <p>The results are thus equivalent to using <a href="#resize">-resize</a> with
6789 a <a href="#filter">-filter</a> setting of <code>box</code>. Though it is a lot
6790 faster, as it avoids all the filter processing of the image. As such it
6791 completely ignores the current <a href="#filter">-filter</a> setting. </p>
6792
6793 <p>If when shrinking (minifying) images the original image is some integer
6794 multiple of the new image size, the number of pixels averaged together to
6795 produce the new pixel color is the same across the whole image. This is
6796 a special case known as 'binning' and is often used as a method of reducing
6797 noise in image such as those generated by digital cameras, especially in low
6798 light conditions. </p>
6799
6800
6801 <div style="mx-auto my-3 text-center">
6802 <h2><a class="anchor" id="scene"></a>-scene <var>value</var></h2>
6803 </div>
6804
6805 <p class="lead">Set scene number.</p>
6806
6807 <p>This option sets the scene number of an image or the first image in an image sequence.</p>
6808
6809
6810 <div style="mx-auto my-3 text-center">
6811 <h2><a class="anchor" id="screen"></a>-screen</h2>
6812 </div>
6813
6814 <p class="lead">Specify the screen to capture.</p>
6815
6816 <p>This option indicates that the GetImage request used to obtain the image
6817 should be done on the root window, rather than directly on the specified
6818 window. In this way, you can obtain pieces of other windows that overlap the
6819 specified window, and more importantly, you can capture menus or other popups
6820 that are independent windows but appear over the specified window.</p>
6821
6822 <div style="mx-auto my-3 text-center">
6823 <h2><a class="anchor" id="script"></a>-script <var>filename</var></h2>
6824 </div>
6825
6826 <p class="lead">Transfer control to the named file.</p>
6827
6828 <div style="mx-auto my-3 text-center">
6829 <h2><a class="anchor" id="seed"></a>-seed</h2>
6830 </div>
6831
6832 <p class="lead">Seed a new sequence of pseudo-random numbers</p>
6833
6834 <div style="mx-auto my-3 text-center">
6835 <h2><a class="anchor" id="segment"></a>-segment <var>cluster-threshold</var>x<var>smoothing-threshold</var></h2>
6836 </div>
6837
6838 <p class="lead">Segment the colors of an image.</p>
6839
6840 <p>Segment an image by analyzing the histograms of the color components and
6841 identifying units that are homogeneous with the fuzzy c-means technique. This
6842 is part of the ImageMagick color quantization routines. </p>
6843
6844 <p>Specify <var>cluster threshold</var> as the number of pixels in
6845 each cluster that must exceed the cluster threshold to be considered valid.
6846 <var>Smoothing threshold</var> eliminates noise in the second
6847 derivative of the histogram. As the value is increased, you can expect
6848 a smoother second derivative. The default is 1.5.</p>
6849
6850 <p>If the <a href="#verbose">-verbose</a> setting is defined, a detailed report
6851 of the color clusters is returned.</p>
6852
6853
6854 <div style="mx-auto my-3 text-center">
6855 <h2><a class="anchor" id="selective-blur"></a>-selective-blur <var>radius</var><br />-selective-blur <var>radius</var>{x<var>sigma</var>}{<var>+threshold</var>}</h2>
6856 </div>
6857
6858 <p class="lead">Selectively blur pixels within a contrast threshold.</p>
6859
6860 <p>Blurs those pixels that are less than or equal to the threshold in
6861 contrast. The threshold may be expressed as a fraction of <var>QuantumRange</var> or as a percentage.</p>
6862
6863 <p>The <var>sigma</var> value is the important argument, and
6864 determines the actual amount of blurring that will take place. </p>
6865
6866 <p>The <var>radius</var> is only used to determine the size of the
6867 array which holds the calculated Gaussian distribution. It should be an
6868 integer. If not given, or set to zero, IM will calculate the largest possible
6869 radius that will provide meaningful results for the Gaussian distribution.
6870 </p>
6871
6872
6873 <div style="mx-auto my-3 text-center">
6874 <h2><a class="anchor" id="separate"></a>-separate</h2>
6875 </div>
6876
6877 <p class="lead">Separate an image channel into a grayscale image. Specify the channel with <a href="#channel">-channel</a>.</p>
6878
6879 <div style="mx-auto my-3 text-center">
6880 <h2><a class="anchor" id="sepia-tone"></a>-sepia-tone <var>percent-threshold</var></h2>
6881 </div>
6882
6883 <p class="lead">Simulate a sepia-toned photo.</p>
6884
6885 <p>Specify <var>threshold</var> as the percent threshold of the intensity (0 - 99.9%).</p>
6886
6887 <p>This option applies a special effect to the image, similar to the effect
6888 achieved in a photo darkroom by sepia toning. Threshold ranges from 0 to <var>QuantumRange</var> and is a measure of the extent of the sepia
6889 toning. A threshold of 80% is a good starting point for a reasonable
6890 tone.</p>
6891
6892
6893
6894 <div style="mx-auto my-3 text-center">
6895 <h2><a class="anchor" id="set"></a>-set <var>key value</var></h2>
6896 <h2>+set <var>key</var></h2>
6897 </div>
6898
6899 <p class="lead">Sets image attributes and properties for images in the current image sequence.</p>
6900
6901 <p>This will assign (or modify) specific settings attached to all the images
6902 in the current image sequence. Using the <a href="#set">+set</a> form of the
6903 option will either remove, or reset that setting to a default state, as
6904 appropriate. </p>
6905
6906 <p>For example, it will modify specific well known image meta-data
6907 'attributes' such as those normally overridden by: the options <a
6908 href="#delay" >-delay</a>, <a href="#dispose" >-dispose</a>, and <a
6909 href="#page" >-page</a>, <a href="#colorspace" >-colorspace</a>; generally
6910 assigned before the image is read in, by using a <var>key</var> of
6911 the same name. </p>
6912
6913 <p>If the given <var>key</var> does not match a specific known
6914 'attribute ', such as shown above, the setting is stored as a free form
6915 'property' string. Such settings are listed in <a href="#verbose"
6916 >-verbose</a> information ("<code>info:</code>" output format) as "Properties".
6917 </p>
6918
6919 <p>This includes string 'properties' that are set by and assigned to images
6920 using the options <a href="#comment" >-comment</a>, <a href="#label"
6921 >-label</a>, <a href="#caption" >-caption</a>. These options actually assign
6922 a global 'artifact' which are automatically assigned (and any <a href="../escape/index.html" >Format Percent
6923 Escapes</a> expanded) to images as they are read in. For example:</p>
6924
6925 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><samp>$ magick rose: -set Comment 'Rose is a rose is a rose is a rose' rose.jpg
6926 identify -format %c rose.jpg
6927 Rose is a rose is a rose is a rose
6928 </samp></pre>
6929
6930 <p>The set value can also make use of <a href="../escape/index.html" >Format and Print Image
6931 Properties</a> in the defined value. For example:</p>
6932
6933 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><samp>$ magick rose: -set origsize '%wx%h' -resize 50% \
6934 -format 'Old size = %[origsize] New size = %wx%h' info:
6935 Old size = 70x46 New size = 35x23
6936 </samp></pre>
6937
6938 <p>Other well known 'properties' that are available include:
6939 <code>date:timestamp</code>, <code>date:create</code>,
6940 <code>date:modify</code>, and <code>signature</code>. </p>
6941
6942 <p>The <a href="#repage">-repage</a> operator will also allow you to modify
6943 the '<code>page</code>' attribute of an image for images already in memory (also
6944 see <a href="#repage">-page</a>). However it is designed to provide a finer
6945 control of the sub-parts of this 'attribute'. The <a href="#set">-set page</a>
6946 option will only provide a direct, unmodified assignment of '<code>page</code>'
6947 attribute. </p>
6948
6949 <p>This option can also associate a colorspace or profile with your image.
6950 For example,</p>
6951
6952 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick image.psd -set profile ISOcoated_v2_eci.icc image-icc.psd
6953 </samp></pre>
6954
6955 <p>Some 'properties' must be defined in a specific way to be used. For
6956 example only 'properties' prefixed with "<code>filename:</code>" can be used to
6957 modify the output filename of an image. For example</p>
6958
6959 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick rose: -set filename:mysize '%wx%h' 'rose_%[filename:mysize].png'
6960 </samp></pre>
6961
6962 <p>If the setting value is prefixed with "<code>option:</code>" the setting will
6963 be saved as a global "Artifact" exactly as if it was set using the <a
6964 href="#define" >-define</a> option. As such settings are global in scope, they
6965 can be used to pass 'attributes' and 'properties' of one specific image,
6966 in a way that allows you to use them in a completely different image, even if
6967 the original image has long since been modified or destroyed. For example: </p>
6968
6969 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick rose: -set option:rosesize '%wx%h' -delete 0 \
6970 label:'%[rosesize]' label_size_of_rose.gif"
6971 </samp></pre>
6972
6973 <p>Note that <a href="../escape/index.html"
6974 >Format Percent Escapes</a> will only match
6975 a 'artifact' if the given <var>key</var> does not match an existing
6976 'attribute' or 'property'. </p>
6977
6978 <p>You can set the attributes of the image registry by prefixing the value
6979 with <code>registry:</code>.</p>
6980
6981 <p>The <a href="#set">-set profile</a> option can also be used to inject
6982 previously-formatted ancillary chunks into the output PNG file, using
6983 the commandline option as shown below or by setting the profile via a
6984 programming interface:</p>
6985
6986 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick in.png -set profile PNG-chunk-x:&lt;filename&gt; out.png
6987 </samp></pre>
6988
6989 <p>where <var>x</var> is a location flag and
6990 <var>filename</var> is a file containing the chunk
6991 name in the first 4 bytes, then a colon (":"), followed by the chunk data.
6992 This encoder will compute the chunk length and CRC, so those must not
6993 be included in the file.</p>
6994
6995 <p>"x" can be "b" (before PLTE), "m" (middle, i.e., between PLTE and IDAT),
6996 or "e" (end, i.e., after IDAT). If you want to write multiple chunks
6997 of the same type, then add a short unique string after the "x" to prevent
6998 subsequent profiles from overwriting the preceding ones, e.g.,</p>
6999
7000
7001 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick in.png -set profile PNG-chunk-b01:file01 \
7002 -profile PNG-chunk-b02:file02 out.png
7003 </samp></pre>
7004
7005 <div style="mx-auto my-3 text-center">
7006 <h2><a class="anchor" id="shade"></a>-shade <var>azimuth</var>x<var>elevation</var></h2>
7007 </div>
7008
7009 <p class="lead">Shade the image using a distant light source.</p>
7010
7011 <p>Specify <var>azimuth</var> and <var>elevation</var> as
7012 the position of the light source. Use <a href="#shade">+shade</a> to return
7013 the shading results as a grayscale image.</p>
7014
7015 <div style="mx-auto my-3 text-center">
7016 <h2><a class="anchor" id="shadow"></a>-shadow <var>percent-opacity</var>{x<var>sigma</var>}{<var>+-</var>}<var>x</var>{<var>+-</var>}<var>y</var>{<var>%</var>}</h2>
7017 </div>
7018
7019 <p class="lead">Simulate an image shadow.</p>
7020
7021 <div style="mx-auto my-3 text-center">
7022 <h2><a
7023 id="shared-memory"></a>-shared-memory</h2>
7024 </div>
7025
7026 <p class="lead">Use shared memory.</p>
7027
7028 <p>This option specifies whether the utility should attempt to use shared
7029 memory for pixmaps. ImageMagick must be compiled with shared memory support,
7030 and the display must support the <var>MIT-SHM</var> extension.
7031 Otherwise, this option is ignored. The default is <code>True</code>.</p>
7032
7033 <div style="mx-auto my-3 text-center">
7034 <h2><a class="anchor" id="sharpen"></a>-sharpen <var>radius</var><br />-sharpen <var>radius</var>{x<var>sigma</var>}</h2>
7035 </div>
7036
7037 <p class="lead">Sharpen the image.</p>
7038
7039 <p>Use a Gaussian operator of the given radius and standard deviation (sigma).</p>
7040
7041 <p>The <var>sigma</var> value is the important argument, and
7042 determines the actual amount of sharpening that will take place. </p>
7043
7044 <p>The <var>radius</var> is only used to determine the size of the
7045 array which holds the calculated Gaussian distribution. It should be an
7046 integer. If not given, or set to zero, IM will calculate the largest possible
7047 radius that will provide meaningful results for the Gaussian distribution.
7048 </p>
7049
7050 <div style="mx-auto my-3 text-center">
7051 <h2><a class="anchor" id="shave"></a>-shave <var>geometry</var></h2>
7052 </div>
7053
7054 <p class="lead">Shave pixels from the image edges.</p>
7055
7056 <p>The <var>size</var> portion of the <var>geometry</var>
7057 argument specifies the width of the region to be removed from both sides of
7058 the image and the height of the regions to be removed from top and bottom.
7059 Offsets are ignored.</p>
7060
7061 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument.</p>
7062
7063 <div style="mx-auto my-3 text-center">
7064 <h2><a class="anchor" id="shear"></a>-shear <var>Xdegrees</var>[x<var>Ydegrees</var>]</h2>
7065 </div>
7066
7067 <p class="lead">Shear the image along the x-axis and/or y-axis.</p>
7068
7069 <p>The shear angles may be positive, negative, or zero. When <var>Ydegrees</var> is omitted it defaults to <var>Xdegrees</var>. When both angles are
7070 given, the horizontal component of the shear is performed before the vertical
7071 component.</p>
7072
7073 <p>Shearing slides one edge of an image along the x-axis or y-axis (i.e.,
7074 horizontally or vertically, respectively),creating a parallelogram. The amount
7075 of each is controlled by the respective shear angle. For horizontal shears,
7076 <var>Xdegrees</var> is measured clockwise relative to "up" (the
7077 negative y-axis), sliding the top edge to the right when 0°&lt;<var>Xdegrees</var>&lt;90° and to the left when 90°&lt;<var>Xdegrees</var>&lt;180°. For vertical shears <var>Ydegrees</var> is measured clockwise relative to "right" (the
7078 positive x-axis), sliding the right edge down when 0°&lt;<var>Ydegrees</var>&lt;90° and up when 90°&lt;<var>Ydegrees</var>&lt;180°.</p>
7079
7080 <p>Empty triangles left over from shearing the image are filled with the color
7081 defined by the <a href="#fill">-background</a> option. The color is specified
7082 using the format described under the <a href="#fill">-fill</a> option.</p>
7083
7084 <p>The horizontal shear is performed before the vertical part. This is
7085 important to note, since horizontal and vertical shears do not
7086 <var>commute</var>, i.e., the order matters in a sequence of shears. For
7087 example, the following two commands are not equivalent.</p>
7088
7089 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick logo: -shear 20x0 -shear 0x60 logo-sheared.png
7090 convert logo: -shear 0x60 -shear 20x0 logo-sheared.png
7091 </samp></pre>
7092
7093 <p>The first of the two commands above is equivalent to the following, except
7094 for the amount of empty space created; the command that follows generates
7095 a smaller image, and so is a better choice in terms of time and space.</p>
7096
7097 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick logo: -shear 20x60 logo-sheared.png
7098 </samp></pre>
7099
7100 <div style="mx-auto my-3 text-center">
7101 <h2><a class="anchor" id="sigmoidal-contrast"></a>-sigmoidal-contrast <var>contrast</var>x<var>mid-point</var></h2>
7102 </div>
7103
7104 <p class="lead">Increase the contrast without saturating highlights or shadows.</p>
7105
7106 <p>Increase the contrast of the image using a sigmoidal transfer function
7107 without saturating highlights or shadows. <var>Contrast</var>
7108 indicates how much to increase the contrast. For example, 0 is none, 3 is
7109 typical and 20 is a lot.
7110 </p>
7111
7112 <p>The <var>mid-point</var> indicates where the maximum change
7113 'slope' in contrast should fall in the resultant image (0 is white; 50% is
7114 middle-gray; 100% is black). </p>
7115
7116 <p>By default the image contrast is increased, use <var>+sigmoidal-contrast</var> to decrease the contrast.</p>
7117
7118 <p>To achieve the equivalent of a sigmoidal brightness change (similar to
7119 a gamma adjustment), you would use <var>-sigmoidal-contrast
7120 {brightness}x0%</var> to increase brightness and <var>+sigmoidal-contrast {brightness}x0%</var> to decrease brightness.
7121 Note the use of '0' fo rthe mid-point of the sigmoidal curve. </p>
7122
7123 <p>Using a very high <var>contrast</var> will produce a sort of
7124 'smoothed thresholding' of the image. Not as sharp (with high aliasing
7125 effects) of a true threshold, but with tapered gray-levels around the threshold
7126 <var>mid-point</var>. </p>
7127
7128 <div style="mx-auto my-3 text-center">
7129 <h2><a class="anchor" id="silent"></a>-silent</h2>
7130
7131
7132 </div>
7133
7134 <p class="lead">Operate silently. This option is only used
7135 by the <a href="../import/index.html">import</a> tool.</p>
7136
7137 <div style="mx-auto my-3 text-center">
7138 <h2><a class="anchor" id="similarity-threshold"></a>-similarity-threshold <var>value</var></h2>
7139 </div>
7140
7141 <p class="lead">Minimum RMSE for subimage match.</p>
7142
7143 <p>If this setting is used, then the search will stop as soon as it finds a match whose metric is less than or equal to the value. A partially filled second output image will result. Using a value of zero, will cause the search to stop at the first perfect match it finds. If this setting is left off, then the search will proceed to completion or as limited by <var>-dissimilarity-threshold</var>.</p>
7144
7145 <div style="mx-auto my-3 text-center">
7146 <h2><a class="anchor" id="size"></a>-size <var>width</var>[x<var>height</var>][<var>+offset</var>]</h2>
7147 </div>
7148
7149 <p class="lead">Set the width and height of the image.</p>
7150
7151 <p>Use this option to specify the width and height of raw images whose
7152 dimensions are unknown such as <code>GRAY</code>, <code>RGB</code>, or
7153 <code>CMYK</code>. In addition to width and height, use <a
7154 href="#size">-size</a> with an offset to skip any header information in the
7155 image or tell the number of colors in a <code>MAP</code> image file, (e.g. -size
7156 640x512+256).</p>
7157
7158 <p>For Photo CD images, choose from these sizes:</p>
7159
7160 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>192x128
7161 384x256
7162 768x512
7163 1536x1024
7164 3072x2048
7165 </code></pre>
7166
7167 <div style="mx-auto my-3 text-center">
7168 <h2><a class="anchor" id="sketch"></a>-sketch <var>radius</var><br />-sketch <var>radius</var>{x<var>sigma</var>}+<var>angle</var></h2>
7169 </div>
7170
7171 <p class="lead">Simulate a pencil sketch.</p>
7172
7173 <p>Sketch with the given radius, standard deviation (sigma), and angle. The
7174 angle given is the angle toward which the image is sketched. That is the
7175 direction people would consider the object is coming from. </p>
7176
7177 <div style="mx-auto my-3 text-center">
7178 <h2><a class="anchor" id="smush"></a>-smush <var>offset</var></h2>
7179 </div>
7180
7181 <p class="lead">Appends an image sequence together ignoring transparency.</p>
7182
7183 <p>Smush is a more flexible version of <a href="#append">-append</a>, joining the images in the sequence top-to-bottom (<a href="#smush">-smush</a>) or left-to-right (<a href="#smush">+smush</a>), with a gap between images according to the specified offset.</p>
7184
7185 <p>If the offset is negative, images will overlap by that amount.</p>
7186
7187 <p><a href="#smush">-smush</a> respects <a href="#gravity">-gravity</a>. Any empty space will be filled with the <a href="#background">-background</a> color.</p>
7188
7189 <p>For zero offset and transparent images, the non-transparent parts of the two images will be aligned as close as possible without overlapping.</p>
7190
7191 <div style="mx-auto my-3 text-center">
7192 <h2><a class="anchor" id="snaps"></a>-snaps <var>value</var></h2>
7193 </div>
7194
7195 <p class="lead">Set the number of screen snapshots.</p>
7196
7197 <p>Use this option to grab more than one image from the X server screen, to create an animation sequence.</p>
7198
7199 <div style="mx-auto my-3 text-center">
7200 <h2><a class="anchor" id="solarize"></a>-solarize <var>percent-threshold</var></h2>
7201 </div>
7202
7203 <p class="lead">Negate all pixels above the threshold level.</p>
7204
7205 <p>Specify <var>factor</var> as the percent threshold of the intensity (0 - 99.9%).</p>
7206
7207 <p>This option produces a <var>solarization</var> effect seen when
7208 exposing a photographic film to light during the development process.</p>
7209
7210 <div style="mx-auto my-3 text-center">
7211 <h2><a class="anchor" id="sort-pixels"></a>-sort-pixels</h2>
7212 </div>
7213
7214 <p class="lead">sorts pixels within each scanline in ascending order of intensity.</p>
7215
7216 <div style="mx-auto my-3 text-center">
7217 <h2><a class="anchor" id="sparse-color"></a>-sparse-color <var>method</var> '<var>x</var>,<var>y</var> <var>color</var> ...'</h2>
7218 </div>
7219
7220 <p class="lead"> color the given image using the specified points of color, and filling the other intervening colors using the given methods. </p>
7221
7222
7223 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
7224 <dl class="row">
7225 <dt class="col-md-4">barycentric</dt>
7226 <dd class="col-md-8">three point triangle of color given 3 points.
7227 Giving only 2 points will form a linear gradient between those points.
7228 The gradient generated extends beyond the triangle created by those
7229 3 points. </dd>
7230 <dt class="col-md-4">bilinear</dt>
7231 <dd class="col-md-8">Like barycentric but for 4 points. Less than 4 points
7232 fall back to barycentric. </dd>
7233 <dt class="col-md-4">voronoi</dt>
7234 <dd class="col-md-8">Simply map each pixel to the to nearest color point
7235 given. The result are polygonal 'cells' of solid color. </dd>
7236 <dt class="col-md-4">manhattan</dt>
7237 <dd class="col-md-8">Like voronoi, but resulting polygonal 'cells' are mapped to a fixed coordinate system.</dd>
7238 <dt class="col-md-4">shepards</dt>
7239 <dd class="col-md-8">Colors points biased on the ratio of inverse distance
7240 squared. Generating spots of color in a sea of the average of
7241 colors. </dd>
7242 <dt class="col-md-4">inverse</dt>
7243 <dd class="col-md-8">Colors points biased on the ratio of inverse distance.
7244 This generates sharper points of color rather than rounded spots of
7245 '<code>shepards</code>' Generating spots of color in a sea of the
7246 average of colors. </dd>
7247 </dl>
7248 </div>
7249
7250 <p>The points are placed according to the images location on the virtual
7251 canvas (<a href="#page" >-page</a> or <a href="#repage" >-repage</a>
7252 offset), and do not actually have to exist on the given image, but may be
7253 some point beyond the edge of the image. All points are floating point values.
7254 </p>
7255
7256 <p>Only the color channels defined by the <a href="#channel" >-channel</a> are
7257 modified, which means that by default matte/alpha transparency channel is not
7258 affected. Typically transparency channel is turned off either before or after
7259 the operation. </p>
7260
7261 <p>Of course if some color points are transparent to generate a transparent
7262 gradient, then the image also requires transparency enabled to store the
7263 values. </p>
7264
7265 <p>All the above methods when given a single point of color will replace all
7266 the colors in the image with the color given, regardless of the point. This is
7267 logical, and provides an alternative technique to recolor an image to some
7268 default value. </p>
7269
7270
7271 <div style="mx-auto my-3 text-center">
7272 <h2><a class="anchor" id="splice"></a>-splice <var>geometry</var></h2>
7273 </div>
7274
7275 <p class="lead">Splice the current background color into the image.</p>
7276
7277 <p>This will add rows and columns of the current <a
7278 href="#background">-background</a> color into the given image according to the
7279 given <a href="#gravity">-gravity</a> geometry setting. See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument. Essentially <a href="#splice">-splice</a> will divide the
7280 image into four quadrants, separating them by the inserted rows and columns.
7281 </p>
7282
7283 <p>If a dimension of geometry is zero no rows or columns will be added for that
7284 dimension. Similarly using a zero offset with the appropriate <a
7285 href="#gravity">-gravity</a> setting will add rows and columns to the edges of
7286 the image, padding the image only along that one edge. Edge padding is what <a
7287 href="#splice">-splice</a> is most commonly used for. </p>
7288
7289 <p>If the exact same <var>geometry</var> and <a
7290 href="#gravity">-gravity</a> is later used with <a href="#chop">-chop</a> the
7291 added all splices removed. </p>
7292
7293 <div style="mx-auto my-3 text-center">
7294 <h2><a class="anchor" id="spread"></a>-spread <var>amount</var></h2>
7295 </div>
7296
7297 <p class="lead">Displace image pixels by a random amount.</p>
7298
7299 <p>The argument <var>amount</var> defines the size of the
7300 neighborhood around each pixel from which to choose a candidate pixel to
7301 blend.</p>
7302
7303 <p>The lookup is controlled by the <a href="#interpolate">-interpolate</a> setting.</p>
7304
7305 <div style="mx-auto my-3 text-center">
7306 <h2><a class="anchor" id="statistic"></a>-statistic <var>type</var> <var>geometry</var></h2>
7307 </div>
7308
7309 <p class="lead">Replace each pixel with corresponding statistic from the neighborhood.</p>
7310
7311 <p>Choose from these statistic types:</p>
7312
7313 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
7314 <dl class="row">
7315 <dt class="col-md-4">Contrast</dt><dd class="col-md-8">maximum difference (max - min) divided by (max + min) value in neighborhood</dd>
7316 <dt class="col-md-4">Maximum</dt><dd class="col-md-8">maximum value per channel in neighborhood</dd>
7317 <dt class="col-md-4">Gradient</dt><dd class="col-md-8">maximum difference (max - min) value in neighborhood</dd>
7318 <dt class="col-md-4">Maximum</dt><dd class="col-md-8">maximum value per channel in neighborhood</dd>
7319 <dt class="col-md-4">Minimum</dt><dd class="col-md-8">minimum value per channel in neighborhood</dd>
7320 <dt class="col-md-4">Mean</dt><dd class="col-md-8">average value per channel in neighborhood</dd>
7321 <dt class="col-md-4">Median</dt><dd class="col-md-8">median value per channel in neighborhood</dd>
7322 <dt class="col-md-4">Mode</dt><dd class="col-md-8">mode (most frequent) value per channel in neighborhood</dd>
7323 <dt class="col-md-4">Nonpeak</dt><dd class="col-md-8">value just before or after the median value per channel in neighborhood</dd>
7324 <dt class="col-md-4">RMS</dt><dd class="col-md-8">root mean square value per channel in neighborhood</dd>
7325 <dt class="col-md-4">StandardDeviation</dt><dd class="col-md-8"> standard deviation value per channel in neighborhood</dd>
7326 </dl>
7327 </div>
7328
7329 <div style="mx-auto my-3 text-center">
7330 <h2><a class="anchor" id="stegano"></a>-stegano <var>offset</var></h2>
7331 </div>
7332
7333 <p class="lead">Hide watermark within an image.</p>
7334
7335 <p>Use an offset to start the image hiding some number of pixels from the
7336 beginning of the image. Note this offset and the image size. You will need
7337 this information to recover the steganographic image (e.g. display -size
7338 320x256+35 stegano:image.png).</p>
7339
7340 <div style="mx-auto my-3 text-center">
7341 <h2><a class="anchor" id="stereo"></a>-stereo <var>+x</var>{<var>+y</var>}</h2>
7342 </div>
7343
7344 <p class="lead">Composite two images to create a red / cyan stereo anaglyph.</p>
7345
7346 <p>The left side of the stereo pair (second image) is saved as the red channel of the output image. The right side (first image) is saved as the green and blue channels. Red-green stereo glasses are required to properly view the stereo image.</p>
7347
7348 <div style="mx-auto my-3 text-center">
7349 <h2><a class="anchor" id="storage-type"></a>-storage-type <var>type</var></h2>
7350 </div>
7351
7352 <p class="lead">Pixel storage type. Here are the valid types:</p>
7353
7354 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
7355 <dl class="row">
7356 <dt class="col-md-4">char</dt><dd class="col-md-8">unsigned characters</dd>
7357 <dt class="col-md-4">double</dt><dd class="col-md-8">doubles</dd>
7358 <dt class="col-md-4">float</dt><dd class="col-md-8">floats</dd>
7359 <dt class="col-md-4">integer</dt><dd class="col-md-8">integers</dd>
7360 <dt class="col-md-4">long</dt><dd class="col-md-8">longs</dd>
7361 <dt class="col-md-4">quantum</dt><dd class="col-md-8">pixels in the native depth of your ImageMagick distribution</dd>
7362 <dt class="col-md-4">short</dt><dd class="col-md-8">unsigned shorts</dd>
7363 </dl>
7364 </div>
7365
7366 <p>Float and double types are normalized from 0.0 to 1.0 otherwise the pixels
7367 values range from 0 to the maximum value the storage type can support.</p>
7368
7369 <div style="mx-auto my-3 text-center">
7370 <h2><a class="anchor" id="stretch"></a>-stretch <var>fontStretch</var></h2>
7371 </div>
7372
7373 <p class="lead">Set a type of stretch style for fonts.</p>
7374
7375 <p>This setting suggests a type of stretch that ImageMagick should try to
7376 apply to the currently selected font family. Select <var>fontStretch</var> from the following.</p>
7377
7378 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>Any
7379 Condensed
7380 Expanded
7381 ExtraCondensed
7382 ExtraExpanded
7383 Normal
7384 SemiCondensed
7385 SemiExpanded
7386 UltraCondensed
7387 UltraExpanded
7388 </code></pre>
7389
7390 <p>To print a complete list of stretch types, use <a href="#list">-list
7391 stretch</a>.</p>
7392
7393 <p>For other settings that affect fonts, see the options <a
7394 href="#font">-font</a>, <a href="#family">-family</a>, <a
7395 href="#style">-style</a>, and <a href="#weight">-weight</a>. </p>
7396
7397 <div style="mx-auto my-3 text-center">
7398 <h2><a class="anchor" id="strip"></a>-strip</h2>
7399 </div>
7400
7401 <p class="lead">Strip the image of any profiles, comments or these PNG chunks: bKGD,cHRM,EXIF,gAMA,iCCP,iTXt,sRGB,tEXt,zCCP,zTXt,date. To remove the orientation chunk, <code>orNT</code>, set the orientation to undefined, e.g., <code>-orient Undefined</code>.</p>
7402
7403 <div style="mx-auto my-3 text-center">
7404 <h2><a class="anchor" id="stroke"></a>-stroke <var>color</var></h2>
7405 </div>
7406
7407 <p class="lead">Color to use when stroking a graphic primitive.</p>
7408
7409 <p>The color is specified using the format described under the <a href="#fill">-fill</a> option.</p>
7410
7411 <p>See <a href="#draw">-draw</a> for further details.</p>
7412
7413 <div style="mx-auto my-3 text-center">
7414 <h2><a class="anchor" id="strokewidth"></a>-strokewidth <var>value</var></h2>
7415 </div>
7416
7417 <p class="lead">Set the stroke width.</p>
7418
7419 <p>See <a href="#draw">-draw</a> for further details.</p>
7420
7421 <div style="mx-auto my-3 text-center">
7422 <h2><a class="anchor" id="style"></a>-style <var>fontStyle</var></h2>
7423 </div>
7424
7425 <p class="lead">Set a font style for text.</p>
7426
7427 <p>This setting suggests a font style that ImageMagick should try to apply to
7428 the currently selected font family. Select <var>fontStyle</var> from
7429 the following.</p>
7430
7431 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>Any
7432 Italic
7433 Normal
7434 Oblique
7435 </code></pre>
7436
7437 <p>For other settings that affect fonts, see the options <a
7438 href="#font">-font</a>, <a href="#family">-family</a>, <a
7439 href="#stretch">-stretch</a>, and <a href="#weight">-weight</a>. </p>
7440
7441 <div style="mx-auto my-3 text-center">
7442 <h2><a class="anchor" id="subimage-search"></a>-subimage-search</h2>
7443 </div>
7444
7445 <p class="lead">Search for subimage.</p>
7446
7447 <p>This option enables the <code>compare</code> function to search for the best match location of a small image within a larger image. The search process generates either one or two output images (or frames), depending on whether the metric is accelerated.</p>
7448 <ul>
7449 <li>The first output is the <strong>difference</strong> image.</li>
7450 <li>The second output, if present, is the <strong>similarity score</strong> image.</li>
7451 </ul>
7452 <p>When utilizing the HDRI-enabled compile of ImageMagick and the FFTW delegate is installed, specific metrics—<strong>NCC</strong>, <strong>MSE</strong>, <strong>RMSE</strong>, <strong>PSNR</strong>, <strong>PHASE</strong>, and <strong>DPC</strong>—are automatically accelerated using FFT (Fast Fourier Transform) processing. This is the default behavior. However, by using the flag <code>-define compare:frequency-domain=false</code>, you can disable FFT acceleration and instead opt for the slower spatial domain processing, if desired.</p>
7453 <p>The <strong>similarity score</strong> image matches the dimensions of the larger image. Each pixel in this output represents a potential position for the top-left corner of the small image within the larger one. The brightest spot in the similarity image corresponds to the best match location. For FFT-accelerated metrics, the similarity score at this position is also displayed in square brackets alongside the match coordinates.</p>
7454 <p>It is important to note that the best match in the similarity image does not necessarily imply a perfect match. The actual brightness of the peak reflects the quality of the match. Additionally, other bright peaks in the similarity image may indicate alternate potential matching locations.</p>
7455 <p>Metrics differ in their definition of a <i>perfect match</i>. For metrics like <strong>MSE</strong>, <strong>RMSE</strong>, <strong>PSNR</strong> (<strong>MAE</strong>, <strong>FUZZ</strong>, <strong>DSIM</strong>, and <strong>PHASH</strong>), a perfect match has a value of 0. Conversely, metrics such as <strong>NCC</strong>, <strong>PHASE</strong>, <strong>DPC</strong>, <strong>AE</strong>, <strong>PDC</strong>, <strong>PAE</strong>, <strong>MEPP</strong>, and <strong>SSIM</strong> define a perfect match as 1. To maintain consistency, for metrics where the perfect match is 0, the similarity image is inverted, ensuring that the best match location appears as the brightest point, just as it does for metrics with a perfect match at 1. </p>
7456
7457 <div style="mx-auto my-3 text-center">
7458 <h2><a class="anchor" id="swap"></a>-swap <var>index,index</var></h2>
7459 </div>
7460
7461 <p class="lead">Swap the positions of two images in the image sequence.</p>
7462
7463 <p>For example, <a href="#swap">-swap 0,2</a> swaps the first and the third
7464 images in the current image sequence. Use <a href="#swap">+swap</a> to switch
7465 the last two images in the sequence.</p>
7466
7467 <div style="mx-auto my-3 text-center">
7468 <h2><a class="anchor" id="swirl"></a>-swirl <var>degrees</var></h2>
7469 </div>
7470
7471 <p class="lead">Swirl image pixels about the center.</p>
7472
7473 <p><var>Degrees</var> defines the tightness of the swirl.</p>
7474
7475 <div style="mx-auto my-3 text-center">
7476 <h2><a class="anchor" id="synchronize"></a>-synchronize</h2>
7477 </div>
7478
7479 <p class="lead">Synchronize image to storage device.</p>
7480
7481 <p>Set to "true" to ensure all image data is fully flushed and synchronized
7482 to disk. There is a performance penalty, but the benefits include ensuring a
7483 valid image file in the event of a system crash and early reporting if there
7484 is not enough disk space for the image pixel cache.</p>
7485
7486 <div style="mx-auto my-3 text-center">
7487 <h2><a class="anchor" id="taint"></a>-taint</h2>
7488 </div>
7489
7490 <p class="lead">Mark the image as modified.</p>
7491
7492 <div style="mx-auto my-3 text-center">
7493 <h2><a class="anchor" id="text-font"></a>-text-font <var>name</var></h2>
7494 </div>
7495
7496 <p class="lead">Font for writing fixed-width text.</p>
7497
7498 <p>Specifies the name of the preferred font to use in fixed (typewriter style)
7499 formatted text. The default is 14 point <var>Courier</var>.</p>
7500
7501 <p>You can tag a font to specify whether it is a PostScript, TrueType, or
7502 X11 font. For example, <code>Courier.ttf</code> is a TrueType font and
7503 <code>x:fixed</code> is X11.</p>
7504
7505 <div style="mx-auto my-3 text-center">
7506 <h2><a class="anchor" id="texture"></a>-texture <var>filename</var></h2>
7507 </div>
7508
7509 <p class="lead">Name of texture to tile onto the image background.</p>
7510
7511 <div style="mx-auto my-3 text-center">
7512 <h2><a class="anchor" id="threshold"></a>-threshold <var>value</var>{<var>%</var>}</h2>
7513 </div>
7514
7515 <!-- {<var>green,blue,opacity</var>}
7516 <p>If the green or blue value is omitted, these channels use the same value as
7517 the first one provided. If all three color values are the same, the result is
7518 a bi-level image. If the opacity threshold is omitted, OpaqueOpacity is used
7519 and any partially transparent pixel becomes fully transparent.</p>
7520 -->
7521
7522 <p class="lead">Apply simultaneous black/white threshold to the image.</p>
7523
7524 <p>Any pixel values (more specifically, those channels set using <a href="#channel">-channel</a>
7525 that exceed the specified threshold are reassigned the
7526 maximum channel value, while all other values are assigned the minimum.</p>
7527
7528 <p> The threshold value can be given as a percentage or as an absolute integer
7529 value corresponding to the desired channel value. When given as an integer,
7530 the minimum attainable value is 0 (corresponding to black when all channels
7531 are affected), but the maximum value (corresponding to white) is that of the
7532 <code>quantum depth</code> of the particular build of ImageMagick, and is
7533 therefore dependent on the installation. For that reason, a reasonable
7534 recommendation for most applications is to specify the threshold values as
7535 a percentage. </p>
7536
7537 <p> The following would force pixels with red values above 50% to have 100%
7538 red values, while those at or below 50% red would be set to 0 in the red
7539 channel. The green, blue, and alpha channels (if present) would be unchanged.
7540 </p>
7541
7542 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick in.png -channel red -threshold 50% out.png
7543 </samp></pre>
7544
7545 <p>As (possibly) impractical but instructive examples, the following would
7546 generate an all-black and an all-white image with the same dimensions as the
7547 input image.</p>
7548
7549
7550 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick in.png -channel RGB -threshold 100% black.png
7551 convert in.png -channel RGB -threshold -1 white.png
7552 </samp></pre>
7553
7554 <p> See also <a href="#black-threshold">-black-threshold</a> and <a href="#white-threshold">-white-threshold</a>.
7555 </p>
7556
7557 <div style="mx-auto my-3 text-center">
7558 <h2><a class="anchor" id="thumbnail"></a>-thumbnail <var>geometry</var></h2>
7559 </div>
7560
7561 <p class="lead">Create a thumbnail of the image.</p>
7562
7563 <p>This is similar to <a href="#resize">-resize</a>, except it is optimized
7564 for performance. In addition, comments and color profiles are removed, and <code>Thumb</code> properties are set. This option respects <a href="#filter">-filter</a>, e.g., for additional performance but with a slight degradation in quality, use <code>-filter box</code>.</p>
7565
7566 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument.</p>
7567
7568 <div style="mx-auto my-3 text-center">
7569 <h2><a class="anchor" id="tile"></a>-tile <var>filename</var></h2>
7570 </div>
7571
7572 <p class="lead">Set the tile image used for filling a subsequent graphic primitive.</p>
7573
7574 <div style="mx-auto my-3 text-center">
7575 <h2>-tile <var>geometry</var></h2>
7576 </div>
7577
7578 <p class="lead">Specify the layout of images.</p>
7579
7580 <p>See <a href="../command-line-processing/index.html#geometry">Image Geometry</a> for complete details about the <em class="arg">geometry</em> argument.</p>
7581
7582 <div style="mx-auto my-3 text-center">
7583 <h2>-tile</h2>
7584 </div>
7585
7586 <p class="lead">Specifies that a subsequent composite operation is repeated across and down image.</p>
7587
7588 <div style="mx-auto my-3 text-center">
7589 <h2><a class="anchor" id="tile-offset"></a>-tile-offset {<var>+-</var>}<var>x</var>{<var>+-</var>}<var>y</var></h2>
7590 </div>
7591
7592 <p class="lead">Specify the offset for tile images, relative to the background image it is tiled on.</p>
7593
7594 <p>This should be set before the tiling image is set by <a href="#tile"
7595 >-tile</a> or <a href="#texture" >-texture</a>, or directly applied for
7596 creating a tiled canvas using <code>TILE:</code> or <code>PATTERN:</code> input
7597 formats. </p>
7598
7599 <p>Internally ImageMagick does a <a href="#roll" >-roll</a> of the tile image
7600 by the arguments given when the tile image is set. </p>
7601
7602 <div style="mx-auto my-3 text-center">
7603 <h2><a class="anchor" id="tint"></a>-tint <var>value</var></h2>
7604 </div>
7605
7606 <p class="lead">Tint the image with the fill color.</p>
7607
7608 <p>Tint the image with the fill color.</p>
7609
7610 <p>Specify the amount of tinting as a percentage. Pure colors like black,
7611 white red, yellow, will not be affected by -tint. Only mid-range colors such
7612 as the various shades of grey.</p>
7613
7614 <div style="mx-auto my-3 text-center">
7615 <h2><a class="anchor" id="title"></a>-title <var>string</var></h2>
7616 </div>
7617
7618 <p class="lead">Assign a title to displayed image.", "animate", "display", "montage</p>
7619
7620 <p>Use this option to assign a specific title to the image. This assigned to
7621 the image window and is typically displayed in the window title bar.
7622 Optionally you can include the image filename, type, width, height, Exif data,
7623 or other image attribute by embedding special format characters described
7624 under the <a href="#format">-format</a> option.</p>
7625
7626 <p>For example,</p>
7627
7628 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>-title "%m:%f %wx%h"
7629 </code></pre>
7630
7631 <p>produces an image title of <code>MIFF:bird.miff 512x480</code> for an image
7632 titled <code>bird.miff</code> and whose width is 512 and height is 480.</p>
7633
7634
7635 <div style="mx-auto my-3 text-center">
7636 <h2><a class="anchor" id="transform"></a>-transform</h2>
7637 </div>
7638
7639 <p class="lead">Transform the image.</p>
7640
7641 <p>This option applies the transformation matrix from a previous <a href="#affine">-affine</a> option.</p>
7642
7643 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick -affine 2,2,-2,2,0,0 -transform bird.ppm bird.jpg
7644 </samp></pre>
7645
7646
7647 <p>This operator has been now been superseded by the <a
7648 href="#distort">-distort</a> '<code>AffineProjection</code>' method. </p>
7649
7650
7651 <div style="mx-auto my-3 text-center">
7652 <h2><a class="anchor" id="transparent"></a>-transparent <var>color</var></h2>
7653 </div>
7654
7655 <p class="lead">Make this color transparent within the image.</p>
7656
7657 <p>The <var>color</var> argument is defined using the format
7658 described under the <a href="#fill">-fill</a> option. The <a href="#fuzz"
7659 >-fuzz</a> setting can be used to match and replace colors similar to the one
7660 given. </p>
7661
7662 <p>Use <a href="#transparent" >+transparent</a> to invert the pixels matched.
7663 that is make all non-matching colors transparent. </p>
7664
7665 <p>The <a href="#opaque">-opaque</a> operator is exactly the same as <a
7666 href="#transparent" >-transparent</a> but replaces the matching color with the
7667 current <a href="#fill">-fill</a> color setting, rather than transparent.
7668 However the <a href="#transparent" >-transparent</a> operator also ensures
7669 that the image has an alpha channel enabled, as per "<code><a href="#alpha"
7670 >-alpha</a> set</code>", and does not require you to modify the <a
7671 href="#channel">-channel</a> to enable alpha channel handling. </p>
7672
7673 <p>Note that this does not define the color as being the 'transparency color'
7674 used for color-mapped image formats, such as GIF. For that use <a
7675 href="#transparent-color" >-transparent-color</a> </p>
7676
7677
7678 <div style="mx-auto my-3 text-center">
7679 <h2><a class="anchor" id="transparent-color"></a>-transparent-color <var>color</var></h2>
7680 </div>
7681
7682 <p class="lead">Set the transparent color.</p>
7683
7684 <p>Sometimes this is used for saving to image formats such as
7685 GIF and PNG8 which uses this color to represent boolean transparency. This
7686 does not make a color transparent, it only defines what color the transparent
7687 color is in the color palette of the saved image. Use <a
7688 href="#transparent">-transparent</a> to make an opaque color transparent.</p>
7689
7690 <p>This option allows you to have both an opaque visible color, as well as a
7691 transparent color of the same color value without conflict. That is, you can
7692 use the same color for both the transparent and opaque color areas within an
7693 image. This, in turn, frees to you to select a transparent color that is
7694 appropriate when an image is displayed by an application that does not handle a
7695 transparent color index, while allowing ImageMagick to correctly handle images of this
7696 type. </p>
7697
7698 <p>The default transparent color is <code>#00000000</code>, which is fully transparent black.</p>
7699
7700 <div style="mx-auto my-3 text-center">
7701 <h2><a class="anchor" id="transpose"></a>-transpose</h2>
7702 </div>
7703
7704 <p class="lead">Mirror the image along the top-left to bottom-right diagonal.</p>
7705
7706 <p> This option mathematically transposes the pixel array. It is equivalent to the sequence <code>-flip -rotate 90</code>.
7707 </p>
7708
7709 <div style="mx-auto my-3 text-center">
7710 <h2><a class="anchor" id="transverse"></a>-transverse</h2>
7711 </div>
7712
7713 <p class="lead">Mirror the image along the images bottom-left top-right diagonal. Equivalent to the operations <code>-flop -rotate 90</code>.</p>
7714
7715
7716 <div style="mx-auto my-3 text-center">
7717 <h2><a class="anchor" id="treedepth"></a>-treedepth <var>value</var></h2>
7718 </div>
7719
7720 <p class="lead">Tree depth for the color reduction algorithm.</p>
7721
7722 <p>Normally, this integer value is zero or one. A value of zero or one causes
7723 the use of an optimal tree depth for the color reduction algorithm.</p>
7724
7725 <p>An optimal depth generally allows the best representation of the source
7726 image with the fastest computational speed and the least amount of memory.
7727 However, the default depth is inappropriate for some images. To assure the
7728 best representation, try values between 2 and 8 for this parameter. Refer to
7729 the <a href="../quantize/index.html"
7730 >color reduction algorithm</a> for more details.</p>
7731
7732 <p>The <a href="#colors">-colors</a> or <a href="#monochrome">-monochrome</a>
7733 option, or writing to an image format which requires color reduction, is
7734 required for this option to take effect.</p>
7735
7736 <div style="mx-auto my-3 text-center">
7737 <h2><a class="anchor" id="trim"></a>-trim</h2>
7738 </div>
7739
7740 <p class="lead">Trim an image.</p>
7741
7742 <p>This option removes any edges that are exactly the same color as the corner
7743 pixels. Use <a href="#fuzz">-fuzz</a> to make <a href="#trim">-trim</a> remove
7744 edges that are nearly the same color as the corner pixels.</p>
7745
7746 <p>The page or virtual canvas information of the image is preserved allowing
7747 you to extract the result of the <a href="#trim">-trim</a> operation from the
7748 image. Use a <a href="#repage">+repage</a> to remove the virtual canvas page
7749 information if it is unwanted.</p>
7750
7751 <p>If the trimmed image 'disappears' a warning is produced, and a special
7752 single pixel transparent 'missed' image is returned, in the same way as when a
7753 <a href="#crop">-crop</a> operation 'misses' the image proper. </p>
7754
7755 <p>Use <code><a href="#define">-define</a> trim:percent-background=0%</code> to
7756 remove all the background from the image. The amount of background that is
7757 tolerated in an edge specified as a percent. 0% means no background is tolerated.
7758 50% means an edge can contain up to 50% pixels that are background per the fuzz-factor.</p>
7759
7760 <p>Use <code><a href="#define">-define</a> trim:edges={north,east,south,west}</code> separated by commas to only trim the specified edges of the image, e.g. <code>-define trim:edges=north,south -fuzz 5% -trim</code>.</p>
7761
7762 <p>Use <code><a href="#define">-define</a> trim:minSize=<var>geometry</var></code> limit the trim to the specified size.</p>
7763
7764 <p>Use <code><a href="#background">-background</a> <em>background-color</em></code> to
7765 identify background color surrounding the region of interest.</p>
7766
7767 <p>Fully transparent pixels are typically treated as if they lack color or that their color is irrelevant. When comparing two pixels that are both fully transparent, they are often considered equal. This means that any attributes related to their color are disregarded in the evaluation process.</p>
7768
7769 <div style="mx-auto my-3 text-center">
7770 <h2><a class="anchor" id="type"></a>-type <var>type</var></h2>
7771 </div>
7772
7773 <p class="lead">The image type.</p> <p>Choose from: <code>Bilevel</code>,
7774 <code>Grayscale</code>, <code>GrayscaleAlpha</code>, <code>Palette</code>,
7775 <code>PaletteAlpha</code>, <code>TrueColor</code>, <code>TrueColorAlpha</code>,
7776 <code>ColorSeparation</code>, or <code>ColorSeparationAlpha</code>.</p>
7777
7778 <p>Normally, when a format supports different subformats such as grayscale and
7779 truecolor, the encoder will try to choose an efficient subformat. The <a
7780 href="#type">-type</a> option can be used to override this behavior. For
7781 example, to prevent a JPEG from being written in grayscale format even though
7782 only gray pixels are present, use.</p>
7783
7784 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary cli"><samp>$ magick bird.png -type TrueColor bird.jpg
7785 </samp></pre>
7786
7787 <p>Similarly, use <a href="#type">-type TrueColorAlpha</a> to force the
7788 encoder to write an alpha channel even though the image is opaque, if the
7789 output format supports transparency.</p>
7790
7791 <p>Use <a href="#type">-type optimize</a> to ensure the image is written in the smallest possible file size.</p>
7792
7793 <div style="mx-auto my-3 text-center">
7794 <h2><a class="anchor" id="undercolor"></a>-undercolor <var>color</var></h2>
7795 </div>
7796
7797 <p class="lead">Set the color of the annotation bounding box.</p>
7798
7799 <p>The color is specified using the format described under the <a href="#fill">-fill</a> option.</p>
7800
7801 <p>See <a href="#draw">-draw</a> for further details.</p>
7802
7803
7804 <div style="mx-auto my-3 text-center">
7805 <h2><a class="anchor" id="update"></a>-update <var>seconds</var></h2>
7806 </div>
7807
7808 <p class="lead">Detect when image file is modified and redisplay.</p>
7809
7810 <p>Suppose that while you are displaying an image the file that is currently
7811 displayed is over-written. <code>display</code> will automagically detect that
7812 the input file has been changed and update the displayed image
7813 accordingly.</p>
7814
7815
7816 <div style="mx-auto my-3 text-center">
7817 <h2><a class="anchor" id="unique-colors"></a>-unique-colors</h2>
7818 </div>
7819
7820 <p class="lead">Discard all but one of any pixel color.</p>
7821
7822
7823 <div style="mx-auto my-3 text-center">
7824 <h2><a class="anchor" id="units"></a>-units <var>type</var></h2>
7825 </div>
7826
7827 <p class="lead">The units of image resolution.</p>
7828
7829 <p>Choose from: <code>Undefined</code>, <code>PixelsPerInch</code>, or
7830 <code>PixelsPerCentimeter</code>. This option is normally used in conjunction
7831 with the <a href="#density">-density</a> option.</p>
7832
7833
7834 <div style="mx-auto my-3 text-center">
7835 <h2><a class="anchor" id="unsharp"></a>-unsharp <var>radius</var><br />-unsharp <var>radius</var>{x<var>sigma</var>}{<var>+gain</var>}{<var>+threshold</var>}</h2>
7836 </div>
7837
7838 <p class="lead">Sharpen the image with an unsharp mask operator.</p>
7839
7840 <p>The <a href="#unsharp">-unsharp</a> option sharpens an image. The image is
7841 convolved with a Gaussian operator of the given radius and standard deviation
7842 (sigma). For reasonable results, radius should be larger than sigma. Use
7843 a radius of 0 to have the method select a suitable radius.</p>
7844
7845 <p>The <var>sigma</var> value is the important argument, and
7846 determines the actual amount of sharpening that will take place. </p>
7847
7848 <p>The <var>radius</var> is only used to determine the size of the
7849 array which holds the calculated Gaussian distribution. It should be an
7850 integer. If not given, or set to zero, IM will calculate the largest possible
7851 radius that will provide meaningful results for the Gaussian distribution.
7852 </p>
7853
7854 <p>The parameters are:</p>
7855
7856 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
7857 <dl class="row">
7858 <dt class="col-md-4">radius</dt>
7859 <dd class="col-md-8">The radius of the Gaussian, in pixels, not counting the center pixel (default 0).</dd>
7860 <dt class="col-md-4">sigma</dt>
7861 <dd class="col-md-8">The standard deviation of the Gaussian, in pixels (default 1.0).</dd>
7862 <dt class="col-md-4">gain</dt>
7863 <dd class="col-md-8">The fraction of the difference between the original and the blur image that is added back into the original (default 1.0).</dd>
7864 <dt class="col-md-4">threshold</dt>
7865 <dd class="col-md-8">The threshold, as a fraction of <var>QuantumRange</var>, needed to apply the difference amount (default 0.05).</dd>
7866 </dl>
7867 </div>
7868
7869 <div style="mx-auto my-3 text-center">
7870 <h2><a class="anchor" id="verbose"></a>-verbose</h2>
7871 </div>
7872
7873 <p class="lead">Print detailed information about the image when this option precedes the <a href="#identify">-identify</a> option or <code>info:</code>.</p>
7874
7875
7876 <div style="mx-auto my-3 text-center">
7877 <h2><a class="anchor" id="version"></a>-version</h2>
7878 </div>
7879
7880 <p class="lead">Print ImageMagick version string and exit.</p>
7881
7882
7883 <div style="mx-auto my-3 text-center">
7884 <h2><a class="anchor" id="view"></a>-view <var>string</var></h2>
7885 </div>
7886
7887 <p class="lead">FlashPix viewing parameters.</p>
7888
7889
7890 <div style="mx-auto my-3 text-center">
7891 <h2><a class="anchor" id="vignette"></a>-vignette <var>radius</var>{x<var>sigma</var>}{<var>+-</var>}<var>x</var>{<var>+-</var>}<var>y</var>{<var>%</var>}</h2>
7892 </div>
7893
7894 <p class="lead">Soften the edges of the image in vignette style.</p>
7895
7896 <p>The vignette effect rolloff is controlled by radiusxsigma. For nominal rolloff, this would be set to 0xsigma. A value of 0x0 will produce a circle/ellipse with no rolloff. The arguments x and y control the size of the circle. Larger values decrease the radii and smaller values increase the radii. Values of +0+0 will generate a circle/ellipse the same size as the image. The default values for x and y are 10% of the corresponding image dimension. Thus, the radii will be decreased by 10%, i.e., the diameters of the circle/ellipse will be 80% of the corresponding image dimension. Note, the percent symbol in a geometry affects <var>x</var> and <var>y</var>, whereas <var>radius</var> and <var>sigma</var> are absolute (e.g., <code>-vignette "0x2+10%+10%"</code>).</p>
7897
7898 <div style="mx-auto my-3 text-center">
7899 <h2><a class="anchor" id="virtual-pixel"></a>-virtual-pixel <var>method</var></h2>
7900 </div>
7901
7902 <p class="lead">Specify contents of <var>virtual pixels</var>.</p>
7903
7904 <p>This option defines what color source should be used if and when a color
7905 lookup completely 'misses' the source image. The color(s) that appear to
7906 surround the source image. Generally this color is derived from the source
7907 image, but could also be set to a specify background color. </p>
7908
7909 <p>Choose from these methods:</p>
7910
7911 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
7912 <dl class="row">
7913 <dt class="col-md-4">background</dt><dd class="col-md-8">the area surrounding the image is the background color</dd>
7914 <dt class="col-md-4">black</dt><dd class="col-md-8">the area surrounding the image is black</dd>
7915 <dt class="col-md-4">checker-tile</dt><dd class="col-md-8">alternate squares with image and background color</dd>
7916 <dt class="col-md-4">dither</dt><dd class="col-md-8">non-random 32x32 dithered pattern</dd>
7917 <dt class="col-md-4">edge</dt><dd class="col-md-8">extend the edge pixel toward infinity</dd>
7918 <dt class="col-md-4">gray</dt><dd class="col-md-8">the area surrounding the image is gray</dd>
7919 <dt class="col-md-4">horizontal-tile</dt><dd class="col-md-8">horizontally tile the image, background color above/below</dd>
7920 <dt class="col-md-4">horizontal-tile-edge</dt><dd class="col-md-8">horizontally tile the image and replicate the side edge pixels</dd>
7921 <dt class="col-md-4">mirror</dt><dd class="col-md-8">mirror tile the image</dd>
7922 <dt class="col-md-4">random</dt><dd class="col-md-8">choose a random pixel from the image</dd>
7923 <dt class="col-md-4">tile</dt><dd class="col-md-8">tile the image (default)</dd>
7924 <dt class="col-md-4">transparent</dt><dd class="col-md-8">the area surrounding the image is transparent blackness</dd>
7925 <dt class="col-md-4">vertical-tile</dt><dd class="col-md-8">vertically tile the image, sides are background color</dd>
7926 <dt class="col-md-4">vertical-tile-edge</dt><dd class="col-md-8">vertically tile the image and replicate the side edge pixels</dd>
7927 <dt class="col-md-4">white</dt><dd class="col-md-8">the area surrounding the image is white</dd>
7928 </dl>
7929 </div>
7930
7931 <p>The default value is "edge".</p>
7932
7933 <p>This most important for distortion operators such as <a href="#distort"
7934 >-distort</a>, <a href="#implode" >-implode</a>, and <a href="#fx" >-fx</a>.
7935 However it also affects operations that may access pixels just outside the
7936 image proper, such as <a href="#convolve">-convolve</a>, <a
7937 href="#blur">-blur</a>, and <a href="#sharpen">-sharpen</a>. </p>
7938
7939 <p>To print a complete list of virtual pixel types, use the <a
7940 href="#list">-list virtual-pixel</a> option.</p>
7941
7942
7943 <div style="mx-auto my-3 text-center">
7944 <h2><a class="anchor" id="visual"></a>-visual <var>type</var></h2>
7945 </div>
7946
7947 <p class="lead">Animate images using this X visual type.", 'animate', 'display'</p>
7948
7949 <p>Choose from these visual classes:</p>
7950
7951 <pre class="p-3 mb-2 text-body-secondary bg-body-tertiary"><code>StaticGray TrueColor
7952 GrayScale DirectColor
7953 StaticColor default
7954 PseudoColor visual id
7955 </code></pre>
7956
7957 <p>The X server must support the visual you choose, otherwise an error occurs.
7958 If a visual is not specified, the visual class that can display the most
7959 simultaneous colors on the default screen is chosen.</p>
7960
7961
7962 <div style="mx-auto my-3 text-center">
7963 <h2><a class="anchor" id="watermark"></a>-watermark <var>brightness</var>x<var>saturation</var></h2>
7964 </div>
7965
7966 <p class="lead">Watermark an image using the given percentages of brightness and saturation.</p>
7967
7968 <p>Take a grayscale image (with alpha mask) and modify the destination image's
7969 brightness according to watermark image's grayscale value and the
7970 <var>brightness</var> percentage. The destinations color saturation
7971 attribute is just direct modified by the <var>saturation</var>
7972 percentage, which defaults to 100 percent (no color change). </p>
7973
7974
7975 <div style="mx-auto my-3 text-center">
7976 <h2><a class="anchor" id="wave"></a>-wave <var>amplitude</var><br />-wave <var>amplitude</var>x<var>wavelength</var></h2>
7977 </div>
7978
7979 <p class="lead">Shear the columns of an image into a sine wave.</p>
7980
7981 <div style="mx-auto my-3 text-center">
7982 <h2><a class="anchor" id="wavelet-denoise"></a>-wavelet-denoise <var>threshold</var><br />-wavelet-denoise <var>threshold</var>x<var>softness</var></h2>
7983 </div>
7984
7985 <p class="lead">Removes noise from the image using a wavelet transform. The threshold is the value below which everything is considered noise and ranges from 0.0 (none) to QuantumRange or use percent (e.g. 5%). Softness attenuates the threshold and typically ranges from 0.0 (none, default) to 1.0. The higher the value, the more noise that remains in the image.</p>
7986
7987 <div style="mx-auto my-3 text-center">
7988 <h2><a class="anchor" id="weight"></a>-weight <var>fontWeight</var></h2>
7989 </div>
7990
7991 <p class="lead">Set a font weight for text.</p>
7992
7993 <p>This setting suggests a font weight that ImageMagick should try to apply to
7994 the currently selected font family. Use a positive integer for
7995 <var>fontWeight</var> or select from the following.</p>
7996
7997 <div class="overflow-auto p-3 mb-2 text-body-secondary bg-body-tertiary" style="max-height:75svh;">
7998 <dl class="row">
7999 <dt class="col-md-4">Thin </dt>
8000 <dd class="col-md-8">Same as <var>fontWeight</var> = 100.</dd>
8001 <dt class="col-md-4">ExtraLight </dt>
8002 <dd class="col-md-8">Same as <var>fontWeight</var> = 200.</dd>
8003 <dt class="col-md-4">Light </dt>
8004 <dd class="col-md-8">Same as <var>fontWeight</var> = 300.</dd>
8005 <dt class="col-md-4">Normal </dt>
8006 <dd class="col-md-8">Same as <var>fontWeight</var> = 400.</dd>
8007 <dt class="col-md-4">Medium </dt>
8008 <dd class="col-md-8">Same as <var>fontWeight</var> = 500.</dd>
8009 <dt class="col-md-4">DemiBold </dt>
8010 <dd class="col-md-8">Same as <var>fontWeight</var> = 600.</dd>
8011 <dt class="col-md-4">Bold </dt>
8012 <dd class="col-md-8">Same as <var>fontWeight</var> = 700.</dd>
8013 <dt class="col-md-4">ExtraBold </dt>
8014 <dd class="col-md-8">Same as <var>fontWeight</var> = 800.</dd>
8015 <dt class="col-md-4">Heavy </dt>
8016 <dd class="col-md-8">Same as <var>fontWeight</var> = 900.</dd>
8017 </dl>
8018 </div>
8019 <br/>
8020
8021 <p>To print a complete list of weight types, use <a href="#list">-list weight</a>.</p>
8022
8023 <p>For other settings that affect fonts, see the options <a
8024 href="#font">-font</a>, <a href="#family">-family</a>, <a
8025 href="#stretch">-stretch</a>, and <a href="#style">-style</a>. </p>
8026
8027 <div style="mx-auto my-3 text-center">
8028 <h2><a class="anchor" id="white-balance"></a>-white-balance</h2>
8029 </div>
8030 <p>Applies white balancing to an image according to a grayworld assumption in the LAB colorspace.</p>
8031 <p>Use <code>-define white-balance:vibrance=<em>value&#123%}</em></code> to change the color vibrance of the a &amp; b channels.</p>
8032
8033 <div style="mx-auto my-3 text-center">
8034 <h2><a class="anchor" id="white-point"></a>-white-point <var>x,y</var></h2>
8035 </div>
8036
8037 <p class="lead">Chromaticity white point.</p>
8038
8039 <div style="mx-auto my-3 text-center">
8040 <h2><a class="anchor" id="white-threshold"></a>-white-threshold <var>value</var>{<var>%</var>}</h2>
8041 </div>
8042
8043 <p class="lead">Force to white all pixels above the threshold while leaving all pixels at or below the threshold unchanged.</p>
8044
8045 <p> The threshold value can be given as a percentage or as an absolute integer
8046 value within [0, <var>QuantumRange</var>] corresponding to the
8047 desired <a href="#channel">-channel</a> value. See <a href="#threshold">-threshold</a>
8048 for more details on thresholds and resulting values. </p>
8049
8050 <div style="mx-auto my-3 text-center">
8051 <h2><a class="anchor" id="window"></a>-window <var>id</var></h2>
8052 </div>
8053
8054 <p class="lead">Make the image the background of a window.", 'animate', 'display'</p>
8055
8056 <p><var>id</var> can be a window id or name. Specify <code>root</code>
8057 to select X's root window as the target window.</p>
8058
8059 <p>By default the image is tiled onto the background of the target window. If
8060 <code>backdrop</code> or <a href="#geometry">-resize</a> are specified, the
8061 image is surrounded by the background color. Refer to <code>X RESOURCES</code>
8062 for details.</p>
8063
8064 <p>The image will not display on the root window if the image has more unique
8065 colors than the target window colormap allows. Use <a
8066 href="#colors">-colors</a> to reduce the number of colors.</p>
8067
8068 <div style="mx-auto my-3 text-center">
8069 <h2><a class="anchor" id="window-group"></a>-window-group</h2>
8070 </div>
8071
8072 <p class="lead">Specify the window group.</p>
8073
8074 <div style="mx-auto my-3 text-center">
8075 <h2><a class="anchor" id="word-break"></a>-word-break <var>type</var></h2>
8076 </div>
8077
8078 <p class="lead">Sets whether line breaks appear wherever the text would otherwise overflow its content box. Choose from <code>normal</code>, the default, or <code>break-word</code>.</p>
8079
8080 <div style="mx-auto my-3 text-center">
8081 <h2><a class="anchor" id="write"></a>-write <var>filename</var></h2>
8082 </div>
8083
8084 <p class="lead">Write an image sequence.</p>
8085
8086 <p>The image sequence preceding the <a href="#write">-write</a> <var>filename</var> option is written out, and processing continues with the same image in its current state if there are additional options. To restore the image to its original state after writing it, use the <a href="#write">+write</a> <var>filename</var> option.</p>
8087
8088 <p>Use <a href="#compress">-compress</a> to specify the type of image compression.</p>
8089
8090 <div style="mx-auto my-3 text-center">
8091 <h2><a class="anchor" id="write-mask"></a>-write-mask <var>filename</var></h2>
8092 </div>
8093
8094 <p class="lead">Prevent updates to image pixels specified by the mask.</p>
8095
8096 <p>This the same as using a mask used for composite masking operations, with
8097 grayscale values causing blended updates of the image the mask is attached to.
8098 </p>
8099
8100 <p>Use <a href="#write-mask">+write-mask</a> to remove the mask from images.</p>
8101
8102 <p>Also see <a href="#clip-mask">-clip-mask</a> which work in the same way,
8103 but with strict boolean masking. </p>
8104 </div>
8105 </div>
8106
8107 </div>
8108 <div class="col-md-3">
8109 <div class="container text-center my-3">
8110 <a href="../image/wizard.png" rel="noopener noreferrer" target="_blank">
8111 <img alt="The Tao of the Spiritual Warrior" class="img-fluid img-thumbnail" height="1468" loading="lazy" src="../image/wizard.png" width="1104">
8112 </a>
8113 <p class="mt-2"><iframe src="https://github.com/sponsors/ImageMagick/button" title="Sponsor ImageMagick" height="35" width="107" style="border: 0;"></iframe></p>
8114 </div>
8115 <div class="container text-center my-3">
8116 <script async src="https://localhost/pagead/js/adsbygoogle.js?client=ca-pub-3129977114552745"
8117 crossorigin="anonymous"></script>
8118 <!-- Banner Ad -->
8119 <ins class="adsbygoogle"
8120 style="display:block"
8121 data-ad-client="ca-pub-3129977114552745"
8122 data-ad-slot="1083537442"
8123 data-ad-format="auto"
8124 data-full-width-responsive="true"></ins>
8125 <script>
8126 (adsbygoogle = window.adsbygoogle || []).push({});
8127 </script>
8128 </div>
8129 </div>
8130 </div>
8131 <a aria-label="About ImageMagick" class="btn btn-outline-warning mt-3" href="../index-2.html">About ImageMagick</a>
8132 </main><!-- /.container -->
8133 <footer class="text-center pt-5 my-5 text-body-secondary border-top">
8134 <div class="container-fluid">
8135 <a href="../security-policy/index.html">Security</a> •
8136 <a href="../news/index.html">News</a>
8137 &nbsp;
8138 <a href="#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../image/wand.ico"></a>
8139 &nbsp;
8140 <a href="../links/index.html">Related</a> •
8141 <a href="../sitemap/index.html">Sitemap</a>
8142 <br>
8143 <a href="../support/index.html">Sponsor</a> •
8144 <a href="../cite/index.html">Cite</a> •
8145 <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
8146 <a href="https://github.com/ImageMagick/ImageMagick/discussions">Contact Us</a>
8147 <br>
8148 <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">
8149 <title>GitHub</title>
8150 <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" />
8151 </svg></a> •
8152 <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">
8153 <title>Twitter</title>
8154 <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" />
8155 </svg></a>
8156 <br>
8157 <small>Copyright © 1999 ImageMagick Studio LLC</small>
8158 </div>
8159 </footer>
8160 <div style="visibility: hidden;">
8161 <div class="gcse-search"></div>
8162 </div>
8163 </div>
8164
8165 <!-- Javascript assets -->
8166 <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
8167 </body>
8168
8169
8170 </html>