2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
\r
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
\r
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
\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, and compose bitmap images. It can read, convert and write images in a variety of formats (about 100) including GIF, JPEG, JPEG-2000, PNG, PDF, PhotoCD, TIFF, and DPX. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves. ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you can freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems. The functionality of ImageMagick is typically utilized from the command line or you can use the features from programs written in your favorite programming language. Choose from these interfaces: MagickCore (C), MagickWand (C), ChMagick (Ch), Magick++ (C++), JMagick (Java), L-Magick (Lisp), PascalMagick (Pascal), PerlMagick (Perl), MagickWand for PHP (PHP), PythonMagick (Python), RMagick (Ruby), or TclMagick (Tcl/TK). With a language interface, use ImageMagick to modify or create images automagically and dynamically."/>
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-2010 ImageMagick Studio LLC"/>
24 <meta name="Distribution" content="Global"/>
25 <link rel="icon" href="../images/wand.png" sizes="32x32"/>
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
33 <body id="www-imagemagick-org">
\r
34 <div class="titlebar">
\r
35 <a href="../index.html">
\r
36 <img src="../images/script.png" alt="[ImageMagick]"
\r
37 style="width: 350px; height: 60px; margin: 28px auto; float: left;" /></a>
\r
38 <a href="http://www.networkredux.com">
\r
39 <img src="../images/networkredux.png" alt="[sponsor]"
\r
40 style="margin: 45px auto; border: 0px; float: left;" /></a>
\r
41 <a href="http://www.imagemagick.org/discourse-server/">
\r
42 <img src="../images/logo.jpg" alt=""
\r
43 style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
\r
44 <a href="../index.html">
\r
45 <img src="../images/sprite.jpg" alt=""
\r
46 style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
\r
49 <div class="westbar">
\r
52 <a title="About ImageMagick" href="../index.html">About ImageMagick</a>
54 <div class="sep"></div>
\r
56 <a title="Binary Releases" href="../www/binary-releases.html">Binary Releases</a>
59 <a title="Binary Release: Unix" href="../www/binary-releases.html#unix">Unix</a>
62 <a title="Binary Release: MacOS X" href="../www/binary-releases.html#macosx">Mac OS X</a>
65 <a title="Binary Release: Windows" href="../www/binary-releases.html#windows">Windows</a>
67 <div class="sep"></div>
\r
69 <a title="Command-line Tools" href="../www/command-line-tools.html">Command-line Tools</a>
72 <a title="Command-line Tools: Processing" href="../www/command-line-processing.html">Processing</a>
75 <a title="Command-line Tools: Options" href="../www/command-line-options.html">Options</a>
78 <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a>
81 <a title="Program Interfaces" href="../www/api.html">Program Interfaces</a>
84 <a title="Program Interface: MagickWand" href="../www/magick-wand.html">MagickWand</a>
87 <a title="Program Interface: MagickCore" href="../www/magick-core.html">MagickCore</a>
90 <a title="Program Interface: PerlMagick" href="../www/perl-magick.html">PerlMagick</a>
93 <a title="Program Interface: Magick++" href="../Magick++/">Magick++</a>
95 <div class="sep"></div>
\r
97 <a title="Install from Source" href="../www/install-source.html">Install from Source</a>
100 <a title="Install from Source: Unix" href="../www/install-source.html#unix">Unix</a>
103 <a title="Install from Source: Windows" href="../www/install-source.html#windows">Windows</a>
106 <a title="Resources" href="../www/resources.html">Resources</a>
109 <a title="Architecture" href="../www/architecture.html">Architecture</a>
112 <a title="Download" href="../www/download.html">Download</a>
114 <div class="sep"></div>
\r
116 <a title="Search" href="http://www.imagemagick.org/script/search.php">Search</a>
118 <div class="sep"></div>
\r
120 <a title="Site Map"href="../www/sitemap.html">Site Map</a>
123 <a title="Site Map: Links"href="../www/links.html">Links</a>
125 <div class="sep"></div>
\r
127 <a title="Sponsors" href="../www/sponsors.html">Sponsors:</a>
129 <div class="sponsbox">
130 <div class="sponsor">
131 <a title="Sponsor: Image Converter" href="http://www.batchphoto.com">Image Converter</a><!-- 201103010900 Bits Coffee-->
133 <div class="sponsor">
134 <a title="Sponsor: Flyer drucken" href="http://www.online-druck.biz">Flyer drucken</a><!-- 201109010900 Floeter-->
136 <div class="sponsor">
137 <a title="Sponsor: Webdesign Agentur" href="http://www.ventzke-partner.de">Webdesign Agentur</a><!-- 201101010480 invendio.de-->
139 <div class="sponsor">
140 <a title="Sponsor: LVM Versicherung" href="http://www.neu-reich.de">LVM Versicherung</a><!-- 201101010480 -->
142 <div class="sponsor">
143 <a title="Sponsor: Diamonds are a Girls Best Friend" href="http://www.schmuck.org">Diamonds are a Girls Best Friend</a><!-- 201101010600 Peterssen-->
145 <div class="sponsor">
146 <a title="Sponsor: Druckerei Online" href="http://www.allesdruck.de">Druckerei Online</a><!-- 201012011200 allesdruck.de-->
148 <div class="sponsor">
149 <a title="Sponsor: Webdesign" href="http://www.renehornig.com/">Webdesign</a><!-- 20111001000240 -->
155 <div class="eastbar">
\r
156 <script type="text/javascript">
\r
158 google_ad_client = "pub-3129977114552745";
\r
159 google_ad_slot = "0574824969";
\r
160 google_ad_width = 160;
\r
161 google_ad_height = 600;
\r
164 <script type="text/javascript"
\r
165 src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
\r
172 <p>This page descibed the Image composition methods that is used to define how
173 two images should be merged together in various image operations. For the
174 Command Line API it is typically set using the <A
175 HREF="../www/command-line-options.html#compose" >-compose</A> setting option. </p>
178 <p>The description of composition uses abstract terminology in order to allow
179 the description to be more precise, while avoiding constant values which are
180 specific to a particular build configuration. Each image pixel is represented
181 by red, green, and blue levels (which are equal for a gray pixel). The
182 build-dependent value <em class="QR">QuantumRange</em> is the maximum integral
183 value which may be stored, per pixel, in the red, green, or blue channels of
184 the image. Each image pixel may also optionally (if the image matte channel is
185 enabled) have an associated level of opacity, ranging from <em>opaque</em> to
186 <em>transparent</em>, which may be used to determine the influence of the pixel
187 color when compositing the pixel with another image pixel. If the image matte
188 channel is disabled, then all pixels in the image are treated as opaque. The
189 color of an opaque pixel is fully visible while the color of a transparent
190 pixel color is entirely absent (pixel color is ignored).</p>
192 <p>By definition, raster images have a rectangular shape. All image rows are of
193 equal length, as are all image columns. By treating the alpha channel as a
194 visual "mask" the rectangular image may be given a "shape" by treating the
195 alpha channel as a cookie-cutter for the image. This is done by setting the
196 pixels within the shape to be opaque, with pixels outside the shape set as
197 transparent. Pixels on the boundary of the shape may be between opaque and
198 transparent in order to provide antialiasing (visually smooth edges). The
199 description of the composition operators use this concept of image "shape" in
200 order to make the description of the operators easier to understand. While it
201 is convenient to describe the operators in terms of "shapes" they are by no
202 means limited to mask-style operations since they are based on continuous
203 floating-point mathematics rather than simple boolean operations.</p>
205 <p>The following alpha blending (Duff-Porter) compose methods are available:</p>
210 <th align="left" style="width: 8%">Method</th>
211 <th align="left">Description</th>
215 <td valign="top">clear</td>
216 <td valign="top">Both the color and the alpha of the destination are
217 cleared. Neither the source nor the destination are used (except for
218 destinations size and other meta-data which is always preserved.</td>
222 <td valign="top">src</td>
223 <td valign="top">The source is copied to the destination. The destination
224 is not used as input, though it is cleared.</td>
228 <td valign="top">dst</td>
229 <td valign="top">The destination is left untouched. The source image is
230 completely ignored.</td>
234 <td valign="top">src-over</td>
235 <td valign="top">The source is composited over the destination. this is
236 the default alpha blending compose method, when neither the compose
237 setting is set, nor is set in the image meta-data.</td>
241 <td valign="top">dst-over</td>
242 <td valign="top">The destination is composited over the source and the
243 result replaces the destination.</td>
247 <td valign="top">src-in</td>
248 <td valign="top">The part of the source lying inside of the destination
249 replaces the destination.</td>
253 <td valign="top">dst-in</td>
254 <td valign="top">The part of the destination lying inside of the source
255 replaces the destination. Areas not overlaid are cleared.</td>
259 <td valign="top">src-out</td>
260 <td valign="top">The part of the source lying outside of the destination
261 replaces the destination.</td>
265 <td valign="top">dst-out</td>
266 <td valign="top">The part of the destination lying outside of the source
267 replaces the destination.</td>
271 <td valign="top">src-atop</td>
272 <td valign="top">The part of the source lying inside of the destination is
273 composited onto the destination.</td>
277 <td valign="top">dst-atop</td>
278 <td valign="top">The part of the destination lying inside of the source is
279 composited over the source and replaces the destination. Areas not
280 overlaid are cleared. </td>
284 <td valign="top">xor</td>
285 <td valign="top">The part of the source that lies outside of the
286 destination is combined with the part of the destination that lies
287 outside of the source. Source or Destination, but not both. </td>
293 <p>Any of the 'Src-*' methods can also be specified without the 'Src-' part.
294 For example the default compose method can be specified as just 'Over'.</p>
296 <p>Many of these compose methods will clear the destination image which was
297 not overlaid by the source image. This is to be expected as part of that
298 specific composition methods defintion. Seeing the You can disable this by
299 setting the special <A HREF="../www/command-line-options.html#set" >-set</A>
300 'option:compose:outside-overlay' to 'false' will turn off this behaviour. </p>
302 <p>On top of the above 12 Duff-Porter Alpha Composition methods, one special
303 related method '<kbd>Copy</kbd>' has been provided. This is equivelent to the
304 '<kbd>Src</kbd>' with the special <A HREF="../www/command-line-options.html#set"
305 >-set</A> option '<kbd>option:compose:outside-overlay</kbd>' set to
306 '<kbd>false></kbd>'. </p>
310 <p>The following mathemathical composition methods are also available. </p>
315 <th align="left" style="width: 8%">Method</th>
316 <th align="left">Description</th>
320 <td valign="top">multiply</td>
321 <td valign="top">The source is multiplied by the destination and replaces
322 the destination. The resultant color is always at least as dark as
323 either of the two constituent colors. Multiplying any color with black
324 produces black. Multiplying any color with white leaves the original
325 color unchanged.</td>
329 <td valign="top">screen</td>
330 <td valign="top">The source and destination are complemented and then
331 multiplied and then replace the destination. The resultant color is
332 always at least as light as either of the two constituent colors.
333 Screening any color with white produces white. Screening any color
334 with black leaves the original color unchanged.</td>
338 <td valign="top">plus</td>
339 <td valign="top">The source is added to the destination and replaces the
340 destination. This operator is useful for averaging or a controled
341 merger of two images, rather than a direct overlay.</td>
345 <td valign="top">add</td>
346 <td valign="top">As per 'plus' but transparency data is treated as matte
347 values. As such any transparent areas in either image remain
352 <td valign="top">minus</td>
353 <td valign="top">Subtract the colors in the source image from the
354 destination image. When transparency is involved, opaque areas is
355 subtracted from any destination opaque areas. </td>
359 <td valign="top">subtract</td>
360 <td valign="top">Subtract the colors in the source image from the
361 destination image. When transparency is involved transparent areas are
362 subtracted, so only the opaque areas in the source remain opaque in
363 the destination image. </td>
367 <td valign="top">difference</td>
368 <td valign="top">Subtracts the darker of the two constituent colors from
369 the lighter. Painting with white inverts the destination color.
370 Painting with black produces no change.</td>
374 <td valign="top">exclusion</td>
375 <td valign="top">Produces an effect similar to that of 'difference', but
376 appears as lower contrast. Painting with white inverts the
377 destination color. Painting with black produces no change.</td>
381 <td valign="top">darken</td>
382 <td valign="top">Selects the darker of the destination and source colors.
383 The destination is replaced with the source when the source is darker,
384 otherwise it is left unchanged.</td>
388 <td valign="top">lighten</td>
389 <td valign="top">Selects the lighter of the destination and source colors.
390 The destination is replaced with the source when the source is
391 lighter, otherwise it is left unchanged. </td>
397 <p>Typically these use the default 'Over' alpha blending when transparencies
398 are also involved, except for 'Plus' which uses a 'plus' alpha blending. This
399 means the alpha channel of both images will only be used to ensure that any
400 visible input remains visible even in parts not overlaid. It also means that
401 any values are weighted by the alpha channel of the input and output images.
402 This 'Over' alpha blending is also applied to the lighting composition methods
405 <p>As of IM v6.6.1-6, if the special '<kbd>Sync</kbd>' flag is not specified
406 (enabled by default) with the <a href="../www/command-line-options.html#channel"
407 >-channel</a> setting, then the above mathematical compositions will nolonger
408 syncronise its actiosn with the alpha channel. Instead the math composition
409 will be applied on an individual channel basis as defined by the <a
410 href="../www/command-line-options.html#channel"
411 >-channel</a>. This includes the alpha channel. This special usage
412 allows you to perform true mathematics of the image channels, without alpha
413 compostion effects, becomming involved. </p>
415 <p>This special flag is not applied to the lighting composition methods (see
416 below) even though they are closely related to mathematical composition
421 <p>The following lighting composition methods are also available. </p>
426 <th align="left" style="width: 8%">Method</th>
427 <th align="left">Description</th>
431 <td valign="top">linear-dodge</td>
432 <td valign="top">This is equivelent to 'Plus' in that the color channels
433 are simply added, however it does not 'Plus' the alpha channel, but
434 uses the normal 'Over' alpha blending, which transparencies are
435 involved. Produces a sort of additive multiply-like result. Added
436 ImageMagick version 6.5.4-3. </td>
440 <td valign="top">linear-burn</td>
441 <td valign="top">As 'Linear-Dodge', but also subtract one from the result.
442 Sort of a additive 'Screen' of the images. Added ImageMagick version
447 <td valign="top">color-dodge</td>
448 <td valign="top">Brightens the destination color to reflect the source
449 color. Painting with black produces no change.</td>
453 <td valign="top">color-burn</td>
454 <td valign="top">Darkens the destination color to reflect the source
455 color. Painting with white produces no change. Fixed in ImageMagick
456 version 6.5.4-3. </td>
460 <td valign="top">overlay</td>
461 <td valign="top">Multiplies or screens the colors, dependent on the
462 destination color. Source colors overlay the destination whilst
463 preserving its highlights and shadows. The destination color is not
464 replaced, but is mixed with the source color to reflect the lightness
465 or darkness of the destination.</td>
469 <td valign="top">hard-light</td>
470 <td valign="top">Multiplies or screens the colors, dependent on the source
471 color value. If the source color is lighter than 0.5, the destination
472 is lightened as if it were screened. If the source color is darker
473 than 0.5, the destination is darkened, as if it were multiplied. The
474 degree of lightening or darkening is proportional to the difference
475 between the source color and 0.5. If it is equal to 0.5 the
476 destination is unchanged. Painting with pure black or white produces
482 <td valign="top">linear-light</td>
483 <td valign="top">Like 'Hard-Light' but using linear-dodge and linear-burn
484 instead. Increases contrast slightly with an impact on the
485 foreground's tonal values.</td>
489 <td valign="top">soft-light</td>
490 <td valign="top">Darkens or lightens the colors, dependent on the source
491 color value. If the source color is lighter than 0.5, the destination
492 is lightened. If the source color is darker than 0.5, the destination
493 is darkened, as if it were burned in. The degree of darkening or
494 lightening is proportional to the difference between the source color
495 and 0.5. If it is equal to 0.5, the destination is unchanged. Painting
496 with pure black or white produces a distinctly darker or lighter area,
497 but does not result in pure black or white. Fixed in ImageMagick
498 version 6.5.4-3. </td>
502 <td valign="top">pegtop-light</td>
503 <td valign="top">Almost equivelent to 'Soft-Light', but using a
504 continuious mathematical formula rather than two conditionally
505 selected formulae. Added ImageMagick version 6.5.4-3. </td>
509 <td valign="top">vivid-light</td>
510 <td valign="top">A modified 'Linear-Light' designed to preserve very stong
511 primary and secondary colors in the image. Added ImageMagick version
516 <td valign="top">pin-light</td>
517 <td valign="top">Similar to 'Hard-Light', but using sharp linear shadings,
518 to similate the effects of a strong 'pinhole' light source. Added
519 ImageMagick version 6.5.4-3. </td>
528 <p>Also included are these special purpose compose methods:</p>
533 <th align="left" style="width: 8%">Method</th>
534 <th align="left">Description</th>
538 <td valign="top">copy</td>
539 <td valign="top">This is equivelent to the Duff-Porter composition method
540 '<kbd>Src,<kbd>' but withotu clearing the parts of the destination
541 image that is not overlaid. </td>
545 <td valign="top">copy-*</td>
546 <td valign="top">Copy the specified channel (Red, Green, Blue, Cyan,
547 Magenta, Yellow, Black, or Opacity) in the source image to the
548 same channel in the destination image. If the channel specified
549 does not exist in the source image, (which can only happen for methods,
550 '<kbd>copy-opacity</kbd>' or '<kbd>copy-black</kbd>') then it is
551 assumed that the source image is a special grayscale channel image
552 of the values to be copied. </td>
556 <td valign="top">change-mask</td>
557 <td valign="top">Replace any destination pixel that is the similar to the
558 source images pixel (as defined by the current <a
559 href="../www/command-line-options.html#fuzz">-fuzz</a> factor), with transparency.
567 <p>On top of these composed methods are a few special ones that not only require
568 the two images that are being merged or overlaid, but have some extra numerical
569 arguments, which are tabled below. </p>
571 <p>In the "<code>composite</code>" command these composition methods are
572 selected using special options with the arguments needed. They are usually,
573 but not always, the same name as the composte 'method' they use, and replaces
574 the normal use of the <a href="../www/command-line-options.html#compose" >-compose</a>
575 setting in the "<code>composite</code>" command. For example... </p>
577 <p class='crt'><span class="crtprompt"> $magick> </span><span class='crtin'>composite ... -blend 50x50 ...</span></p>
578 <p>As of IM v6.5.3-4 the "<code>convert</code>" command can now also supply
579 these extra arguments to its <a href="../www/command-line-options.html#composite"
580 >-composite</a> operator, using the special <a
581 href="../www/command-line-options.html#set">-set</a> attribute of '<kbd
582 class="arg">option:compose:args</kbd>'. This means you can now make use of
583 these special argumented <a href="../www/command-line-options.html#compose"
584 >-compose</a> methods, those the argument and the method both need to be set
585 separatally. For example... </p>
587 <p class='crt'><span class="crtprompt"> $magick> </span><span class='crtin'>convert ... -compose blend -set option:compose:args 50x50 -composite ...</span></p>
588 <p>The following is a table of these special 'argumented' compose methods,
589 with a brief summary of what they do. For more details see the equivalent
590 "composite" command option name. </p>
595 <th align="left" style="width: 8%">Method</th>
596 <th align="left">Description</th>
600 <td valign="top">dissolve</td>
601 <td valign="top">Arguments:
602 <em class="arg">src_percent</em>[x<em class="arg">dst_percent</em>]
603 <br>Equivalent to "<code>composite</code>" <a href="../www/command-line-options.html#dissolve">-dissolve</a>
604 <br>Dissolve the 'source' image by the percentage given before overlaying
605 'over' the 'destination' image. If <em class="arg">src_percent</em> is
606 greater than 100, it starts dissolving the main image so it will
607 become transparent at a value of '<kbd class="arg">200</kbd>'. If
608 both percentages are given, each image are dissolved to the
614 <td valign="top">blend</td>
615 <td valign="top">Arguments:
616 <em class="arg">src_percent</em>[x<em class="arg">dst_percent</em>]
617 <br>Equivalent to "<code>composite</code>" <a
618 href="../www/command-line-options.html#blend">-blend</a>
619 <br>Average the images together ('plus') according to the percentages
620 given and each pixels transparency. If only a single percentage value
621 is given it sets the weight of the composite or 'source' image, while
622 the background image is weighted by the exact opposite amount. That is
623 a <kbd>-blend 30</kbd> merges 30% of the 'source' image with 70% of
624 the 'destination' image. Thus it is equivalent to <kbd>-blend
630 <td valign="top">mathematics</td>
631 <td valign="top">Arguments: <em class="arg">A, B, C, D</em>
632 <br>Not available in "<code>composite</code>" at this time.
633 <br>Merge the source and destination images according to the formula
634 <br> <code>A*Sc*Dc + B*Sc + C*Dc + D</code>
635 <br>Can be used to generate a custom composition method that would
636 otherwise need to be implemented using the slow <a
637 href="../www/command-line-options.html#fx">-fx</a> DIY image operator. Added
638 to ImageMagick version 6.5.4-3.
639 <br>As of IM v6.6.1-6 this method will do per-channel math compositions
640 if the 'Sync' flag is removed from <a
641 href="../www/command-line-options.html#channel" >-channel</a>, just like all
642 the other mathematical compostion methods above.
647 <td valign="top">modulate</td>
648 <td valign="top">Arguments:
649 <em class="arg">brightness</em>[x<em class="arg">saturation</em>]
650 <br>Equivalent to "<code>composite</code>" <a href="../www/command-line-options.html#watermark">-watermark</a>
651 <br>Take a grayscale image (with alpha mask) and modify the destination
652 image's brightness according to watermark image's grayscale value and
653 the <em class="arg">brightness</em> percentage. The destinations
654 color saturation attribute is just direct modified by the <em
655 class="arg">saturation</em> percentage, which defaults to 100 percent
662 <td valign="top">displace</td>
663 <td valign="top">Arguments:
664 <em class="arg">X-scale</em>[x<em class="arg">Y-scale</em>][!][%]
665 <br>Equivalent to "<code>composite</code>" <a href="../www/command-line-options.html#displace">-displace</a>
666 <br>With this option, the 'overlay' image, and optionally the 'mask'
667 image, is used as a relative displacement map, which is used to
668 displace the lookup of what part of the destination image is seen at
669 each point of the overlaid area. Much like the displacement map is a
670 'lens' that distorts the original 'background' image behind it.
672 The X-scale is modilated by the 'red' channel of the overlay image
673 while the Y-scale is modulated by the green channel, (the mask image
674 if given is rolled into green channel of the overlay image. This
675 separation allows you to modulate the X and Y lookup displacement
676 separatally allowing you to di 2 dimentional displacements, rather
677 than 1 dimentional verctored displacements (using grayscale image).
679 If the overlay image contains transparency this is used as a mask
680 of the resulting image to remove 'invalid' pixels.
682 The '%' flag makes the displacement scale relative to the size of the
683 overlay image (100% = half width/height of image). Using '!' switches
684 percentage arguments to refer to the destination image size instead.
686 Special flags were added Added to ImageMagick version 6.5.3-5.
691 <td valign="top">distort</td>
692 <td valign="top">Arguments:
693 <em class="arg">X-scale</em>[x<em class="arg">Y-scale</em
694 >[+<em class="arg">X-center</em>+<em class="arg">Y-center</em>]][!][%]
695 <br>Not available in "<code>composite</code>" at this time.
696 <br>Exactly as per 'Displace' (above), but using absolute coordinates,
697 relative to the center of the overlay (or that given). Basically
698 allows you to generate absolute distortion maps where 'black' will
699 look up the left/top edge, and 'white' looks up the bottom/right
700 edge of the destination image, according to the scale given.
702 The '!' flag not only switches percentage scaling, to use the
703 destination image, but also the image the center offset of the lookup.
704 This means the overlay can lookup a completely different region of the
707 Added to ImageMagick version 6.5.3-5.
712 <td valign="top">blur</td>
713 <td valign="top">Arguments:
714 <em class="arg">Width</em>[x<em class="arg">Height</em
715 >[+<em class="arg">Angle</em>]]
716 <br>Equivalent to "<code>composite</code>" <a href="../www/command-line-options.html#blur-composite">-blur</a>
717 <br>A Variable Blur Mapping Composition method, where each pixel in the
718 overlaid region is replaced with an Elliptical Weighted Average (EWA),
719 with an ellipse (typically a circle) of the given sigma size, scaled
720 according to overlay (source image) grayscale mapping.
722 As per 'Displace' and 'Distort', the red channel will modulate the
723 width of the ellipse, while the green channel will modulate the height
724 of the ellipse. However at this time the ellipse angle is not
725 modulated though this may be a future posibility (perhaps with a
726 special flag to enable use of blur channel for this purpose).
728 Added to ImageMagick version 6.5.4-0.
735 <p>To print a complete list of all the available compose operators, use <a
736 href="../www/command-line-options.html#list">-list compose</a>.</p>
743 <span id="linkbar-west"> </span>
\r
744 <span id="linkbar-center">
\r
745 <a href="http://www.imagemagick.org/discourse-server/">Discourse Server</a> •
\r
746 <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a>
\r
748 <span id="linkbar-east"> </span>
\r
750 <div class="footer">
\r
751 <span id="footer-west">© 1999-2010 ImageMagick Studio LLC</span>
\r
752 <span id="footer-east"> <a href="http://www.imagemagick.org/script/contact.php">Contact the Wizards</a></span>
\r
754 <div style="clear: both; margin: 0; width: 100%; "></div>
\r
755 <script type="text/javascript">
\r
756 var _gaq = _gaq || [];
\r
757 _gaq.push(['_setAccount', 'UA-17690367-1']);
\r
758 _gaq.push(['_trackPageview']);
\r
761 var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
\r
762 ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
\r
763 var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
\r