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