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