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