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