]> 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="verify-v1" content="g222frIIxcQTrvDR3NBRUSKP3AnMNoqxOkIniCEkV7U="/>\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="../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.4/jquery.min.js"></script>\r
40   <script type="text/javascript" src="../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: Search engine optimisation" href="http://www.seomoves.com.au">Search engine optimisation</a><!-- 201110010090s jen@seo lowprofilelinks -->
169 </div>
170 <div  class="sponsor">
171   <a rel="follow" title="Sponsor: Druckerei" href="http://print24.com/de/">Druckerei</a><!-- 201110010720 -->
172 </div>
173 <div  class="sponsor">
174   <a rel="follow" title="Sponsor: Web Hosting Deals" href="http://www.webhostingdeals.org">Web Hosting Deals</a><!-- 201111010270 chee.hoa darin -->
175 </div>
176 <div  class="sponsor">
177   <a rel="follow" title="Sponsor: Web Hosting Reviews" href="http://www.webhostingsecretrevealed.com">Web Hosting Secret Revealed</a><!-- 201204010540 iamchee jerry -->
178 </div>
179 <div  class="sponsor">
180   <a rel="follow" title="Sponsor: Web Hosting Break" href="http://www.webhostingbreak.com">Web Hosting Break</a><!-- 201109010090 ian@ian-m... -->
181 </div>
182 <div  class="sponsor">
183   <a rel="follow" title="Sponsor: Druckerei" href="http://www.allesdruck.de">Druckerei</a><!-- 201303011500 r.leo -->
184 </div>
185 <div  class="sponsor">
186   <a rel="follow" title="Sponsor: Website Hosting" href="http://www.hostreviewgeeks.com">Website Hosting</a><!-- 201110010090 alexanian media -->
187 </div>
188 <div  class="sponsor">
189   <a rel="follow" title="Sponsor: Hotel München" href="http://www.messehotel-erb-muenchen.de">Hotel München</a><!-- 201111010450 cerb -->
190 </div>
191 <div  class="sponsor">
192   <a rel="follow" title="Sponsor: Best Web Hosting" href="http://webhostinggeeks.com">Best Web Hosting</a><!-- 201110010720 -->
193 </div>
194 <div  class="sponsor">
195   <a rel="follow" title="Sponsor: Flyer drucken" href="http://www.online-druck.biz">Flyer drucken</a><!-- 201109010900 Floeter-->
196 </div>
197 <div  class="sponsor">
198   <a rel="follow" title="Sponsor: Web Hosting Reviews" href="http://www.webhostingmasters.com">Web Hosting Reviews</a><!-- 201107011500 affliatelabel -->
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: Autoteile Online Shop" href="http://www.autoteile-carparts.de">Autoteile Online Shop</a><!-- 2011080100030 autoteile-Carparts-->
205 </div>
206 </div>
207 </div>
208 </div>\r
209 \r
210 <div class="eastbar">\r
211 <div style="margin: 9pt 9pt 9pt 9pt;">\r
212   <div class="g-plusone" data-size="standard" data-count="false"></div>\r
213 </div>\r
214 </div>\r
215 \r
216 <div class="main">\r
217 \r
218 <h1>ImageMagick Image Composition</h1>
219 <p>This page descibed the Image composition methods that is used to define how
220 two images should be merged together in various image operations.  For the
221 Command Line API it is typically set using the <A
222 HREF="../www/command-line-options.html#compose" >-compose</A> setting option. </p>
223
224
225 <p>The description of composition uses abstract terminology in order to allow
226 the description to be more precise, while avoiding constant values which are
227 specific to a particular build configuration. Each image pixel is represented
228 by red, green, and blue levels (which are equal for a gray pixel). The
229 build-dependent value <em class="QR">QuantumRange</em> is the maximum integral
230 value which may be stored, per pixel, in the red, green, or blue channels of
231 the image. Each image pixel may also optionally (if the image matte channel is
232 enabled) have an associated level of opacity, ranging from <em>opaque</em> to
233 <em>transparent</em>, which may be used to determine the influence of the pixel
234 color when compositing the pixel with another image pixel. If the image matte
235 channel is disabled, then all pixels in the image are treated as opaque. The
236 color of an opaque pixel is fully visible while the color of a transparent
237 pixel color is entirely absent (pixel color is ignored).</p>
238
239 <p>By definition, raster images have a rectangular shape. All image rows are of
240 equal length, as are all image columns. By treating the alpha channel as a
241 visual "mask" the rectangular image may be given a "shape" by treating the
242 alpha channel as a cookie-cutter for the image. This is done by setting the
243 pixels within the shape to be opaque, with pixels outside the shape set as
244 transparent. Pixels on the boundary of the shape may be between opaque and
245 transparent in order to provide antialiasing (visually smooth edges). The
246 description of the composition operators use this concept of image "shape" in
247 order to make the description of the operators easier to understand. While it
248 is convenient to describe the operators in terms of "shapes" they are by no
249 means limited to mask-style operations since they are based on continuous
250 floating-point mathematics rather than simple boolean operations.</p>
251
252 <p>The following alpha blending (Duff-Porter) compose methods are available:</p>
253
254 <table class="doc">
255   <tbody>
256   <tr valign="top">
257     <th align="left" style="width: 8%">Method</th>
258     <th align="left">Description</th>
259   </tr>
260
261   <tr valign="top">
262     <td valign="top">clear</td>
263     <td valign="top">Both the color and the alpha of the destination are
264         cleared. Neither the source nor the destination are used (except for
265         destinations size and other meta-data which is always preserved.</td>
266   </tr>
267
268   <tr valign="top">
269     <td valign="top">src</td>
270     <td valign="top">The source is copied to the destination. The destination
271         is not used as input, though it is cleared.</td>
272   </tr>
273
274   <tr valign="top">
275     <td valign="top">dst</td>
276     <td valign="top">The destination is left untouched. The source image is
277         completely ignored.</td>
278   </tr>
279
280   <tr valign="top">
281     <td valign="top">src-over</td>
282     <td valign="top">The source is composited over the destination. this is
283        the default alpha blending compose method, when neither the compose
284        setting is set, nor is set in the image meta-data.</td>
285   </tr>
286
287   <tr valign="top">
288     <td valign="top">dst-over</td>
289     <td valign="top">The destination is composited over the source and the
290         result replaces the destination.</td>
291   </tr>
292
293   <tr valign="top">
294     <td valign="top">src-in</td>
295     <td valign="top">The part of the source lying inside of the destination
296         replaces the destination.</td>
297   </tr>
298
299   <tr valign="top">
300     <td valign="top">dst-in</td>
301     <td valign="top">The part of the destination lying inside of the source
302         replaces the destination. Areas not overlaid are cleared.</td>
303   </tr>
304
305   <tr valign="top">
306     <td valign="top">src-out</td>
307     <td valign="top">The part of the source lying outside of the destination
308         replaces the destination.</td>
309   </tr>
310
311   <tr valign="top">
312     <td valign="top">dst-out</td>
313     <td valign="top">The part of the destination lying outside of the source
314         replaces the destination.</td>
315   </tr>
316
317   <tr valign="top">
318     <td valign="top">src-atop</td>
319     <td valign="top">The part of the source lying inside of the destination is
320         composited onto the destination.</td>
321   </tr>
322
323   <tr valign="top">
324     <td valign="top">dst-atop</td>
325     <td valign="top">The part of the destination lying inside of the source is
326         composited over the source and replaces the destination. Areas not
327         overlaid are cleared. </td>
328   </tr>
329
330   <tr valign="top">
331     <td valign="top">xor</td>
332     <td valign="top">The part of the source that lies outside of the
333         destination is combined with the part of the destination that lies
334         outside of the source.  Source or Destination, but not both. </td>
335   </tr>
336
337   </tbody>
338 </table>
339
340 <p>Any of the 'Src-*' methods can also be specified without the 'Src-' part.
341 For example the default compose method can be specified as just 'Over'.</p>
342
343 <p>Many of these compose methods will clear the destination image which was
344 not overlaid by the source image.  This is to be expected as part of that
345 specific composition methods defintion. You can disable this by setting the
346 special <A HREF="../www/command-line-options.html#define"
347 >-define</A> 'compose:outside-overlay' to a value of 'false' will turn off
348 this behaviour. </p>
349
350 <p>On top of the above 12 Duff-Porter Alpha Composition methods, one special
351 related method '<kbd>Copy</kbd>' has been provided. This is equivalent to
352 using the '<kbd>Src</kbd>'  with the special <A HREF="../www/command-line-options.html#define"
353 >-define</A> option '<kbd>compose:outside-overlay</kbd>' set to
354 '<kbd>false</kbd>', so as to only modify the overlaid area, without clearing
355 the rest of the image outside the overlaid area.  </p>
356
357 <br><br>
358
359 <p>The following mathemathical composition methods are also available. </p>
360
361 <table class="doc">
362   <tbody>
363   <tr valign="top">
364     <th align="left" style="width: 8%">Method</th>
365     <th align="left">Description</th>
366   </tr>
367
368   <tr valign="top">
369     <td valign="top">multiply</td>
370     <td valign="top">The source is multiplied by the destination and replaces
371         the destination. The resultant color is always at least as dark as
372         either of the two constituent colors. Multiplying any color with black
373         produces black. Multiplying any color with white leaves the original
374         color unchanged.</td>
375   </tr>
376
377   <tr valign="top">
378     <td valign="top">screen</td>
379     <td valign="top">The source and destination are complemented and then
380         multiplied and then replace the destination. The resultant color is
381         always at least as light as either of the two constituent colors.
382         Screening any color with white produces white. Screening any color
383         with black leaves the original color unchanged.</td>
384   </tr>
385
386   <tr valign="top">
387     <td valign="top">plus</td>
388     <td valign="top">The source is added to the destination and replaces the
389         destination. This operator is useful for averaging or a controled
390         merger of two images, rather than a direct overlay.</td>
391   </tr>
392
393   <tr valign="top">
394     <td valign="top">add</td>
395     <td valign="top">As per 'plus' but transparency data is treated as matte
396         values. As such any transparent areas in either image remain
397         transparent. </td>
398   </tr>
399
400   <tr valign="top">
401     <td valign="top">minus</td>
402     <td valign="top">Subtract the colors in the source image from the
403         destination image. When transparency is involved, opaque areas is
404         subtracted from any destination opaque areas. </td>
405   </tr>
406
407   <tr valign="top">
408     <td valign="top">subtract</td>
409     <td valign="top">Subtract the colors in the source image from the
410         destination image. When transparency is involved transparent areas are
411         subtracted, so only the opaque areas in the source remain opaque in
412         the destination image. </td>
413   </tr>
414
415   <tr valign="top">
416     <td valign="top">difference</td>
417     <td valign="top">Subtracts the darker of the two constituent colors from
418         the lighter. Painting with white inverts the destination color.
419         Painting with black produces no change.</td>
420   </tr>
421
422   <tr valign="top">
423     <td valign="top">exclusion</td>
424     <td valign="top">Produces an effect similar to that of 'difference', but
425         appears as lower contrast.  Painting with white inverts the
426         destination color. Painting with black produces no change.</td>
427   </tr>
428
429   <tr valign="top">
430     <td valign="top">darken</td>
431     <td valign="top">Selects the darker of the destination and source colors.
432         The destination is replaced with the source when the source is darker,
433         otherwise it is left unchanged.</td>
434   </tr>
435
436   <tr valign="top">
437     <td valign="top">lighten</td>
438     <td valign="top">Selects the lighter of the destination and source colors.
439         The destination is replaced with the source when the source is
440         lighter, otherwise it is left unchanged. </td>
441   </tr>
442
443   </tbody>
444 </table>
445
446 <p>Typically these use the default 'Over' alpha blending when transparencies
447 are also involved, except for 'Plus' which uses a 'plus' alpha blending.  This
448 means the alpha channel  of both images will only be used to ensure that any
449 visible input remains visible even in parts not overlaid. It also means that
450 any values are weighted by the alpha channel of the input and output images.
451 This 'Over' alpha blending is also applied to the lighting composition methods
452 below. </p>
453
454 <p>As of IM v6.6.1-6, if the special '<kbd>Sync</kbd>' flag is not specified
455 (enabled by default) with the <a href="../www/command-line-options.html#channel"
456 >-channel</a> setting, then the above mathematical compositions will nolonger
457 synchronise its actions with the alpha channel.  Instead the math composition
458 will be applied on an individual channel basis as defined by the <a
459 href="../www/command-line-options.html#channel"
460 >-channel</a>.  This includes the alpha channel. This special usage
461 allows you to perform true mathematics of the image channels, without alpha
462 compostion effects, becomming involved. </p>
463
464 <p>This special flag is not applied to the lighting composition methods (see
465 below) even though they are closely related to mathematical composition
466 methods.</p>
467
468 <br><br>
469
470 <p>The following lighting composition methods are also available. </p>
471
472 <table class="doc">
473   <tbody>
474   <tr valign="top">
475     <th align="left" style="width: 8%">Method</th>
476     <th align="left">Description</th>
477   </tr>
478
479   <tr valign="top">
480     <td valign="top">linear-dodge</td>
481     <td valign="top">This is equivalent to 'Plus' in that the color channels
482         are simply added, however it does not 'Plus' the alpha channel, but
483         uses the normal 'Over' alpha blending, which transparencies are
484         involved.  Produces a sort of additive multiply-like result. Added
485         ImageMagick version 6.5.4-3. </td>
486   </tr>
487
488   <tr valign="top">
489     <td valign="top">linear-burn</td>
490     <td valign="top">As 'Linear-Dodge', but also subtract one from the result.
491         Sort of a additive 'Screen' of the images.  Added ImageMagick version
492         6.5.4-3. </td>
493   </tr>
494
495   <tr valign="top">
496     <td valign="top">color-dodge</td>
497     <td valign="top">Brightens the destination color to reflect the source
498         color. Painting with black produces no change.</td>
499   </tr>
500
501   <tr valign="top">
502     <td valign="top">color-burn</td>
503     <td valign="top">Darkens the destination color to reflect the source
504         color.  Painting with white produces no change. Fixed in ImageMagick
505         version 6.5.4-3. </td>
506   </tr>
507
508   <tr valign="top">
509     <td valign="top">overlay</td>
510     <td valign="top">Multiplies or screens the colors, dependent on the
511         destination color. Source colors overlay the destination whilst
512         preserving its highlights and shadows. The destination color is not
513         replaced, but is mixed with the source color to reflect the lightness
514         or darkness of the destination.</td>
515   </tr>
516
517   <tr valign="top">
518     <td valign="top">hard-light</td>
519     <td valign="top">Multiplies or screens the colors, dependent on the source
520         color value. If the source color is lighter than 0.5, the destination
521         is lightened as if it were screened. If the source color is darker
522         than 0.5, the destination is darkened, as if it were multiplied. The
523         degree of lightening or darkening is proportional to the difference
524         between the source color and 0.5. If it is equal to 0.5 the
525         destination is unchanged.  Painting with pure black or white produces
526         black or white.</td>
527   </tr>
528
529
530   <tr valign="top">
531     <td valign="top">linear-light</td>
532     <td valign="top">Like 'Hard-Light' but using linear-dodge and linear-burn
533         instead.  Increases contrast slightly with an impact on the
534         foreground's tonal values.</td>
535   </tr>
536
537   <tr valign="top">
538     <td valign="top">soft-light</td>
539     <td valign="top">Darkens or lightens the colors, dependent on the source
540         color value. If the source color is lighter than 0.5, the destination
541         is lightened. If the source color is darker than 0.5, the destination
542         is darkened, as if it were burned in. The degree of darkening or
543         lightening is proportional to the difference between the source color
544         and 0.5. If it is equal to 0.5, the destination is unchanged. Painting
545         with pure black or white produces a distinctly darker or lighter area,
546         but does not result in pure black or white. Fixed in ImageMagick
547         version 6.5.4-3. </td>
548   </tr>
549
550   <tr valign="top">
551     <td valign="top">pegtop-light</td>
552     <td valign="top">Almost equivalent to 'Soft-Light', but using a
553         continuious mathematical formula rather than two conditionally
554         selected formulae. Added ImageMagick version 6.5.4-3. </td>
555   </tr>
556
557   <tr valign="top">
558     <td valign="top">vivid-light</td>
559     <td valign="top">A modified 'Linear-Light' designed to preserve very stong
560         primary and secondary colors in the image. Added ImageMagick version
561         6.5.4-3. </td>
562   </tr>
563
564   <tr valign="top">
565     <td valign="top">pin-light</td>
566     <td valign="top">Similar to 'Hard-Light', but using sharp linear shadings,
567         to similate the effects of a strong 'pinhole' light source. Added
568         ImageMagick version 6.5.4-3. </td>
569   </tr>
570
571   </tbody>
572 </table>
573
574
575 <br><br>
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         '<kbd>Src,</kbd>' 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         '<kbd>copy-opacity</kbd>' or '<kbd>copy-black</kbd>') 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="../www/command-line-options.html#fuzz">-fuzz</a> factor), with transparency.
609     </td>
610   </tr>
611   </tbody>
612 </table>
613
614 <br><br>
615
616 <p>On top of these composed methods are a few special ones that not only require
617 the two images that are being merged or overlaid, but have some extra numerical
618 arguments, which are tabled below. </p>
619
620 <p>In the "<code>composite</code>" command these composition methods are
621 selected using special options with the arguments needed. They are usually,
622 but not always, the same name as the composte 'method' they use, and replaces
623 the normal use of the <a href="../www/command-line-options.html#compose" >-compose</a>
624 setting in the "<code>composite</code>" command.  For example... </p>
625
626 <p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>composite ... -blend 50x50 ...</span></p>
627 <p>As of IM v6.5.3-4 the "<code>convert</code>" command can now also supply
628 these extra arguments to its <a href="../www/command-line-options.html#composite"
629 >-composite</a> operator, using the special <a href="../www/command-line-options.html#define">-define</a>
630 attribute of '<kbd class="arg">compose:args</kbd>'.  This means you can now
631 make use of these special argumented <a href="../www/command-line-options.html#compose"
632 >-compose</a> methods, those the argument and the method both need to be set
633 separately.  For example... </p>
634
635 <p class='crt'><span class="crtprompt"> $magick&gt; </span><span class='crtin'>convert ... -compose blend  -define compose:args=50,50 -composite ...</span></p>
636 <p>The following is a table of these special 'argumented' compose methods,
637 with a brief summary of what they do. For more details see the equivalent
638 "composite" command option name.  </p>
639
640 <table class="doc">
641   <tbody>
642   <tr valign="top">
643     <th align="left" style="width: 8%">Method</th>
644     <th align="left">Description</th>
645   </tr>
646
647   <tr valign="top">
648     <td valign="top">dissolve</td>
649     <td valign="top">Arguments:
650         <em class="arg">src_percent</em>[x<em class="arg">dst_percent</em>]
651     <br>Equivalent to "<code>composite</code>" <a href="../www/command-line-options.html#dissolve">-dissolve</a>
652     <br>Dissolve the 'source' image by the percentage given before overlaying
653         'over' the 'destination' image. If <em class="arg">src_percent</em> is
654         greater than 100, it starts dissolving the main image so it will
655         become transparent at a value of '<kbd class="arg">200</kbd>'.  If
656         both percentages are given, each image are dissolved to the
657         percentages given.
658     </td>
659   </tr>
660
661   <tr valign="top">
662     <td valign="top">blend</td>
663     <td valign="top">Arguments:
664         <em class="arg">src_percent</em>[x<em class="arg">dst_percent</em>]
665     <br>Equivalent to "<code>composite</code>" <a
666         href="../www/command-line-options.html#blend">-blend</a>
667     <br>Average the images together ('plus') according to the percentages
668         given and each pixels transparency.  If only a single percentage value
669         is given it sets the weight of the composite or 'source' image, while
670         the background image is weighted by the exact opposite amount. That is
671         a <kbd>-blend 30</kbd> merges 30% of the 'source' image with 70% of
672         the 'destination' image.  Thus it is equivalent to <kbd>-blend
673         30x70</kbd>.
674     </td>
675   </tr>
676
677   <tr valign="top">
678     <td valign="top">mathematics</td>
679     <td valign="top">Arguments: <em class="arg">A, B, C, D</em>
680     <br>Not available in "<code>composite</code>" at this time.
681     <br>Merge the source and destination images according to the formula
682     <br>&nbsp; &nbsp; &nbsp;<code>A*Sc*Dc + B*Sc + C*Dc + D</code>
683     <br>Can be used to generate a custom composition method that would
684         otherwise need to be implemented using the slow <a
685         href="../www/command-line-options.html#fx">-fx</a> DIY image operator.   Added
686         to ImageMagick version 6.5.4-3.
687     <br>As of IM v6.6.1-6 this method will do per-channel math compositions
688         if the 'Sync' flag is removed from <a
689         href="../www/command-line-options.html#channel" >-channel</a>, just like all
690         the other mathematical compostion methods above.
691     </td>
692   </tr>
693
694   <tr valign="top">
695     <td valign="top">modulate</td>
696     <td valign="top">Arguments:
697         <em class="arg">brightness</em>[x<em class="arg">saturation</em>]
698     <br>Equivalent to "<code>composite</code>" <a href="../www/command-line-options.html#watermark">-watermark</a>
699     <br>Take a grayscale image (with alpha mask) and modify the destination
700         image's brightness according to watermark image's grayscale value and
701         the <em class="arg">brightness</em> percentage.  The destinations
702         color saturation attribute is just direct modified by the <em
703         class="arg">saturation</em> percentage, which defaults to 100 percent
704         (no color change).
705
706     </td>
707   </tr>
708
709   <tr valign="top">
710     <td valign="top">displace</td>
711     <td valign="top">Arguments:
712         <em class="arg">X-scale</em>[x<em class="arg">Y-scale</em>][!][%]
713     <br>Equivalent to "<code>composite</code>" <a href="../www/command-line-options.html#displace">-displace</a>
714     <br>With this option, the 'overlay' image, and optionally the 'mask'
715         image, is used as a relative displacement map, which is used to
716         displace the lookup of what part of the destination image is seen at
717         each point of the overlaid area.  Much like the displacement map is a
718         'lens' that distorts the original 'background' image behind it.
719     <br><br>
720         The X-scale is modulated by the 'red' channel of the overlay image
721         while the Y-scale is modulated by the green channel, (the mask image
722         if given is rolled into green channel of the overlay image. This
723         separation allows you to modulate the X and Y lookup displacement
724         separately allowing you to do 2-dimensional displacements, rather
725         than 1-dimensional verctored displacements (using grayscale image).
726     <br><br>
727         If the overlay image contains transparency this is used as a mask
728         of the resulting image to remove 'invalid' pixels.
729     <br><br>
730         The '%' flag makes the displacement scale relative to the size of the
731         overlay image (100% = half width/height of image). Using '!' switches
732         percentage arguments to refer to the destination image size instead.
733     <br><br>
734         Special flags were added Added to ImageMagick version 6.5.3-5.
735     </td>
736   </tr>
737
738   <tr valign="top">
739     <td valign="top">distort</td>
740     <td valign="top">Arguments:
741         <em class="arg">X-scale</em>[x<em class="arg">Y-scale</em
742         >[+<em class="arg">X-center</em>+<em class="arg">Y-center</em>]][!][%]
743     <br>Not available in "<code>composite</code>" at this time.
744     <br>Exactly as per 'Displace' (above), but using absolute coordinates,
745         relative to the center of the overlay (or that given).  Basically
746         allows you to generate absolute distortion maps where 'black' will
747         look up the left/top edge, and 'white' looks up the bottom/right
748         edge of the destination image, according to the scale given.
749     <br><br>
750         The '!' flag not only switches percentage scaling, to use the
751         destination image, but also the image the center offset of the lookup.
752         This means the overlay can lookup a completely different region of the
753         destination image.
754     <br><br>
755         Added to ImageMagick version 6.5.3-5.
756     </td>
757   </tr>
758
759   <tr valign="top">
760     <td valign="top">blur</td>
761     <td valign="top">Arguments:
762         <em class="arg">Width</em>[x<em class="arg">Height</em
763           >[+<em class="arg">Angle</em>][+<em class="arg">Angle2</em>]]
764     <br>Equivalent to "<code>composite</code>" <a href="../www/command-line-options.html#blur-composite">-blur</a>
765     <br>A Variable Blur Mapping Composition method, where each pixel in the
766         overlaid region is replaced with an Elliptical Weighted Average (EWA),
767         with an ellipse (typically a circle) of the given sigma size, scaled
768         according to overlay (source image) grayscale mapping.
769     <br><br>
770         As per 'Displace' and 'Distort', the red channel will modulate the
771         width of the ellipse, while the green channel will modulate the height
772         of the ellipse. If a single Angle value is given in the arguments,
773         then the ellipse will then be rotated by the angle specifed.
774     <br><br>
775         Normally the blue channel of the mapping overlay image is ignored.
776         However if a second ellipse angle is given, then it is assumed that
777         the blue channel defines a variable angle for the ellipse ranging from
778         the first angle to the second angle given.  This allows to generate
779         radial blurs, or a rough approximation for rotational blur. Or any mix
780         of the two.
781     <br><br>
782         Added to ImageMagick version 6.5.4-0.
783     </td>
784   </tr>
785
786   </tbody>
787 </table>
788
789 <p>To print a complete list of all the available compose operators, use <a
790 href="../www/command-line-options.html#list">-list compose</a>.</p>
791
792
793 \r
794 </div>\r
795 \r
796 <div id="linkbar">\r
797     <span id="linkbar-west">&nbsp;</span>\r
798     <span id="linkbar-center">\r
799       <a href="http://www.imagemagick.org/discourse-server/">Discourse Server</a> &bull;\r
800       <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a>\r
801     </span>\r
802     <span id="linkbar-east">&nbsp;</span>\r
803   </div>\r
804   <div class="footer">\r
805     <span id="footer-west">&copy; 1999-2011 ImageMagick Studio LLC</span>\r
806     <span id="footer-east"> <a href="http://www.imagemagick.org/script/contact.php">Contact the Wizards</a></span>\r
807   </div>\r
808   <div style="clear: both; margin: 0; width: 100%; "></div>\r
809   <script type="text/javascript">\r
810     var _gaq = _gaq || [];\r
811     _gaq.push(['_setAccount', 'UA-17690367-1']);\r
812     _gaq.push(['_trackPageview']);\r
813 \r
814     (function() {\r
815       var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;\r
816       ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\r
817       var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\r
818     })();\r
819   </script>\r
820 </body>\r
821 </html>\r