]> granicus.if.org Git - imagemagick/blob - www/compose.html
(no commit message)
[imagemagick] / www / compose.html
1 \r
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" \r
3   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">\r
4 <html version="-//W3C//DTD XHTML 1.1//EN"\r
5       xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"\r
6       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\r
7       xsi:schemaLocation="http://www.w3.org/1999/xhtml\r
8                           http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">\r
9 <head>\r
10   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\r
11   <meta name="google-site-verification" content="MxsMq6bdLOx0KSuz1MY6yG9ZTIJ7_7DVRfl5NCAT5Yg"/>\r
12   <title>ImageMagick: Alpha Compositing</title>
13   <meta http-equiv="Content-Language" content="en-US"/>
14   <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
15   <meta http-equiv="Reply-to" content="magick-users@imagemagick.org"/>
16   <meta name="Application-name" content="ImageMagick"/>
17   <meta name="Description" content="Use ImageMagick to convert, edit, or compose bitmap images in a variety of formats.  In addition resize, rotate, shear, distort and transform images automagically."/>
18   <meta name="Application-url" content="http://www.imagemagick.org"/>
19   <meta name="Generator" content="PHP"/>
20   <meta name="Keywords" content="alpha, compositing, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand, ImageMagickObject, Image, Processing, Automagically"/>
21   <meta name="Rating" content="GENERAL"/>
22   <meta name="Robots" content="INDEX, FOLLOW"/>
23   <meta name="Generator" content="ImageMagick Studio LLC"/>
24   <meta name="Author" content="ImageMagick Studio LLC"/>
25   <meta name="Revisit-after" content="2 DAYS"/>
26   <meta name="Resource-type" content="document"/>
27   <meta name="Copyright" content="Copyright (c) 1999-2011 ImageMagick Studio LLC"/>
28   <meta name="Distribution" content="Global"/>
29   <link rel="icon" href="../images/wand.png"/>
30   <link rel="shortcut icon" href="../images/wand.ico"  type="images/x-icon"/>
31   <link rel="canonical" href="http://www.imagemagick.org" />\r
32   <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"/>\r
33   <link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" />\r
34   <link rel="stylesheet" type="text/css" href="http://www.imagemagick.org/fancybox/jquery.fancybox-1.3.4.css" media="screen" />\r
35   <style type="text/css" media="all">\r
36     @import url("../www/magick.css");\r
37   </style>\r
38   <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>\r
39   <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>\r
40   <script type="text/javascript" src="http://www.imagemagick.org/fancybox/jquery.fancybox-1.3.4.pack.js"></script>\r
41   <script type="text/javascript">\r
42     $(document).ready(function() {\r
43       $("a[href$=.jpg],a[href$=.png],a[href$=.gif]").fancybox({\r
44         'transitionIn'  : 'elastic',\r
45         'transitionOut' : 'elastic',\r
46         'overlayShow'   : false,\r
47         'opacity'       : true\r
48       });\r
49     });\r
50   </script>\r
51 </head>\r
52 \r
53 <body id="www-imagemagick-org">\r
54 <div class="titlebar">\r
55 <div style="margin: 17px auto; float: left;">\r
56   <script type="text/javascript">\r
57   <!--\r
58     google_ad_client = "pub-3129977114552745";\r
59     google_ad_slot = "5439289906";\r
60     google_ad_width = 728;\r
61     google_ad_height = 90;\r
62   //-->\r
63   </script>\r
64   <script type="text/javascript"\r
65     src="http://pagead2.googlesyndication.com/pagead/show_ads.js">\r
66   </script>\r
67 </div>\r
68 <a href="http://www.imagemagick.org/discourse-server/">\r
69   <img src="../images/logo.jpg"\r
70   alt="ImageMagick Logo"\r
71   style="width: 123px; height: 118px; border: 0px; float: right;" /></a>\r
72 <a href="../index.html">\r
73   <img src="../images/sprite.jpg"\r
74   alt="ImageMagick Sprite"\r
75   style="width: 114px; height: 118px; border: 0px; float: right;" /></a>\r
76 </div>\r
77 \r
78 <div class="westbar">\r
79 \r
80 <div class="menu">
81   <a title="About ImageMagick" href="../index.html">About ImageMagick</a>
82 </div>
83 <div class="menu">
84   <a title="Binary Releases" href="../www/binary-releases.html">Binary Releases</a>
85 </div>
86 <div class="sub">
87     <a title="Binary Release: Unix" href="../www/binary-releases.html#unix">Unix</a>
88 </div>
89 <div class="sub">
90     <a title="Binary Release: MacOS X" href="../www/binary-releases.html#macosx">Mac OS X</a>
91 </div>
92 <div class="sub">
93     <a title="Binary Release: iOS" href="../www/binary-releases.html#iOS">iOS</a>
94 </div>
95 <div class="sub">
96     <a title="Binary Release: Windows" href="../www/binary-releases.html#windows">Windows</a>
97 </div>
98 <div class="sep"></div>\r
99 <div class="menu">
100   <a title="Command-line Tools" href="../www/command-line-tools.html">Command-line Tools</a>
101 </div>
102 <div class="sub">
103     <a title="Command-line Tools: Processing" href="../www/command-line-processing.html">Processing</a>
104 </div>
105 <div class="sub">
106     <a title="Command-line Tools: Options" href="../www/command-line-options.html">Options</a>
107 </div>
108 <div class="sub">
109     <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
110 </div>
111 <div class="menu">
112   <a title="Program Interfaces" href="../www/api.html">Program Interfaces</a>
113 </div>
114 <div class="sub">
115     <a title="Program Interface: MagickWand" href="../www/magick-wand.html">MagickWand</a>
116 </div>
117 <div class="sub">
118     <a title="Program Interface: MagickCore" href="../www/magick-core.html">MagickCore</a>
119 </div>
120 <div class="sub">
121     <a title="Program Interface: PerlMagick" href="../www/perl-magick.html">PerlMagick</a>
122 </div>
123 <div class="sub">
124     <a title="Program Interface: Magick++" href="../www/magick++.html">Magick++</a>
125 </div>
126 <div class="sep"></div>\r
127 <div  class="menu">
128    <a title="Install from Source" href="../www/install-source.html">Install from Source</a>
129 </div>
130 <div class="sub">
131     <a title="Install from Source: Unix" href="../www/install-source.html#unix">Unix</a>
132 </div>
133 <div class="sub">
134     <a title="Install from Source: Windows" href="../www/install-source.html#windows">Windows</a>
135  </div>
136 <div class="menu">
137   <a title="Resources" href="../www/resources.html">Resources</a>
138 </div>
139 <div class="menu">
140   <a title="Architecture" href="../www/architecture.html">Architecture</a>
141 </div>
142 <div class="menu">
143   <a title="Download" href="../www/download.html">Download</a>
144 </div>
145 <div class="sep"></div>\r
146 <div class="menu">
147   <a title="Search" href="../www/search.html">Search</a>
148 </div>
149 <div class="sep"></div>\r
150 <div class="menu">
151   <a title="Site Map" href="../www/sitemap.html">Site Map</a>
152 </div>
153 <div  class="sub">
154   <a title="Site Map: Links" href="../www/links.html">Links</a>
155 </div>
156 <div class="sep"></div>\r
157 <div  class="menu">
158   <a rel="follow" title="Sponsors" href="../www/sponsors.html">Sponsors:</a>
159
160 <a href="http://www.networkredux.com">
161   <img src="../images/networkredux.png" alt="[sponsor]"
162   style="margin-top: 4px; margin-left: 4px; border: 0px; float: left;" /></a>
163 <div class="sponsbox">
164 <div  class="sponsor">
165   <a rel="follow" title="Sponsor: Web Hosting" href="http://www.micfo.com">Web Hosting</a><!-- 209901010090s golestan -->
166 </div>
167 <div  class="sponsor">
168   <a rel="follow" title="Sponsor: Autos part" href="http://www.pkwteile.de/autoteile">Autos part</a><!-- 201112010090s jr@pkwte... -->
169 </div>
170 <div  class="sponsor">
171   <a rel="follow" title="Sponsor: Search engine optimisation" href="http://www.seomoves.com.au">Search engine optimisation</a><!-- 201110010090s jen@seo lowprofilelinks -->
172 </div>
173 <div  class="sponsor">
174   <a rel="follow" title="Sponsor: Druckerei" href="http://print24.com/de/">Druckerei</a><!-- 201110010720 -->
175 </div>
176 <div  class="sponsor">
177   <a rel="follow" title="Sponsor: Web Hosting Deals" href="http://www.webhostingdeals.org">Web Hosting Deals</a><!-- 201111010270 chee.hoa darin -->
178 </div>
179 <div  class="sponsor">
180   <a rel="follow" title="Sponsor: Web Hosting Reviews" href="http://www.webhostingsecretrevealed.com">Web Hosting Secret Revealed</a><!-- 201204010540 iamchee jerry -->
181 </div>
182 <div  class="sponsor">
183   <a rel="follow" title="Sponsor: Web Hosting Break" href="http://www.webhostingbreak.com">Web Hosting Break</a><!-- 201109010090 ian@ian-m... -->
184 </div>
185 <div  class="sponsor">
186   <a rel="follow" title="Sponsor: Druckerei" href="http://www.allesdruck.de">Druckerei</a><!-- 201303011500 r.leo -->
187 </div>
188 <div  class="sponsor">
189   <a rel="follow" title="Sponsor: Website Hosting" href="http://www.hostreviewgeeks.com">Website Hosting</a><!-- 201110010090 alexanian media -->
190 </div>
191 <div  class="sponsor">
192   <a rel="follow" title="Sponsor: Hotel München" href="http://www.messehotel-erb-muenchen.de">Hotel München</a><!-- 201111010450 cerb -->
193 </div>
194 <div  class="sponsor">
195   <a rel="follow" title="Sponsor: Best Web Hosting" href="http://webhostinggeeks.com">Best Web Hosting</a><!-- 201110010720 -->
196 </div>
197 <div  class="sponsor">
198   <a rel="follow" title="Sponsor: Flyer drucken" href="http://www.online-druck.biz">Flyer drucken</a><!-- 201109010900 Floeter-->
199 </div>
200 <div  class="sponsor">
201   <a rel="follow" title="Sponsor: Web Hosting Ratings" href="http://webhostingrating.com">Web Hosting Ratings</a><!-- 201110010720 -->
202 </div>
203 <div  class="sponsor">
204    <a rel="follow" title="Sponsor: Fernsehdienst Berlin" href="http://www.atlas-multimedia.de">Fernsehdienst Berlin</a><!-- 2011090100025 atlas.multimedia-->
205 </div>
206 </div>
207 </div>
208 </div>\r
209 \r
210 <div class="eastbar">\r
211   <div class="g-plusone" data-size="standard" data-count="false"></div>\r
212 </div>\r
213 \r
214 <div class="main">\r
215 \r
216 <h1>ImageMagick Image Composition</h1>
217 <p>This page descibed the Image composition methods that is used to define how
218 two images should be merged together in various image operations.  For the
219 Command Line API it is typically set using the <A
220 HREF="../www/command-line-options.html#compose" >-compose</A> setting option. </p>
221
222
223 <p>The description of composition uses abstract terminology in order to allow
224 the description to be more precise, while avoiding constant values which are
225 specific to a particular build configuration. Each image pixel is represented
226 by red, green, and blue levels (which are equal for a gray pixel). The
227 build-dependent value <em class="QR">QuantumRange</em> is the maximum integral
228 value which may be stored, per pixel, in the red, green, or blue channels of
229 the image. Each image pixel may also optionally (if the image matte channel is
230 enabled) have an associated level of opacity, ranging from <em>opaque</em> to
231 <em>transparent</em>, which may be used to determine the influence of the pixel
232 color when compositing the pixel with another image pixel. If the image matte
233 channel is disabled, then all pixels in the image are treated as opaque. The
234 color of an opaque pixel is fully visible while the color of a transparent
235 pixel color is entirely absent (pixel color is ignored).</p>
236
237 <p>By definition, raster images have a rectangular shape. All image rows are of
238 equal length, as are all image columns. By treating the alpha channel as a
239 visual "mask" the rectangular image may be given a "shape" by treating the
240 alpha channel as a cookie-cutter for the image. This is done by setting the
241 pixels within the shape to be opaque, with pixels outside the shape set as
242 transparent. Pixels on the boundary of the shape may be between opaque and
243 transparent in order to provide antialiasing (visually smooth edges). The
244 description of the composition operators use this concept of image "shape" in
245 order to make the description of the operators easier to understand. While it
246 is convenient to describe the operators in terms of "shapes" they are by no
247 means limited to mask-style operations since they are based on continuous
248 floating-point mathematics rather than simple boolean operations.</p>
249
250 <p>The following alpha blending (Duff-Porter) compose methods are available:</p>
251
252 <table class="doc">
253   <tbody>
254   <tr valign="top">
255     <th align="left" style="width: 8%">Method</th>
256     <th align="left">Description</th>
257   </tr>
258
259   <tr valign="top">
260     <td valign="top">clear</td>
261     <td valign="top">Both the color and the alpha of the destination are
262         cleared. Neither the source nor the destination are used (except for
263         destinations size and other meta-data which is always preserved.</td>
264   </tr>
265
266   <tr valign="top">
267     <td valign="top">src</td>
268     <td valign="top">The source is copied to the destination. The destination
269         is not used as input, though it is cleared.</td>
270   </tr>
271
272   <tr valign="top">
273     <td valign="top">dst</td>
274     <td valign="top">The destination is left untouched. The source image is
275         completely ignored.</td>
276   </tr>
277
278   <tr valign="top">
279     <td valign="top">src-over</td>
280     <td valign="top">The source is composited over the destination. this is
281        the default alpha blending compose method, when neither the compose
282        setting is set, nor is set in the image meta-data.</td>
283   </tr>
284
285   <tr valign="top">
286     <td valign="top">dst-over</td>
287     <td valign="top">The destination is composited over the source and the
288         result replaces the destination.</td>
289   </tr>
290
291   <tr valign="top">
292     <td valign="top">src-in</td>
293     <td valign="top">The part of the source lying inside of the destination
294         replaces the destination.</td>
295   </tr>
296
297   <tr valign="top">
298     <td valign="top">dst-in</td>
299     <td valign="top">The part of the destination lying inside of the source
300         replaces the destination. Areas not overlaid are cleared.</td>
301   </tr>
302
303   <tr valign="top">
304     <td valign="top">src-out</td>
305     <td valign="top">The part of the source lying outside of the destination
306         replaces the destination.</td>
307   </tr>
308
309   <tr valign="top">
310     <td valign="top">dst-out</td>
311     <td valign="top">The part of the destination lying outside of the source
312         replaces the destination.</td>
313   </tr>
314
315   <tr valign="top">
316     <td valign="top">src-atop</td>
317     <td valign="top">The part of the source lying inside of the destination is
318         composited onto the destination.</td>
319   </tr>
320
321   <tr valign="top">
322     <td valign="top">dst-atop</td>
323     <td valign="top">The part of the destination lying inside of the source is
324         composited over the source and replaces the destination. Areas not
325         overlaid are cleared. </td>
326   </tr>
327
328   <tr valign="top">
329     <td valign="top">xor</td>
330     <td valign="top">The part of the source that lies outside of the
331         destination is combined with the part of the destination that lies
332         outside of the source.  Source or Destination, but not both. </td>
333   </tr>
334
335   </tbody>
336 </table>
337
338 <p>Any of the 'Src-*' methods can also be specified without the 'Src-' part.
339 For example the default compose method can be specified as just 'Over'.</p>
340
341 <p>Many of these compose methods will clear the destination image which was
342 not overlaid by the source image.  This is to be expected as part of that
343 specific composition methods defintion. You can disable this by setting the
344 special <A HREF="../www/command-line-options.html#define"
345 >-define</A> 'compose:outside-overlay' to a value of 'false' will turn off
346 this behaviour. </p>
347
348 <p>On top of the above 12 Duff-Porter Alpha Composition methods, one special
349 related method '<kbd>Copy</kbd>' has been provided. This is equivalent to
350 using the '<kbd>Src</kbd>'  with the special <A HREF="../www/command-line-options.html#define"
351 >-define</A> option '<kbd>compose:outside-overlay</kbd>' set to
352 '<kbd>false</kbd>', so as to only modify the overlaid area, without clearing
353 the rest of the image outside the overlaid area.  </p>
354
355 <br><br>
356
357 <p>The following mathemathical composition methods are also available. </p>
358
359 <table class="doc">
360   <tbody>
361   <tr valign="top">
362     <th align="left" style="width: 8%">Method</th>
363     <th align="left">Description</th>
364   </tr>
365
366   <tr valign="top">
367     <td valign="top">multiply</td>
368     <td valign="top">The source is multiplied by the destination and replaces
369         the destination. The resultant color is always at least as dark as
370         either of the two constituent colors. Multiplying any color with black
371         produces black. Multiplying any color with white leaves the original
372         color unchanged.</td>
373   </tr>
374
375   <tr valign="top">
376     <td valign="top">screen</td>
377     <td valign="top">The source and destination are complemented and then
378         multiplied and then replace the destination. The resultant color is
379         always at least as light as either of the two constituent colors.
380         Screening any color with white produces white. Screening any color
381         with black leaves the original color unchanged.</td>
382   </tr>
383
384   <tr valign="top">
385     <td valign="top">plus</td>
386     <td valign="top">The source is added to the destination and replaces the
387         destination. This operator is useful for averaging or a controled
388         merger of two images, rather than a direct overlay.</td>
389   </tr>
390
391   <tr valign="top">
392     <td valign="top">add</td>
393     <td valign="top">As per 'plus' but transparency data is treated as matte
394         values. As such any transparent areas in either image remain
395         transparent. </td>
396   </tr>
397
398   <tr valign="top">
399     <td valign="top">minus</td>
400     <td valign="top">Subtract the colors in the source image from the
401         destination image. When transparency is involved, opaque areas is
402         subtracted from any destination opaque areas. </td>
403   </tr>
404
405   <tr valign="top">
406     <td valign="top">subtract</td>
407     <td valign="top">Subtract the colors in the source image from the
408         destination image. When transparency is involved transparent areas are
409         subtracted, so only the opaque areas in the source remain opaque in
410         the destination image. </td>
411   </tr>
412
413   <tr valign="top">
414     <td valign="top">difference</td>
415     <td valign="top">Subtracts the darker of the two constituent colors from
416         the lighter. Painting with white inverts the destination color.
417         Painting with black produces no change.</td>
418   </tr>
419
420   <tr valign="top">
421     <td valign="top">exclusion</td>
422     <td valign="top">Produces an effect similar to that of 'difference', but
423         appears as lower contrast.  Painting with white inverts the
424         destination color. Painting with black produces no change.</td>
425   </tr>
426
427   <tr valign="top">
428     <td valign="top">darken</td>
429     <td valign="top">Selects the darker of the destination and source colors.
430         The destination is replaced with the source when the source is darker,
431         otherwise it is left unchanged.</td>
432   </tr>
433
434   <tr valign="top">
435     <td valign="top">lighten</td>
436     <td valign="top">Selects the lighter of the destination and source colors.
437         The destination is replaced with the source when the source is
438         lighter, otherwise it is left unchanged. </td>
439   </tr>
440
441   </tbody>
442 </table>
443
444 <p>Typically these use the default 'Over' alpha blending when transparencies
445 are also involved, except for 'Plus' which uses a 'plus' alpha blending.  This
446 means the alpha channel  of both images will only be used to ensure that any
447 visible input remains visible even in parts not overlaid. It also means that
448 any values are weighted by the alpha channel of the input and output images.
449 This 'Over' alpha blending is also applied to the lighting composition methods
450 below. </p>
451
452 <p>As of IM v6.6.1-6, if the special '<kbd>Sync</kbd>' flag is not specified
453 (enabled by default) with the <a href="../www/command-line-options.html#channel"
454 >-channel</a> setting, then the above mathematical compositions will nolonger
455 synchronise its actions with the alpha channel.  Instead the math composition
456 will be applied on an individual channel basis as defined by the <a
457 href="../www/command-line-options.html#channel"
458 >-channel</a>.  This includes the alpha channel. This special usage
459 allows you to perform true mathematics of the image channels, without alpha
460 compostion effects, becomming involved. </p>
461
462 <p>This special flag is not applied to the lighting composition methods (see
463 below) even though they are closely related to mathematical composition
464 methods.</p>
465
466 <br><br>
467
468 <p>The following lighting composition methods are also available. </p>
469
470 <table class="doc">
471   <tbody>
472   <tr valign="top">
473     <th align="left" style="width: 8%">Method</th>
474     <th align="left">Description</th>
475   </tr>
476
477   <tr valign="top">
478     <td valign="top">linear-dodge</td>
479     <td valign="top">This is equivalent to 'Plus' in that the color channels
480         are simply added, however it does not 'Plus' the alpha channel, but
481         uses the normal 'Over' alpha blending, which transparencies are
482         involved.  Produces a sort of additive multiply-like result. Added
483         ImageMagick version 6.5.4-3. </td>
484   </tr>
485
486   <tr valign="top">
487     <td valign="top">linear-burn</td>
488     <td valign="top">As 'Linear-Dodge', but also subtract one from the result.
489         Sort of a additive 'Screen' of the images.  Added ImageMagick version
490         6.5.4-3. </td>
491   </tr>
492
493   <tr valign="top">
494     <td valign="top">color-dodge</td>
495     <td valign="top">Brightens the destination color to reflect the source
496         color. Painting with black produces no change.</td>
497   </tr>
498
499   <tr valign="top">
500     <td valign="top">color-burn</td>
501     <td valign="top">Darkens the destination color to reflect the source
502         color.  Painting with white produces no change. Fixed in ImageMagick
503         version 6.5.4-3. </td>
504   </tr>
505
506   <tr valign="top">
507     <td valign="top">overlay</td>
508     <td valign="top">Multiplies or screens the colors, dependent on the
509         destination color. Source colors overlay the destination whilst
510         preserving its highlights and shadows. The destination color is not
511         replaced, but is mixed with the source color to reflect the lightness
512         or darkness of the destination.</td>
513   </tr>
514
515   <tr valign="top">
516     <td valign="top">hard-light</td>
517     <td valign="top">Multiplies or screens the colors, dependent on the source
518         color value. If the source color is lighter than 0.5, the destination
519         is lightened as if it were screened. If the source color is darker
520         than 0.5, the destination is darkened, as if it were multiplied. The
521         degree of lightening or darkening is proportional to the difference
522         between the source color and 0.5. If it is equal to 0.5 the
523         destination is unchanged.  Painting with pure black or white produces
524         black or white.</td>
525   </tr>
526
527
528   <tr valign="top">
529     <td valign="top">linear-light</td>
530     <td valign="top">Like 'Hard-Light' but using linear-dodge and linear-burn
531         instead.  Increases contrast slightly with an impact on the
532         foreground's tonal values.</td>
533   </tr>
534
535   <tr valign="top">
536     <td valign="top">soft-light</td>
537     <td valign="top">Darkens or lightens the colors, dependent on the source
538         color value. If the source color is lighter than 0.5, the destination
539         is lightened. If the source color is darker than 0.5, the destination
540         is darkened, as if it were burned in. The degree of darkening or
541         lightening is proportional to the difference between the source color
542         and 0.5. If it is equal to 0.5, the destination is unchanged. Painting
543         with pure black or white produces a distinctly darker or lighter area,
544         but does not result in pure black or white. Fixed in ImageMagick
545         version 6.5.4-3. </td>
546   </tr>
547
548   <tr valign="top">
549     <td valign="top">pegtop-light</td>
550     <td valign="top">Almost equivalent to 'Soft-Light', but using a
551         continuious mathematical formula rather than two conditionally
552         selected formulae. Added ImageMagick version 6.5.4-3. </td>
553   </tr>
554
555   <tr valign="top">
556     <td valign="top">vivid-light</td>
557     <td valign="top">A modified 'Linear-Light' designed to preserve very stong
558         primary and secondary colors in the image. Added ImageMagick version
559         6.5.4-3. </td>
560   </tr>
561
562   <tr valign="top">
563     <td valign="top">pin-light</td>
564     <td valign="top">Similar to 'Hard-Light', but using sharp linear shadings,
565         to similate the effects of a strong 'pinhole' light source. Added
566         ImageMagick version 6.5.4-3. </td>
567   </tr>
568
569   </tbody>
570 </table>
571
572
573 <br><br>
574
575 <p>Also included are these special purpose compose methods:</p>
576
577 <table class="doc">
578   <tbody>
579   <tr valign="top">
580     <th align="left" style="width: 8%">Method</th>
581     <th align="left">Description</th>
582   </tr>
583
584   <tr valign="top">
585     <td valign="top">copy</td>
586     <td valign="top">This is equivalent to the Duff-Porter composition method
587         '<kbd>Src,</kbd>' but without clearing the parts of the destination
588         image that is not overlaid.  </td>
589     </tr>
590
591   <tr valign="top">
592     <td valign="top">copy-*</td>
593     <td valign="top">Copy the specified channel (Red, Green, Blue, Cyan,
594         Magenta, Yellow, Black, or Opacity) in the source image to the
595         same channel in the destination image.  If the channel specified
596         does not exist in the source image, (which can only happen for methods,
597         '<kbd>copy-opacity</kbd>' or '<kbd>copy-black</kbd>') then it is
598         assumed that the source image is a special grayscale channel image
599         of the values that is to be copied. </td>
600     </tr>
601
602   <tr valign="top">
603     <td valign="top">change-mask</td>
604     <td valign="top">Replace any destination pixel that is the similar to the
605     source images pixel (as defined by the current <a
606     href="../www/command-line-options.html#fuzz">-fuzz</a> factor), with transparency.
607     </td>
608   </tr>
609   </tbody>
610 </table>
611
612 <br><br>
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="../www/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="../www/command-line-options.html#composite"
627 >-composite</a> operator, using the special <a href="../www/command-line-options.html#define">-define</a>
628 attribute of '<kbd class="arg">compose:args</kbd>'.  This means you can now
629 make use of these special argumented <a href="../www/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="../www/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 '<kbd class="arg">200</kbd>'.  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="../www/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 <kbd>-blend 30</kbd> merges 30% of the 'source' image with 70% of
670         the 'destination' image.  Thus it is equivalent to <kbd>-blend
671         30x70</kbd>.
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>&nbsp; &nbsp; &nbsp;<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="../www/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="../www/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="../www/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="../www/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="../www/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="../www/command-line-options.html#list">-list compose</a>.</p>
789
790
791 \r
792 </div>\r
793 \r
794 <div id="linkbar">\r
795     <span id="linkbar-west">&nbsp;</span>\r
796     <span id="linkbar-center">\r
797       <a href="http://www.imagemagick.org/discourse-server/">Discourse Server</a> &bull;\r
798       <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a>\r
799     </span>\r
800     <span id="linkbar-east">&nbsp;</span>\r
801   </div>\r
802   <div class="footer">\r
803     <span id="footer-west">&copy; 1999-2011 ImageMagick Studio LLC</span>\r
804     <span id="footer-east"> <a href="http://www.imagemagick.org/script/contact.php">Contact the Wizards</a></span>\r
805   </div>\r
806   <div style="clear: both; margin: 0; width: 100%; "></div>\r
807   <script type="text/javascript">\r
808     var _gaq = _gaq || [];\r
809     _gaq.push(['_setAccount', 'UA-17690367-1']);\r
810     _gaq.push(['_trackPageview']);\r
811 \r
812     (function() {\r
813       var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\r
814       ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\r
815       var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\r
816     })();\r
817   </script>\r
818 </body>\r
819 </html>\r