blob: 8bcba456aea5645c8816e4ee762d2785c2ae2651 [file] [log] [blame]
cristybc9539a2010-08-16 18:06:20 +00001
2<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
5<head>
6 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
7 <meta name="verify-v1" content="g222frIIxcQTrvDR3NBRUSKP3AnMNoqxOkIniCEkV7U="/>
8 <title>ImageMagick: Alpha Compositing</title/>
9 <meta http-equiv="Content-Language" content="en-US"/>
10 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
11 <meta http-equiv="Reply-to" content="magick-users@imagemagick.org"/>
12 <meta name="Application-name" content="ImageMagick"/>
13 <meta name="Description" content="ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (about 100) including GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you can freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems. The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite programming language. Choose from these interfaces: MagickCore (C), MagickWand (C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a language interface, use ImageMagick to modify or create images automagically and dynamically."/>
14 <meta name="Application-url" content="http://www.imagemagick.org"/>
15 <meta name="Generator" content="PHP"/>
16 <meta name="Keywords" content="alpha, compositing, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand, ImageMagickObject, Swiss, Army, Knife, Image, Processing"/>
17 <meta name="Rating" content="GENERAL"/>
18 <meta name="Robots" content="INDEX, FOLLOW"/>
19 <meta name="Generator" content="ImageMagick Studio LLC"/>
20 <meta name="Author" content="ImageMagick Studio LLC"/>
21 <meta name="Revisit-after" content="2 DAYS"/>
22 <meta name="Resource-type" content="document"/>
23 <meta name="Copyright" content="Copyright (c) 1999-2010 ImageMagick Studio LLC"/>
24 <meta name="Distribution" content="Global"/>
25 <link rel="icon" href="../images/wand.png" sizes="32x32"/>
26 <link rel="shortcut icon" href="../images/wand.ico" type="images/x-icon"/>
27 <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"/>
28 <style type="text/css" media="all">
29 @import url("../www/magick.css");
30 </style>
31</head>
32
33<body id="www-imagemagick-org">
34<div class="titlebar">
35<a href="../index.html">
36 <img src="../images/script.png" alt="[ImageMagick]"
37 style="width: 350px; height: 60px; margin: 28px auto; float: left;" /></a>
38<a href="http://www.networkredux.com">
39 <img src="../images/networkredux.png" alt="[sponsor]"
40 style="margin: 45px auto; border: 0px; float: left;" /></a>
41<a href="http://www.imagemagick.org/discourse-server/">
42 <img src="../images/logo.jpg" alt=""
43 style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
44<a href="../index.html">
45 <img src="../images/sprite.jpg" alt=""
46 style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
47</div>
48
49<div class="westbar">
50
51<div class="menu">
52 <a title="About ImageMagick" href="../index.html">About ImageMagick</a>
53</div>
54<div class="sep"></div>
55<div class="menu">
56 <a title="Binary Releases" href="../www/binary-releases.html">Binary Releases</a>
57</div>
58<div class="sub">
59 <a title="Binary Release: Unix" href="../www/binary-releases.html#unix">Unix</a>
60</div>
61<div class="sub">
62 <a title="Binary Release: MacOS X" href="../www/binary-releases.html#macosx">Mac OS X</a>
63</div>
64<div class="sub">
65 <a title="Binary Release: Windows" href="../www/binary-releases.html#windows">Windows</a>
66</div>
67<div class="sep"></div>
68<div class="menu">
69 <a title="Command-line Tools" href="../www/command-line-tools.html">Command-line Tools</a>
70</div>
71<div class="sub">
72 <a title="Command-line Tools: Processing" href="../www/command-line-processing.html">Processing</a>
73</div>
74<div class="sub">
75 <a title="Command-line Tools: Options" href="../www/command-line-options.html">Options</a>
76</div>
77<div class="sub">
78 <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
79</div>
80<div class="menu">
81 <a title="Program Interfaces" href="../www/api.html">Program Interfaces</a>
82</div>
83<div class="sub">
84 <a title="Program Interface: MagickWand" href="../www/magick-wand.html">MagickWand</a>
85</div>
86<div class="sub">
87 <a title="Program Interface: MagickCore" href="../www/magick-core.html">MagickCore</a>
88</div>
89<div class="sub">
90 <a title="Program Interface: PerlMagick" href="../www/perl-magick.html">PerlMagick</a>
91</div>
92<div class="sub">
93 <a title="Program Interface: Magick++" href="../Magick++/">Magick++</a>
94</div>
95<div class="sep"></div>
96<div class="menu">
97 <a title="Install from Source" href="../www/install-source.html">Install from Source</a>
98</div>
99<div class="sub">
100 <a title="Install from Source: Unix" href="../www/install-source.html#unix">Unix</a>
101</div>
102<div class="sub">
103 <a title="Install from Source: Windows" href="../www/install-source.html#windows">Windows</a>
104 </div>
105<div class="menu">
106 <a title="Resources" href="../www/resources.html">Resources</a>
107</div>
108<div class="menu">
109 <a title="Architecture" href="../www/architecture.html">Architecture</a>
110</div>
111<div class="menu">
112 <a title="Download" href="../www/download.html">Download</a>
113</div>
114<div class="sep"></div>
115<div class="menu">
116 <a title="Search" href="http://www.imagemagick.org/script/search.php">Search</a>
117</div>
118<div class="sep"></div>
119<div class="menu">
120 <a title="Site Map"href="../www/sitemap.html">Site Map</a>
121</div>
122<div class="sub">
123 <a title="Site Map: Links"href="../www/links.html">Links</a>
124</div>
125<div class="sep"></div>
126<div class="menu">
127 <a title="Sponsors" href="../www/sponsors.html">Sponsors:</a>
128
129<div class="sponsbox">
130<div class="sponsor">
131 <a title="Sponsor: Flyer drucken" href="http://www.online-druck.biz">Flyer drucken</a><!-- 201109010900 Floeter-->
132</div>
133<div class="sponsor">
134 <a title="Sponsor: Webdesign Agentur" href="http://www.ventzke-partner.de">Webdesign Agentur</a><!-- 201101010480 invendio.de-->
135</div>
136<div class="sponsor">
137 <a title="Sponsor: LVM Versicherung" href="http://www.neu-reich.de">LVM Versicherung</a><!-- 201101010480 -->
138</div>
139<div class="sponsor">
140 <a title="Sponsor: Deko.net" href="http://www.deko.net">Deko.net</a><!-- 201101010600 Peterssen-->
141</div>
142<div class="sponsor">
143 <a title="Sponsor: Druckerei" href="http://www.print24.de/">Druckerei</a><!-- 201009010720 -->
144</div>
145<div class="sponsor">
146 <a title="Sponsor: Druckerei Online" href="http://www.allesdruck.de">Druckerei Online</a><!-- 201012011200 allesdruck.de-->
147</div>
148<div class="sponsor">
149 <a title="Sponsor: Free Catalogs" href="http://www.who-sells-it.com/">Free Catalogs</a><!-- 20120801000600 -->
150</div>
151</div>
152</div>
153</div>
154
155<div class="eastbar">
156 <script type="text/javascript">
157 <!--
158 google_ad_client = "pub-3129977114552745";
159 google_ad_slot = "0574824969";
160 google_ad_width = 160;
161 google_ad_height = 600;
162 //-->
163 </script>
164 <script type="text/javascript"
165 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
166 </script>
167</div>
168
169<div class="main">
170
171
172<p>The description of composition uses abstract terminology in order to allow
173the description to be more precise, while avoiding constant values which are
174specific to a particular build configuration. Each image pixel is represented
175by red, green, and blue levels (which are equal for a gray pixel). The
176build-dependent value <em class="QR">QuantumRange</em> is the maximum integral
177value which may be stored, per pixel, in the red, green, or blue channels of
178the image. Each image pixel may also optionally (if the image matte channel is
179enabled) have an associated level of opacity, ranging from <em>opaque</em> to
180<em>transparent</em>, which may be used to determine the influence of the pixel
181color when compositing the pixel with another image pixel. If the image matte
182channel is disabled, then all pixels in the image are treated as opaque. The
183color of an opaque pixel is fully visible while the color of a transparent
184pixel color is entirely absent (pixel color is ignored).</p>
185
186<p>By definition, raster images have a rectangular shape. All image rows are of
187equal length, as are all image columns. By treating the alpha channel as a
188visual "mask" the rectangular image may be given a "shape" by treating the
189alpha channel as a cookie-cutter for the image. This is done by setting the
190pixels within the shape to be opaque, with pixels outside the shape set as
191transparent. Pixels on the boundary of the shape may be between opaque and
192transparent in order to provide antialiasing (visually smooth edges). The
193description of the composition operators use this concept of image "shape" in
194order to make the description of the operators easier to understand. While it
195is convenient to describe the operators in terms of "shapes" they are by no
196means limited to mask-style operations since they are based on continuous
197floating-point mathematics rather than simple boolean operations.</p>
198
199<p>The following alpha blending (Duff-Porter) compose methods are available:</p>
200
201<table class="doc">
202 <tbody>
203 <tr valign="top">
204 <th align="left" style="width: 8%">Method</th>
205 <th align="left">Description</th>
206 </tr>
207
208 <tr valign="top">
209 <td valign="top">clear</td>
210 <td valign="top">Both the color and the alpha of the destination are
211 cleared. Neither the source nor the destination are used (except for
212 destinations size and other meta-data which is always preserved.</td>
213 </tr>
214
215 <tr valign="top">
216 <td valign="top">src</td>
217 <td valign="top">The source is copied to the destination. The destination
218 is not used as input, though it is cleared.</td>
219 </tr>
220
221 <tr valign="top">
222 <td valign="top">dst</td>
223 <td valign="top">The destination is left untouched. The source image is
224 completely ignored.</td>
225 </tr>
226
227 <tr valign="top">
228 <td valign="top">src-over</td>
229 <td valign="top">The source is composited over the destination. this is
230 the default alpha blending compose method, when neither the compose
231 setting is set, nor is set in the image meta-data.</td>
232 </tr>
233
234 <tr valign="top">
235 <td valign="top">dst-over</td>
236 <td valign="top">The destination is composited over the source and the
237 result replaces the destination.</td>
238 </tr>
239
240 <tr valign="top">
241 <td valign="top">src-in</td>
242 <td valign="top">The part of the source lying inside of the destination
243 replaces the destination.</td>
244 </tr>
245
246 <tr valign="top">
247 <td valign="top">dst-in</td>
248 <td valign="top">The part of the destination lying inside of the source
249 replaces the destination. Areas not overlaid are cleared.</td>
250 </tr>
251
252 <tr valign="top">
253 <td valign="top">src-out</td>
254 <td valign="top">The part of the source lying outside of the destination
255 replaces the destination.</td>
256 </tr>
257
258 <tr valign="top">
259 <td valign="top">dst-out</td>
260 <td valign="top">The part of the destination lying outside of the source
261 replaces the destination.</td>
262 </tr>
263
264 <tr valign="top">
265 <td valign="top">src-atop</td>
266 <td valign="top">The part of the source lying inside of the destination is
267 composited onto the destination.</td>
268 </tr>
269
270 <tr valign="top">
271 <td valign="top">dst-atop</td>
272 <td valign="top">The part of the destination lying inside of the source is
273 composited over the source and replaces the destination. Areas not
274 overlaid are cleared. </td>
275 </tr>
276
277 <tr valign="top">
278 <td valign="top">xor</td>
279 <td valign="top">The part of the source that lies outside of the
280 destination is combined with the part of the destination that lies
281 outside of the source. Source or Destination, but not both. </td>
282 </tr>
283
284 </tbody>
285</table>
286
287<p>Any of the 'Src-*' methods can also be specified without the 'Src-' part.
288For example the defaul compose method can be specified as just 'Over'.</p>
289
290
291<p>The following mathemathical composition methods are also available. </p>
292
293<table class="doc">
294 <tbody>
295 <tr valign="top">
296 <th align="left" style="width: 8%">Method</th>
297 <th align="left">Description</th>
298 </tr>
299
300 <tr valign="top">
301 <td valign="top">multiply</td>
302 <td valign="top">The source is multiplied by the destination and replaces
303 the destination. The resultant color is always at least as dark as
304 either of the two constituent colors. Multiplying any color with black
305 produces black. Multiplying any color with white leaves the original
306 color unchanged.</td>
307 </tr>
308
309 <tr valign="top">
310 <td valign="top">screen</td>
311 <td valign="top">The source and destination are complemented and then
312 multiplied and then replace the destination. The resultant color is
313 always at least as light as either of the two constituent colors.
314 Screening any color with white produces white. Screening any color
315 with black leaves the original color unchanged.</td>
316 </tr>
317
318 <tr valign="top">
319 <td valign="top">plus</td>
320 <td valign="top">The source is added to the destination and replaces the
321 destination. This operator is useful for averaging or a controled
322 merger of two images, rather than a direct overlay.</td>
323 </tr>
324
325 <tr valign="top">
326 <td valign="top">add</td>
327 <td valign="top">As per 'plus' but transparency data is treated as matte
328 values. As such any transparent areas in either image remain
329 transparent. </td>
330 </tr>
331
332 <tr valign="top">
333 <td valign="top">minus</td>
334 <td valign="top">Subtract the colors in the source image from the
335 destination image. When transparency is involved, opaque areas is
336 subtracted from any destination opaque areas. </td>
337 </tr>
338
339 <tr valign="top">
340 <td valign="top">subtract</td>
341 <td valign="top">Subtract the colors in the source image from the
342 destination image. When transparency is involved transparent areas are
343 subtracted, so only the opaque areas in the source remain opaque in
344 the destination image. </td>
345 </tr>
346
347 <tr valign="top">
348 <td valign="top">difference</td>
349 <td valign="top">Subtracts the darker of the two constituent colors from
350 the lighter. Painting with white inverts the destination color.
351 Painting with black produces no change.</td>
352 </tr>
353
354 <tr valign="top">
355 <td valign="top">exclusion</td>
356 <td valign="top">Produces an effect similar to that of 'difference', but
357 appears as lower contrast. Painting with white inverts the
358 destination color. Painting with black produces no change.</td>
359 </tr>
360
361 <tr valign="top">
362 <td valign="top">darken</td>
363 <td valign="top">Selects the darker of the destination and source colors.
364 The destination is replaced with the source when the source is darker,
365 otherwise it is left unchanged.</td>
366 </tr>
367
368 <tr valign="top">
369 <td valign="top">lighten</td>
370 <td valign="top">Selects the lighter of the destination and source colors.
371 The destination is replaced with the source when the source is
372 lighter, otherwise it is left unchanged. </td>
373 </tr>
374
375 </tbody>
376</table>
377
378<p>Typically these use the default 'Over' alpha blending when transparencies
379are also involved, except for 'Plus' which uses a 'plus' alpha blending.
380This means the alpha channel is used to not only specify that all
381non-transparent parts of the input image is visible, but also applied color
382channel 'weighting' of the values. This also applied to the lighting
383composition methods below. </p>
384
385<p>As of IM v6.6.1-6, if the special '<kbd>Sync</kbd>' flag is not specified
386(enabled by default) with the <a href="#channel" >-channel</a> setting, then
387the above mathematical compositions will nolonger syncronise its actiosn with
388the alpha channel. Instead the math composition will be applied on an
389individual channel basis as defined by the <a href="#channel" >-channel</a>.
390this includes the alpha channel. </p>
391
392<p>This special usage allows you to perform mathematics between images. </p>
393
394
395<p>The following lighting composition methods are also available. </p>
396
397<table class="doc">
398 <tbody>
399 <tr valign="top">
400 <th align="left" style="width: 8%">Method</th>
401 <th align="left">Description</th>
402 </tr>
403
404 <tr valign="top">
405 <td valign="top">linear-dodge</td>
406 <td valign="top">This is equivelent to 'Plus' in that the color channels
407 are simply added, however it does not 'Plus' the alpha channel, but
408 uses the normal 'Over' alpha blending, which transparencies are
409 involved. Produces a sort of additive multiply-like result. Added
410 ImageMagick version 6.5.4-3. </td>
411 </tr>
412
413 <tr valign="top">
414 <td valign="top">linear-burn</td>
415 <td valign="top">As 'Linear-Dodge', but also subtract one from the result.
416 Sort of a additive 'Screen' of the images. Added ImageMagick version
417 6.5.4-3. </td>
418 </tr>
419
420 <tr valign="top">
421 <td valign="top">color-dodge</td>
422 <td valign="top">Brightens the destination color to reflect the source
423 color. Painting with black produces no change.</td>
424 </tr>
425
426 <tr valign="top">
427 <td valign="top">color-burn</td>
428 <td valign="top">Darkens the destination color to reflect the source
429 color. Painting with white produces no change. Fixed in ImageMagick
430 version 6.5.4-3. </td>
431 </tr>
432
433 <tr valign="top">
434 <td valign="top">overlay</td>
435 <td valign="top">Multiplies or screens the colors, dependent on the
436 destination color. Source colors overlay the destination whilst
437 preserving its highlights and shadows. The destination color is not
438 replaced, but is mixed with the source color to reflect the lightness
439 or darkness of the destination.</td>
440 </tr>
441
442 <tr valign="top">
443 <td valign="top">hard-light</td>
444 <td valign="top">Multiplies or screens the colors, dependent on the source
445 color value. If the source color is lighter than 0.5, the destination
446 is lightened as if it were screened. If the source color is darker
447 than 0.5, the destination is darkened, as if it were multiplied. The
448 degree of lightening or darkening is proportional to the difference
449 between the source color and 0.5. If it is equal to 0.5 the
450 destination is unchanged. Painting with pure black or white produces
451 black or white.</td>
452 </tr>
453
454
455 <tr valign="top">
456 <td valign="top">linear-light</td>
457 <td valign="top">Like 'Hard-Light' but using linear-dodge and linear-burn
458 instead. Increases contrast slightly with an impact on the
459 foreground's tonal values.</td>
460 </tr>
461
462 <tr valign="top">
463 <td valign="top">soft-light</td>
464 <td valign="top">Darkens or lightens the colors, dependent on the source
465 color value. If the source color is lighter than 0.5, the destination
466 is lightened. If the source color is darker than 0.5, the destination
467 is darkened, as if it were burned in. The degree of darkening or
468 lightening is proportional to the difference between the source color
469 and 0.5. If it is equal to 0.5, the destination is unchanged. Painting
470 with pure black or white produces a distinctly darker or lighter area,
471 but does not result in pure black or white. Fixed in ImageMagick
472 version 6.5.4-3. </td>
473 </tr>
474
475 <tr valign="top">
476 <td valign="top">pegtop-light</td>
477 <td valign="top">Almost equivelent to 'Soft-Light', but using a
478 continuious mathematical formula rather than two conditionally
479 selected formulae. Added ImageMagick version 6.5.4-3. </td>
480 </tr>
481
482 <tr valign="top">
483 <td valign="top">vivid-light</td>
484 <td valign="top">A modified 'Linear-Light' designed to preserve very stong
485 primary and secondary colors in the image. Added ImageMagick version
486 6.5.4-3. </td>
487 </tr>
488
489 <tr valign="top">
490 <td valign="top">pin-light</td>
491 <td valign="top">Similar to 'Hard-Light', but using sharp linear shadings,
492 to similate the effects of a strong 'pinhole' light source. Added
493 ImageMagick version 6.5.4-3. </td>
494 </tr>
495
496 </tbody>
497</table>
498
499
500
501<p>Also included are these special purpose compose methods:</p>
502
503<table class="doc">
504 <tbody>
505 <tr valign="top">
506 <th align="left" style="width: 8%">Method</th>
507 <th align="left">Description</th>
508 </tr>
509
510 <tr valign="top">
511 <td valign="top">copy-*</td>
512 <td valign="top">Copy the specified channel (Red, Green, Blue, Cyan,
513 Magenta, Yellow, Black, or Opacity) in the source image to the
514 same channel in the destination image. If the channel specified
515 does not exist in the source image, (which can only happen for methods,
516 '<kbd>copy-opacity</kbd>' or '<kbd>copy-black</kbd>') then it is
517 assumed that the source image is a special grayscale channel image
518 of the values to be copied. </td>
519 </tr>
520
521 <tr valign="top">
522 <td valign="top">change-mask</td>
523 <td valign="top">Replace any destination pixel that is the similar to the source images pixel (as defined by the current <a href="#fuzz">-fuzz</a> factor), with transparency. </td>
524 </tr>
525 </tbody>
526</table>
527
528<p>On top of these composed methods are a few special ones that not only require
529the two images that are being merged or overlaid, but have some extra numerical
530arguments, which are tabled below. </p>
531
532<p>In the "<code>composite</code>" command these composition methods are
533selected using special options with the arguments needed. They are usually,
534but not always, the same name as the composte 'method' they use, and replaces
535the normal use of the <a href="#compose" >-compose</a> setting in the
536"<code>composite</code>" command. For example... </p>
537
538<p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>composite ... -blend 50x50 ...</span></p>
539<p>As of IM v6.5.3-4 the "<code>convert</code>" command can now also supply
540these extra arguments to its <a href="#composite" >-composite</a> operator,
541using the special <a href="#set">-set</a> attribute of '<kbd class="arg">option:compose:args</kbd>'. This means you can now make use of
542these special argumented <a href="#compose" >-compose</a> methods, those the
543argument and the method both need to be set separatally. For example... </p>
544
545<p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>convert ... -compose blend -set option:compose:args 50x50 -composite ...</span></p>
546<p>The following is a table of these special 'argumented' compose methods,
547with a brief summary of what they do. For more details see the equivalent
548"composite" command option name. </p>
549
550<table class="doc">
551 <tbody>
552 <tr valign="top">
553 <th align="left" style="width: 8%">Method</th>
554 <th align="left">Description</th>
555 </tr>
556
557 <tr valign="top">
558 <td valign="top">dissolve</td>
559 <td valign="top">Arguments:
560 <em class="arg">src_percent</em>[x<em class="arg">dst_percent</em>]
561 <br>Equivalent to "<code>composite</code>" <a href="#dissolve">-dissolve</a>
562 <br>Dissolve the 'source' image by the percentage given before overlaying
563 'over' the 'destination' image. If <em class="arg">src_percent</em> is
564 greater than 100, it starts dissolving the main image so it will
565 become transparent at a value of '<kbd class="arg">200</kbd>'. If
566 both percentages are given, each image are dissolved to the
567 percentages given.
568 </td>
569 </tr>
570
571 <tr valign="top">
572 <td valign="top">blend</td>
573 <td valign="top">Arguments:
574 <em class="arg">src_percent</em>[x<em class="arg">dst_percent</em>]
575 <br>Equivalent to "<code>composite</code>" <a href="#blend">-blend</a>
576 <br>Average the images together ('plus') according to the percentages
577 given and each pixels transparency. If only a single percentage value
578 is given it sets the weight of the composite or 'source' image, while
579 the background image is weighted by the exact opposite amount. That is
580 a <kbd>-blend 30</kbd> merges 30% of the 'source' image with 70% of
581 the 'destination' image. Thus it is equivalent to <kbd>-blend
582 30x70</kbd>.
583 </td>
584 </tr>
585
586 <tr valign="top">
587 <td valign="top">mathematics</td>
588 <td valign="top">Arguments: <em class="arg">A, B, C, D</em>
589 <br>Not available in "<code>composite</code>" at this time.
590 <br>Merge the source and destination images according to the formula
591 <br>&nbsp; &nbsp; &nbsp;<code>A*Sc*Dc + B*Sc + C*Dc + D</code>
592 <br>Can be used to generate a custom composition method that would
593 otherwise need to be implemented using the slow <a href="#fx">-fx</a>
594 DIY image operator. Added to ImageMagick version 6.5.4-3.
595 <br>As of IM v6.6.1-6 this method will do per-channel math compositions
596 if the 'Sync' flag is removed from <a href="#channel" >-channel</a>,
597 just like all the other mathematical compostion methods above.
598 </td>
599 </tr>
600
601 <tr valign="top">
602 <td valign="top">modulate</td>
603 <td valign="top">Arguments:
604 <em class="arg">brightness</em>[x<em class="arg">saturation</em>]
605 <br>Equivalent to "<code>composite</code>" <a href="#watermark">-watermark</a>
606 <br>Take a grayscale image (with alpha mask) and modify the destination
607 image's brightness according to watermark image's grayscale value and
608 the <em class="arg">brightness</em> percentage. The destinations
609 color saturation attribute is just direct modified by the <em
610 class="arg">saturation</em> percentage, which defaults to 100 percent
611 (no color change).
612
613 </td>
614 </tr>
615
616 <tr valign="top">
617 <td valign="top">displace</td>
618 <td valign="top">Arguments:
619 <em class="arg">X-scale</em>[x<em class="arg">Y-scale</em>][!][%]
620 <br>Equivalent to "<code>composite</code>" <a href="#displace">-displace</a>
621 <br>With this option, the 'overlay' image, and optionally the 'mask'
622 image, is used as a relative displacement map, which is used to
623 displace the lookup of what part of the destination image is seen at
624 each point of the overlaid area. Much like the displacement map is a
625 'lens' that distorts the original 'background' image behind it.
626 <br><br>
627 The X-scale is modilated by the 'red' channel of the overlay image
628 while the Y-scale is modulated by the green channel, (the mask image
629 if given is rolled into green channel of the overlay image. This
630 separation allows you to modulate the X and Y lookup displacement
631 separatally allowing you to di 2 dimentional displacements, rather
632 than 1 dimentional verctored displacements (using grayscale image).
633 <br><br>
634 If the overlay image contains transparency this is used as a mask
635 of the resulting image to remove 'invalid' pixels.
636 <br><br>
637 The '%' flag makes the displacement scale relative to the size of the
638 overlay image (100% = half width/height of image). Using '!' switches
639 percentage arguments to refer to the destination image size instead.
640 <br><br>
641 Special flags were added Added to ImageMagick version 6.5.3-5.
642 </td>
643 </tr>
644
645 <tr valign="top">
646 <td valign="top">distort</td>
647 <td valign="top">Arguments:
648 <em class="arg">X-scale</em>[x<em class="arg">Y-scale</em
649 >[+<em class="arg">X-center</em>+<em class="arg">Y-center</em>]][!][%]
650 <br>Not available in "<code>composite</code>" at this time.
651 <br>Exactly as per 'Displace' (above), but using absolute coordinates,
652 relative to the center of the overlay (or that given). Basically
653 allows you to generate absolute distortion maps where 'black' will
654 look up the left/top edge, and 'white' looks up the bottom/right
655 edge of the destination image, according to the scale given.
656 <br><br>
657 The '!' flag not only switches percentage scaling, to use the
658 destination image, but also the image the center offset of the lookup.
659 This means the overlay can lookup a completely different region of the
660 destination image.
661 <br><br>
662 Added to ImageMagick version 6.5.3-5.
663 </td>
664 </tr>
665
666 <tr valign="top">
667 <td valign="top">blur</td>
668 <td valign="top">Arguments:
669 <em class="arg">Width</em>[x<em class="arg">Height</em
670 >[+<em class="arg">Angle</em>]]
671 <br>Equivalent to "<code>composite</code>"
672 <a href="#blur-composite">-blur</a>
673 <br>A Variable Blur Mapping Composition method, where each pixel in the
674 overlaid region is replaced with an Elliptical Weighted Average (EWA),
675 with an ellipse (typically a circle) of the given sigma size, scaled
676 according to overlay (source image) grayscale mapping.
677 <br><br>
678 As per 'Displace' and 'Distort', the red channel will modulate the
679 width of the ellipse, while the green channel will modulate the height
680 of the ellipse. However at this time the ellipse angle is not
681 modulated though this may be a future posibility (perhaps with a
682 special flag to enable use of blur channel for this purpose).
683 <br><br>
684 Added to ImageMagick version 6.5.4-0.
685 </td>
686 </tr>
687
688 </tbody>
689</table>
690
691<p>To print a complete list of all the available compose operators, use <a
692href="#list">-list compose</a>.</p>
693
694
695
696</div>
697
698<div id="linkbar">
699 <span id="linkbar-west">&nbsp;</span>
700 <span id="linkbar-center">
701 <a href="http://www.imagemagick.org/discourse-server/">Discourse Server</a> &bull;
702 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a>
703 </span>
704 <span id="linkbar-east">&nbsp;</span>
705 </div>
706 <div class="footer">
707 <span id="footer-west">&copy; 1999-2010 ImageMagick Studio LLC</span>
708 <span id="footer-east"> <a href="http://www.imagemagick.org/script/contact.php">Contact the Wizards</a></span>
709 </div>
710 <div style="clear: both; margin: 0; width: 100%; "></div>
711 <script type="text/javascript">
712 var _gaq = _gaq || [];
713 _gaq.push(['_setAccount', 'UA-17690367-1']);
714 _gaq.push(['_trackPageview']);
715
716 (function() {
717 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
718 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
719 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
720 })();
721 </script>
722</body>
723</html>