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