]> granicus.if.org Git - imagemagick/blob - www/compose.html
(no commit message)
[imagemagick] / www / compose.html
1
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
3   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
4 <html version="-//W3C//DTD XHTML 1.1//EN"
5       xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
6       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7       xsi:schemaLocation="http://www.w3.org/1999/xhtml
8                           http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
9 <head>
10   <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
11   <meta name=viewport content="width=device-width, initial-scale=0.3333334">
12   <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4"/>
13   <title>ImageMagick: Alpha Compositing</title>
14   <meta http-equiv="content-language" content="en-US"/>
15   <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
16   <meta http-equiv="reply-to" content="magick-users@imagemagick.org"/>
17   <meta name="application-name" content="ImageMagick"/>
18   <meta name="description" content="A collection of tools and libraries to read, write, and manipulate an image in any of the more popular image formats."/>
19   <meta name="application-url" content="http://www.imagemagick.org"/>
20   <meta name="generator" content="PHP"/>
21   <meta name="keywords" content="alpha, compositing, convert, edit, compose, image, pixel"/>
22   <meta name="rating" content="GENERAL"/>
23   <meta name="robots" content="INDEX, FOLLOW"/>
24   <meta name="generator" content="ImageMagick Studio LLC"/>
25   <meta name="author" content="ImageMagick Studio LLC"/>
26   <meta name="revisit-after" content="2 DAYS"/>
27   <meta name="resource-type" content="document"/>
28   <meta name="copyright" content="Copyright (c) 1999-2012 ImageMagick Studio LLC"/>
29   <meta name="distribution" content="Global"/>
30   <link rel="icon" href="../images/wand.png"/>
31   <link rel="shortcut icon" href="../images/wand.ico" type="images/x-icon"/>
32   <link rel="canonical" href="http://www.imagemagick.org" />
33   <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"/>
34
35   <!-- Add jQuery library -->
36   <script type="text/javascript" src="http://localhost/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
37   
38   <!-- Add mousewheel plugin (this is optional) -->
39   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/lib/jquery.mousewheel-3.0.6.pack.js"></script>
40   
41   <!-- Add fancyBox -->
42   <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
43   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
44   
45   <!-- Optionally add helpers - button, thumbnail and/or media -->
46   <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" type="text/css" media="screen" />
47   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
48   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>
49   
50   <link rel="stylesheet" href="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" type="text/css" media="screen" />
51   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
52   
53   <script type="text/javascript">
54         $(document).ready(function() {
55                 $(".fancybox").fancybox();
56         });
57   </script>
58
59   <!-- ImageMagick style -->
60   <style type="text/css" media="all">
61     @import url("../www/magick.css");
62   </style>
63 </head>
64
65 <body id="www-imagemagick-org">
66
67 <script type="text/javascript">
68   (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
69   (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
70   m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
71   })(window,document,'offline-script','//www.google-analytics.com/analytics.js','ga');
72
73   ga('create', 'UA-40133312-1', 'imagemagick.org');
74   ga('send', 'pageview');
75 </script>
76
77 <div class="titlebar">
78 <div style="margin: 17px auto; float: left;">
79   <script type="text/javascript">
80   <!--
81     google_ad_client = "pub-3129977114552745";
82     google_ad_slot = "5439289906";
83     google_ad_width = 728;
84     google_ad_height = 90;
85   //-->
86   </script>
87   <script type="text/javascript"
88     src="http://localhost/pagead/show_ads.js">
89   </script>
90 </div>
91 <a href="../discourse-server">
92   <img src="../images/logo.jpg"
93   alt="ImageMagick Logo" width="123" height="118"
94   style="width: 123px; height: 118px; border: 0px; float: right;" /></a>
95 <a href="http://www.imagemagick.org/ImageMagick-7.0.0/index.html">
96   <img src="../images/sprite.jpg"
97   alt="ImageMagick Sprite" width="114" height="118"
98   style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
99 </div>
100
101 <div class="westbar">
102
103 <div class="menu">
104   <a title="About ImageMagick" href="http://www.imagemagick.org/ImageMagick-7.0.0/index.html">About ImageMagick</a>
105 </div>
106 <div class="menu">
107   <a title="Binary Releases" href="binary-releases.html">Binary Releases</a>
108 </div>
109 <div class="sub">
110     <a title="Binary Release: Unix" href="binary-releases.html#unix">Unix</a>
111 </div>
112 <div class="sub">
113     <a title="Binary Release: MacOS X" href="binary-releases.html#macosx">Mac OS X</a>
114 </div>
115 <div class="sub">
116     <a title="Binary Release: iOS" href="binary-releases.html#iOS">iOS</a>
117 </div>
118 <div class="sub">
119     <a title="Binary Release: Windows" href="binary-releases.html#windows">Windows</a>
120 </div>
121 <div class="sep"></div>
122 <div class="menu">
123   <a title="Command-line Tools" href="command-line-tools.html">Command-line Tools</a>
124 </div>
125 <div class="sub">
126     <a title="Command-line Tools: Processing" href="command-line-processing.html">Processing</a>
127 </div>
128 <div class="sub">
129     <a title="Command-line Tools: Options" href="command-line-options.html">Options</a>
130 </div>
131 <div class="sub">
132     <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
133 </div>
134 <div class="menu">
135   <a title="Program Interfaces" href="api.html">Program Interfaces</a>
136 </div>
137 <div class="sub">
138     <a title="Program Interface: MagickWand" href="magick-wand.html">MagickWand</a>
139 </div>
140 <div class="sub">
141     <a title="Program Interface: MagickCore" href="magick-core.html">MagickCore</a>
142 </div>
143 <div class="sub">
144     <a title="Program Interface: PerlMagick" href="perl-magick.html">PerlMagick</a>
145 </div>
146 <div class="sub">
147     <a title="Program Interface: Magick++" href="magick++.html">Magick++</a>
148 </div>
149 <div class="sep"></div>
150 <div  class="menu">
151    <a title="Install from Source" href="install-source.html">Install from Source</a>
152 </div>
153 <div class="sub">
154     <a title="Install from Source: Unix" href="install-source.html#unix">Unix</a>
155 </div>
156 <div class="sub">
157     <a title="Install from Source: Windows" href="install-source.html#windows">Windows</a>
158  </div>
159 <div class="menu">
160   <a title="Resources" href="resources.html">Resources</a>
161 </div>
162 <div class="menu">
163   <a title="Architecture" href="architecture.html">Architecture</a>
164 </div>
165 <div class="menu">
166   <a title="Download" href="download.html">Download</a>
167 </div>
168 <div class="sep"></div>
169 <div class="menu">
170   <a title="Search" href="search.html">Search</a>
171 </div>
172 <div class="sep"></div>
173 <div class="menu">
174   <a title="Site Map" href="sitemap.html">Site Map</a>
175 </div>
176 <div  class="sub">
177   <a title="Site Map: Links" href="links.html">Links</a>
178 </div>
179 <div class="sep"></div>
180 </div>
181
182 <div class="eastbar">
183   <script type="text/javascript">
184     /* <![CDATA[ */
185     window.___gcfg = {
186       lang: 'en-US'
187     };
188
189     (function() {
190       var po = document.createElement('offline-script');
191       po.type = 'text/javascript';
192       po.async = true;
193       po.src = 'https://apis.google.com/js/plusone.js';
194       var script = document.getElementsByTagName('offline-script')[0];
195       script.parentNode.insertBefore(po, script);
196     })();
197     var gplusone = document.getElementById("gplusone");
198     gplusone.setAttribute("data-size","medium");
199     gplusone.setAttribute("data-count","true");
200     /* ]]> */
201   </script>
202   <script type="text/javascript">
203     /* <![CDATA[ */
204     (function() {
205         var po = document.createElement('offline-script'), t = document.getElementsByTagName('offline-script')[0];
206         po.type = 'text/javascript';
207         po.async = true;
208         po.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
209         var script = document.getElementsByTagName('offline-script')[0];
210         script.parentNode.insertBefore(po, script);
211     })();
212     /* ]]> */
213   </script>
214   <div> <a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="http://www.imagemagick.org/"></a></div>
215   <noscript>
216     <a href="http://flattr.com/thing/947300/Convert-Edit-And-Compose-Images" target="_blank">
217     <img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" width="93" height="20" border="0" /></a>
218   </noscript>
219   <div class="g-plusone" data-size="standard" data-count="true"></div>
220 </div>
221
222 <div class="main">
223
224 <h1>ImageMagick Image Composition</h1>
225 <div class="doc-section">
226 <p>This page descibed the Image composition methods that is used to define how
227 two images should be merged together in various image operations.  For the
228 Command Line API it is typically set using the <a
229 href="command-line-options.html#compose" >-compose</a> setting option. </p>
230
231
232 <p>The description of composition uses abstract terminology in order to allow
233 the description to be more precise, while avoiding constant values which are
234 specific to a particular build configuration. Each image pixel is represented
235 by red, green, and blue levels (which are equal for a gray pixel). The
236 build-dependent value <em class="QR">QuantumRange</em> is the maximum integral
237 value which may be stored, per pixel, in the red, green, or blue channels of
238 the image. Each image pixel may also optionally (if the image matte channel is
239 enabled) have an associated level of opacity, ranging from <em>opaque</em> to
240 <em>transparent</em>, which may be used to determine the influence of the pixel
241 color when compositing the pixel with another image pixel. If the image matte
242 channel is disabled, then all pixels in the image are treated as opaque. The
243 color of an opaque pixel is fully visible while the color of a transparent
244 pixel color is entirely absent (pixel color is ignored).</p>
245
246 <p>By definition, raster images have a rectangular shape. All image rows are of
247 equal length, as are all image columns. By treating the alpha channel as a
248 visual "mask" the rectangular image may be given a "shape" by treating the
249 alpha channel as a cookie-cutter for the image. This is done by setting the
250 pixels within the shape to be opaque, with pixels outside the shape set as
251 transparent. Pixels on the boundary of the shape may be between opaque and
252 transparent in order to provide antialiasing (visually smooth edges). The
253 description of the composition operators use this concept of image "shape" in
254 order to make the description of the operators easier to understand. While it
255 is convenient to describe the operators in terms of "shapes" they are by no
256 means limited to mask-style operations since they are based on continuous
257 floating-point mathematics rather than simple boolean operations.</p>
258
259 <p>The following alpha blending (Duff-Porter) compose methods are available:</p>
260
261 <table class="doc">
262   <tbody>
263   <tr valign="top">
264     <th align="left" style="width: 8%">Method</th>
265     <th align="left">Description</th>
266   </tr>
267
268   <tr valign="top">
269     <td valign="top">clear</td>
270     <td valign="top">Both the color and the alpha of the destination are
271         cleared. Neither the source nor the destination are used (except for
272         destinations size and other meta-data which is always preserved.</td>
273   </tr>
274
275   <tr valign="top">
276     <td valign="top">src</td>
277     <td valign="top">The source is copied to the destination. The destination
278         is not used as input, though it is cleared.</td>
279   </tr>
280
281   <tr valign="top">
282     <td valign="top">dst</td>
283     <td valign="top">The destination is left untouched. The source image is
284         completely ignored.</td>
285   </tr>
286
287   <tr valign="top">
288     <td valign="top">src-over</td>
289     <td valign="top">The source is composited over the destination. this is
290        the default alpha blending compose method, when neither the compose
291        setting is set, nor is set in the image meta-data.</td>
292   </tr>
293
294   <tr valign="top">
295     <td valign="top">dst-over</td>
296     <td valign="top">The destination is composited over the source and the
297         result replaces the destination.</td>
298   </tr>
299
300   <tr valign="top">
301     <td valign="top">src-in</td>
302     <td valign="top">The part of the source lying inside of the destination
303         replaces the destination.</td>
304   </tr>
305
306   <tr valign="top">
307     <td valign="top">dst-in</td>
308     <td valign="top">The part of the destination lying inside of the source
309         replaces the destination. Areas not overlaid are cleared.</td>
310   </tr>
311
312   <tr valign="top">
313     <td valign="top">src-out</td>
314     <td valign="top">The part of the source lying outside of the destination
315         replaces the destination.</td>
316   </tr>
317
318   <tr valign="top">
319     <td valign="top">dst-out</td>
320     <td valign="top">The part of the destination lying outside of the source
321         replaces the destination.</td>
322   </tr>
323
324   <tr valign="top">
325     <td valign="top">src-atop</td>
326     <td valign="top">The part of the source lying inside of the destination is
327         composited onto the destination.</td>
328   </tr>
329
330   <tr valign="top">
331     <td valign="top">dst-atop</td>
332     <td valign="top">The part of the destination lying inside of the source is
333         composited over the source and replaces the destination. Areas not
334         overlaid are cleared. </td>
335   </tr>
336
337   <tr valign="top">
338     <td valign="top">xor</td>
339     <td valign="top">The part of the source that lies outside of the
340         destination is combined with the part of the destination that lies
341         outside of the source.  Source or Destination, but not both. </td>
342   </tr>
343
344   </tbody>
345 </table>
346
347 <p>Any of the 'Src-*' methods can also be specified without the 'Src-' part.
348 For example the default compose method can be specified as just 'Over'.</p>
349
350 <p>Many of these compose methods will clear the destination image which was
351 not overlaid by the source image.  This is to be expected as part of that
352 specific composition methods defintion. You can disable this by setting the
353 special <a href="command-line-options.html#define"
354 >-define</a> 'compose:outside-overlay' to a value of 'false' will turn off
355 this behaviour. </p>
356
357 <p>On top of the above 12 Duff-Porter Alpha Composition methods, one special
358 related method '<code>Copy</code>' has been provided. This is equivalent to
359 using the '<code>Src</code>'  with the special <a href="command-line-options.html#define"
360 >-define</a> option '<code>compose:outside-overlay</code>' set to
361 '<code>false</code>', so as to only modify the overlaid area, without clearing
362 the rest of the image outside the overlaid area.  </p>
363
364 <p>The following mathemathical composition methods are also available. </p>
365
366 <table class="doc">
367   <tbody>
368   <tr valign="top">
369     <th align="left" style="width: 8%">Method</th>
370     <th align="left">Description</th>
371   </tr>
372
373   <tr valign="top">
374     <td valign="top">multiply</td>
375     <td valign="top">The source is multiplied by the destination and replaces
376         the destination. The resultant color is always at least as dark as
377         either of the two constituent colors. Multiplying any color with black
378         produces black. Multiplying any color with white leaves the original
379         color unchanged.</td>
380   </tr>
381
382   <tr valign="top">
383     <td valign="top">screen</td>
384     <td valign="top">The source and destination are complemented and then
385         multiplied and then replace the destination. The resultant color is
386         always at least as light as either of the two constituent colors.
387         Screening any color with white produces white. Screening any color
388         with black leaves the original color unchanged.</td>
389   </tr>
390
391   <tr valign="top">
392     <td valign="top">plus</td>
393     <td valign="top">The source is added to the destination and replaces the
394         destination. This operator is useful for averaging or a controled
395         merger of two images, rather than a direct overlay.</td>
396   </tr>
397
398   <tr valign="top">
399     <td valign="top">add</td>
400     <td valign="top">As per 'plus' but transparency data is treated as matte
401         values. As such any transparent areas in either image remain
402         transparent. </td>
403   </tr>
404
405   <tr valign="top">
406     <td valign="top">minus</td>
407     <td valign="top">Subtract the colors in the source image from the
408         destination image. When transparency is involved, opaque areas is
409         subtracted from any destination opaque areas. </td>
410   </tr>
411
412   <tr valign="top">
413     <td valign="top">subtract</td>
414     <td valign="top">Subtract the colors in the source image from the
415         destination image. When transparency is involved transparent areas are
416         subtracted, so only the opaque areas in the source remain opaque in
417         the destination image. </td>
418   </tr>
419
420   <tr valign="top">
421     <td valign="top">difference</td>
422     <td valign="top">Subtracts the darker of the two constituent colors from
423         the lighter. Painting with white inverts the destination color.
424         Painting with black produces no change.</td>
425   </tr>
426
427   <tr valign="top">
428     <td valign="top">exclusion</td>
429     <td valign="top">Produces an effect similar to that of 'difference', but
430         appears as lower contrast.  Painting with white inverts the
431         destination color. Painting with black produces no change.</td>
432   </tr>
433
434   <tr valign="top">
435     <td valign="top">darken</td>
436     <td valign="top">Selects the darker of the destination and source colors.
437         The destination is replaced with the source when the source is darker,
438         otherwise it is left unchanged.</td>
439   </tr>
440
441   <tr valign="top">
442     <td valign="top">lighten</td>
443     <td valign="top">Selects the lighter of the destination and source colors.
444         The destination is replaced with the source when the source is
445         lighter, otherwise it is left unchanged. </td>
446   </tr>
447
448   </tbody>
449 </table>
450
451 <p>Typically these use the default 'Over' alpha blending when transparencies
452 are also involved, except for 'Plus' which uses a 'plus' alpha blending.  This
453 means the alpha channel  of both images will only be used to ensure that any
454 visible input remains visible even in parts not overlaid. It also means that
455 any values are weighted by the alpha channel of the input and output images.
456 This 'Over' alpha blending is also applied to the lighting composition methods
457 below. </p>
458
459 <p>As of IM v6.6.1-6, if the special '<code>Sync</code>' flag is not specified
460 (enabled by default) with the <a href="command-line-options.html#channel"
461 >-channel</a> setting, then the above mathematical compositions will nolonger
462 synchronise its actions with the alpha channel.  Instead the math composition
463 will be applied on an individual channel basis as defined by the <a
464 href="command-line-options.html#channel"
465 >-channel</a>.  This includes the alpha channel. This special usage
466 allows you to perform true mathematics of the image channels, without alpha
467 compostion effects, becomming involved. </p>
468
469 <p>This special flag is not applied to the lighting composition methods (see
470 below) even though they are closely related to mathematical composition
471 methods.</p>
472
473 <p>The following lighting composition methods are also available. </p>
474
475 <table class="doc">
476   <tbody>
477   <tr valign="top">
478     <th align="left" style="width: 8%">Method</th>
479     <th align="left">Description</th>
480   </tr>
481
482   <tr valign="top">
483     <td valign="top">linear-dodge</td>
484     <td valign="top">This is equivalent to 'Plus' in that the color channels
485         are simply added, however it does not 'Plus' the alpha channel, but
486         uses the normal 'Over' alpha blending, which transparencies are
487         involved.  Produces a sort of additive multiply-like result. Added
488         ImageMagick version 6.5.4-3. </td>
489   </tr>
490
491   <tr valign="top">
492     <td valign="top">linear-burn</td>
493     <td valign="top">As 'Linear-Dodge', but also subtract one from the result.
494         Sort of a additive 'Screen' of the images.  Added ImageMagick version
495         6.5.4-3. </td>
496   </tr>
497
498   <tr valign="top">
499     <td valign="top">color-dodge</td>
500     <td valign="top">Brightens the destination color to reflect the source
501         color. Painting with black produces no change.</td>
502   </tr>
503
504   <tr valign="top">
505     <td valign="top">color-burn</td>
506     <td valign="top">Darkens the destination color to reflect the source
507         color.  Painting with white produces no change. Fixed in ImageMagick
508         version 6.5.4-3. </td>
509   </tr>
510
511   <tr valign="top">
512     <td valign="top">overlay</td>
513     <td valign="top">Multiplies or screens the colors, dependent on the
514         destination color. Source colors overlay the destination whilst
515         preserving its highlights and shadows. The destination color is not
516         replaced, but is mixed with the source color to reflect the lightness
517         or darkness of the destination.</td>
518   </tr>
519
520   <tr valign="top">
521     <td valign="top">hard-light</td>
522     <td valign="top">Multiplies or screens the colors, dependent on the source
523         color value. If the source color is lighter than 0.5, the destination
524         is lightened as if it were screened. If the source color is darker
525         than 0.5, the destination is darkened, as if it were multiplied. The
526         degree of lightening or darkening is proportional to the difference
527         between the source color and 0.5. If it is equal to 0.5 the
528         destination is unchanged.  Painting with pure black or white produces
529         black or white.</td>
530   </tr>
531
532
533   <tr valign="top">
534     <td valign="top">linear-light</td>
535     <td valign="top">Like 'Hard-Light' but using linear-dodge and linear-burn
536         instead.  Increases contrast slightly with an impact on the
537         foreground's tonal values.</td>
538   </tr>
539
540   <tr valign="top">
541     <td valign="top">soft-light</td>
542     <td valign="top">Darkens or lightens the colors, dependent on the source
543         color value. If the source color is lighter than 0.5, the destination
544         is lightened. If the source color is darker than 0.5, the destination
545         is darkened, as if it were burned in. The degree of darkening or
546         lightening is proportional to the difference between the source color
547         and 0.5. If it is equal to 0.5, the destination is unchanged. Painting
548         with pure black or white produces a distinctly darker or lighter area,
549         but does not result in pure black or white. Fixed in ImageMagick
550         version 6.5.4-3. </td>
551   </tr>
552
553   <tr valign="top">
554     <td valign="top">pegtop-light</td>
555     <td valign="top">Almost equivalent to 'Soft-Light', but using a
556         continuious mathematical formula rather than two conditionally
557         selected formulae. Added ImageMagick version 6.5.4-3. </td>
558   </tr>
559
560   <tr valign="top">
561     <td valign="top">vivid-light</td>
562     <td valign="top">A modified 'Linear-Light' designed to preserve very stong
563         primary and secondary colors in the image. Added ImageMagick version
564         6.5.4-3. </td>
565   </tr>
566
567   <tr valign="top">
568     <td valign="top">pin-light</td>
569     <td valign="top">Similar to 'Hard-Light', but using sharp linear shadings,
570         to similate the effects of a strong 'pinhole' light source. Added
571         ImageMagick version 6.5.4-3. </td>
572   </tr>
573
574   </tbody>
575 </table>
576
577 <p>Also included are these special purpose compose methods:</p>
578
579 <table class="doc">
580   <tbody>
581   <tr valign="top">
582     <th align="left" style="width: 8%">Method</th>
583     <th align="left">Description</th>
584   </tr>
585
586   <tr valign="top">
587     <td valign="top">copy</td>
588     <td valign="top">This is equivalent to the Duff-Porter composition method
589         '<code>Src,</code>' but without clearing the parts of the destination
590         image that is not overlaid.  </td>
591     </tr>
592
593   <tr valign="top">
594     <td valign="top">copy-*</td>
595     <td valign="top">Copy the specified channel (Red, Green, Blue, Cyan,
596         Magenta, Yellow, Black, or Opacity) in the source image to the
597         same channel in the destination image.  If the channel specified
598         does not exist in the source image, (which can only happen for methods,
599         '<code>copy-opacity</code>' or '<code>copy-black</code>') then it is
600         assumed that the source image is a special grayscale channel image
601         of the values that is to be copied. </td>
602     </tr>
603
604   <tr valign="top">
605     <td valign="top">change-mask</td>
606     <td valign="top">Replace any destination pixel that is the similar to the
607     source images pixel (as defined by the current <a
608     href="command-line-options.html#fuzz">-fuzz</a> factor), with transparency.
609     </td>
610   </tr>
611   </tbody>
612 </table>
613
614 <p>On top of these composed methods are a few special ones that not only require
615 the two images that are being merged or overlaid, but have some extra numerical
616 arguments, which are tabled below. </p>
617
618 <p>In the "<code>composite</code>" command these composition methods are
619 selected using special options with the arguments needed. They are usually,
620 but not always, the same name as the composte 'method' they use, and replaces
621 the normal use of the <a href="command-line-options.html#compose" >-compose</a>
622 setting in the "<code>composite</code>" command.  For example... </p>
623
624 <p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>composite ... -blend 50x50 ...</span></p>
625 <p>As of IM v6.5.3-4 the "<code>convert</code>" command can now also supply
626 these extra arguments to its <a href="command-line-options.html#composite"
627 >-composite</a> operator, using the special <a href="command-line-options.html#define">-define</a>
628 attribute of '<code class="arg">compose:args</code>'.  This means you can now
629 make use of these special argumented <a href="command-line-options.html#compose"
630 >-compose</a> methods, those the argument and the method both need to be set
631 separately.  For example... </p>
632
633 <p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>convert ... -compose blend  -define compose:args=50,50 -composite ...</span></p>
634 <p>The following is a table of these special 'argumented' compose methods,
635 with a brief summary of what they do. For more details see the equivalent
636 "composite" command option name.  </p>
637
638 <table class="doc">
639   <tbody>
640   <tr valign="top">
641     <th align="left" style="width: 8%">Method</th>
642     <th align="left">Description</th>
643   </tr>
644
645   <tr valign="top">
646     <td valign="top">dissolve</td>
647     <td valign="top">Arguments:
648         <em class="arg">src_percent</em>[x<em class="arg">dst_percent</em>]
649     <br/>Equivalent to "<code>composite</code>" <a href="command-line-options.html#dissolve">-dissolve</a>
650     <br/>Dissolve the 'source' image by the percentage given before overlaying
651         'over' the 'destination' image. If <em class="arg">src_percent</em> is
652         greater than 100, it starts dissolving the main image so it will
653         become transparent at a value of '<code class="arg">200</code>'.  If
654         both percentages are given, each image are dissolved to the
655         percentages given.
656     </td>
657   </tr>
658
659   <tr valign="top">
660     <td valign="top">blend</td>
661     <td valign="top">Arguments:
662         <em class="arg">src_percent</em>[x<em class="arg">dst_percent</em>]
663     <br/>Equivalent to "<code>composite</code>" <a
664         href="command-line-options.html#blend">-blend</a>
665     <br/>Average the images together ('plus') according to the percentages
666         given and each pixels transparency.  If only a single percentage value
667         is given it sets the weight of the composite or 'source' image, while
668         the background image is weighted by the exact opposite amount. That is
669         a <code>-blend 30</code> merges 30% of the 'source' image with 70% of
670         the 'destination' image.  Thus it is equivalent to <code>-blend
671         30x70</code>.
672     </td>
673   </tr>
674
675   <tr valign="top">
676     <td valign="top">mathematics</td>
677     <td valign="top">Arguments: <em class="arg">A, B, C, D</em>
678     <br/>Not available in "<code>composite</code>" at this time.
679     <br/>Merge the source and destination images according to the formula
680     <br/>     <code>A*Sc*Dc + B*Sc + C*Dc + D</code>
681     <br/>Can be used to generate a custom composition method that would
682         otherwise need to be implemented using the slow <a
683         href="command-line-options.html#fx">-fx</a> DIY image operator.   Added
684         to ImageMagick version 6.5.4-3.
685     <br/>As of IM v6.6.1-6 this method will do per-channel math compositions
686         if the 'Sync' flag is removed from <a
687         href="command-line-options.html#channel" >-channel</a>, just like all
688         the other mathematical compostion methods above.
689     </td>
690   </tr>
691
692   <tr valign="top">
693     <td valign="top">modulate</td>
694     <td valign="top">Arguments:
695         <em class="arg">brightness</em>[x<em class="arg">saturation</em>]
696     <br/>Equivalent to "<code>composite</code>" <a href="command-line-options.html#watermark">-watermark</a>
697     <br/>Take a grayscale image (with alpha mask) and modify the destination
698         image's brightness according to watermark image's grayscale value and
699         the <em class="arg">brightness</em> percentage.  The destinations
700         color saturation attribute is just direct modified by the <em
701         class="arg">saturation</em> percentage, which defaults to 100 percent
702         (no color change).
703
704     </td>
705   </tr>
706
707   <tr valign="top">
708     <td valign="top">displace</td>
709     <td valign="top">Arguments:
710         <em class="arg">X-scale</em>[x<em class="arg">Y-scale</em>][!][%]
711     <br/>Equivalent to "<code>composite</code>" <a href="command-line-options.html#displace">-displace</a>
712     <br/>With this option, the 'overlay' image, and optionally the 'mask'
713         image, is used as a relative displacement map, which is used to
714         displace the lookup of what part of the destination image is seen at
715         each point of the overlaid area.  Much like the displacement map is a
716         'lens' that distorts the original 'background' image behind it.
717     <br/><br/>
718         The X-scale is modulated by the 'red' channel of the overlay image
719         while the Y-scale is modulated by the green channel, (the mask image
720         if given is rolled into green channel of the overlay image. This
721         separation allows you to modulate the X and Y lookup displacement
722         separately allowing you to do 2-dimensional displacements, rather
723         than 1-dimensional verctored displacements (using grayscale image).
724     <br/><br/>
725         If the overlay image contains transparency this is used as a mask
726         of the resulting image to remove 'invalid' pixels.
727     <br/><br/>
728         The '%' flag makes the displacement scale relative to the size of the
729         overlay image (100% = half width/height of image). Using '!' switches
730         percentage arguments to refer to the destination image size instead.
731     <br/><br/>
732         Special flags were added Added to ImageMagick version 6.5.3-5.
733     </td>
734   </tr>
735
736   <tr valign="top">
737     <td valign="top">distort</td>
738     <td valign="top">Arguments:
739         <em class="arg">X-scale</em>[x<em class="arg">Y-scale</em
740         >[+<em class="arg">X-center</em>+<em class="arg">Y-center</em>]][!][%]
741     <br/>Not available in "<code>composite</code>" at this time.
742     <br/>Exactly as per 'Displace' (above), but using absolute coordinates,
743         relative to the center of the overlay (or that given).  Basically
744         allows you to generate absolute distortion maps where 'black' will
745         look up the left/top edge, and 'white' looks up the bottom/right
746         edge of the destination image, according to the scale given.
747     <br/><br/>
748         The '!' flag not only switches percentage scaling, to use the
749         destination image, but also the image the center offset of the lookup.
750         This means the overlay can lookup a completely different region of the
751         destination image.
752     <br/><br/>
753         Added to ImageMagick version 6.5.3-5.
754     </td>
755   </tr>
756
757   <tr valign="top">
758     <td valign="top">blur</td>
759     <td valign="top">Arguments:
760         <em class="arg">Width</em>[x<em class="arg">Height</em
761           >[+<em class="arg">Angle</em>][+<em class="arg">Angle2</em>]]
762     <br/>Equivalent to "<code>composite</code>" <a href="command-line-options.html#blur-composite">-blur</a>
763     <br/>A Variable Blur Mapping Composition method, where each pixel in the
764         overlaid region is replaced with an Elliptical Weighted Average (EWA),
765         with an ellipse (typically a circle) of the given sigma size, scaled
766         according to overlay (source image) grayscale mapping.
767     <br/><br/>
768         As per 'Displace' and 'Distort', the red channel will modulate the
769         width of the ellipse, while the green channel will modulate the height
770         of the ellipse. If a single Angle value is given in the arguments,
771         then the ellipse will then be rotated by the angle specifed.
772     <br/><br/>
773         Normally the blue channel of the mapping overlay image is ignored.
774         However if a second ellipse angle is given, then it is assumed that
775         the blue channel defines a variable angle for the ellipse ranging from
776         the first angle to the second angle given.  This allows to generate
777         radial blurs, or a rough approximation for rotational blur. Or any mix
778         of the two.
779     <br/><br/>
780         Added to ImageMagick version 6.5.4-0.
781     </td>
782   </tr>
783
784   </tbody>
785 </table>
786
787 <p>To print a complete list of all the available compose operators, use <a
788 href="command-line-options.html#list">-list compose</a>.</p>
789 </div>
790
791 </div>
792
793 <div id="linkbar">
794     <span id="linkbar-west"> </span>
795
796     <span id="linkbar-center">
797       <a href="../discourse-server">Discourse Server</a> •
798       <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
799       <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a> •
800       <a href="http://jqmagick.imagemagick.org/">JqMagick</a>
801     </span>
802     <span id="linkbar-east"> </span>
803 </div>
804 <div class="footer">
805   <span id="footer-west">©  1999-2015 ImageMagick Studio LLC</span>
806   <span id="footer-east"> <a href="contact.html">Contact the Wizards</a></span>
807 </div>
808 <div style="clear: both; margin: 0; width: 100%; "></div>
809 </body>
810 </html>