|
|
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
| "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
| <html version="-//W3C//DTD XHTML 1.1//EN"
|
| xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
|
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
| xsi:schemaLocation="http://www.w3.org/1999/xhtml
|
| http://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd">
|
| <head>
|
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
| <meta name="verify-v1" content="g222frIIxcQTrvDR3NBRUSKP3AnMNoqxOkIniCEkV7U="/>
|
| <title>ImageMagick: Alpha Compositing</title> |
| <meta http-equiv="Content-Language" content="en-US"/> |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
| <meta http-equiv="Reply-to" content="magick-users@imagemagick.org"/> |
| <meta name="Application-name" content="ImageMagick"/> |
| <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."/> |
| <meta name="Application-url" content="http://www.imagemagick.org"/> |
| <meta name="Generator" content="PHP"/> |
| <meta name="Keywords" content="alpha, compositing, ImageMagick, ImageMagic, MagickCore, MagickWand, PerlMagick, Magick++, RMagick, PythonMagick, JMagick, TclMagick, Image, Magick, Magic, Wand, ImageMagickObject, Swiss, Army, Knife, Image, Processing"/> |
| <meta name="Rating" content="GENERAL"/> |
| <meta name="Robots" content="INDEX, FOLLOW"/> |
| <meta name="Generator" content="ImageMagick Studio LLC"/> |
| <meta name="Author" content="ImageMagick Studio LLC"/> |
| <meta name="Revisit-after" content="2 DAYS"/> |
| <meta name="Resource-type" content="document"/> |
| <meta name="Copyright" content="Copyright (c) 1999-2011 ImageMagick Studio LLC"/> |
| <meta name="Distribution" content="Global"/> |
| <link rel="icon" href="../images/wand.png"/> |
| <link rel="shortcut icon" href="../images/wand.ico" type="images/x-icon"/> |
| <link rel="meta" type="application/rdf+xml" title="ICI" href="http://imagemagick.org/ici.rdf"/>
|
| <link rel="stylesheet" href="http://www.google.com/cse/style/look/default.css" type="text/css" />
|
| <style type="text/css" media="all">
|
| @import url("../www/magick.css");
|
| </style>
|
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
|
| <script type="text/javascript" src="../fancybox/jquery.fancybox-1.3.4.pack.js"></script>
|
| <link rel="stylesheet" type="text/css" href="../fancybox/jquery.fancybox-1.3.4.css" media="screen" />
|
| <script type="text/javascript">
|
| $(document).ready(function() {
|
| $("a[href$=.jpg],a[href$=.png],a[href$=.gif]").fancybox({
|
| 'transitionIn' : 'elastic',
|
| 'transitionOut' : 'elastic',
|
| 'overlayShow' : false,
|
| 'opacity' : true
|
| });
|
| });
|
| </script>
|
| </head>
|
|
|
| <body id="www-imagemagick-org">
|
| <div class="titlebar">
|
| <a href="../index.html">
|
| <img src="../images/script.png" alt="[ImageMagick]"
|
| style="width: 350px; height: 60px; margin: 28px auto; float: left;" /></a>
|
| <a href="http://www.networkredux.com">
|
| <img src="../images/networkredux.png" alt="[sponsor]"
|
| style="margin-top: 42px; border: 0px; float: left;" /></a>
|
| <a href="http://www.imagemagick.org/discourse-server/">
|
| <img src="../images/logo.jpg"
|
| alt="ImageMagick Logo"
|
| style="width: 123px; height: 118px; border: 0px; float: right;" /></a>
|
| <a href="../index.html">
|
| <img src="../images/sprite.jpg"
|
| alt="ImageMagick Sprite"
|
| style="width: 114px; height: 118px; border: 0px; float: right;" /></a>
|
| </div>
|
|
|
| <div class="westbar">
|
|
|
| <div class="menu"> |
| <a title="About ImageMagick" href="../index.html">About ImageMagick</a> |
| </div> |
| <div class="sep"></div>
|
| <div class="menu"> |
| <a title="Binary Releases" href="../www/binary-releases.html">Binary Releases</a> |
| </div> |
| <div class="sub"> |
| <a title="Binary Release: Unix" href="../www/binary-releases.html#unix">Unix</a> |
| </div> |
| <div class="sub"> |
| <a title="Binary Release: MacOS X" href="../www/binary-releases.html#macosx">Mac OS X</a> |
| </div> |
| <div class="sub"> |
| <a title="Binary Release: iPhone" href="../www/binary-releases.html#iPhone">iPhone</a> |
| </div> |
| <div class="sub"> |
| <a title="Binary Release: Windows" href="../www/binary-releases.html#windows">Windows</a> |
| </div> |
| <div class="sep"></div>
|
| <div class="menu"> |
| <a title="Command-line Tools" href="../www/command-line-tools.html">Command-line Tools</a> |
| </div> |
| <div class="sub"> |
| <a title="Command-line Tools: Processing" href="../www/command-line-processing.html">Processing</a> |
| </div> |
| <div class="sub"> |
| <a title="Command-line Tools: Options" href="../www/command-line-options.html">Options</a> |
| </div> |
| <div class="sub"> |
| <a title="Command-line Tools: Usage" href="http://www.imagemagick.org/Usage/">Usage</a> |
| </div> |
| <div class="menu"> |
| <a title="Program Interfaces" href="../www/api.html">Program Interfaces</a> |
| </div> |
| <div class="sub"> |
| <a title="Program Interface: MagickWand" href="../www/magick-wand.html">MagickWand</a> |
| </div> |
| <div class="sub"> |
| <a title="Program Interface: MagickCore" href="../www/magick-core.html">MagickCore</a> |
| </div> |
| <div class="sub"> |
| <a title="Program Interface: PerlMagick" href="../www/perl-magick.html">PerlMagick</a> |
| </div> |
| <div class="sub"> |
| <a title="Program Interface: Magick++" href="../www/magick++.html">Magick++</a> |
| </div> |
| <div class="sep"></div>
|
| <div class="menu"> |
| <a title="Install from Source" href="../www/install-source.html">Install from Source</a> |
| </div> |
| <div class="sub"> |
| <a title="Install from Source: Unix" href="../www/install-source.html#unix">Unix</a> |
| </div> |
| <div class="sub"> |
| <a title="Install from Source: Windows" href="../www/install-source.html#windows">Windows</a> |
| </div> |
| <div class="menu"> |
| <a title="Resources" href="../www/resources.html">Resources</a> |
| </div> |
| <div class="menu"> |
| <a title="Architecture" href="../www/architecture.html">Architecture</a> |
| </div> |
| <div class="menu"> |
| <a title="Download" href="../www/download.html">Download</a> |
| </div> |
| <div class="sep"></div>
|
| <div class="menu"> |
| <a title="Search" href="../www/search.html">Search</a> |
| </div> |
| <div class="sep"></div>
|
| <div class="menu"> |
| <a title="Site Map" href="../www/sitemap.html">Site Map</a> |
| </div> |
| <div class="sub"> |
| <a title="Site Map: Links" href="../www/links.html">Links</a> |
| </div> |
| <div class="sep"></div>
|
| <div class="menu"> |
| <a title="Sponsors" href="../www/sponsors.html">Sponsors:</a> |
| |
| <div class="sponsbox"> |
| <div class="sponsor"> |
| <a title="Sponsor: Best Web Hosting" href="http://webhostinggeeks.com">Best Web Hosting</a><!-- 201110010720 --> |
| </div> |
| <div class="sponsor"> |
| <a title="Sponsor: Web Hosting Ratings" href="http://webhostingrating.com">Web Hosting Ratings</a><!-- 201110010720 --> |
| </div> |
| <div class="sponsor"> |
| <a title="Sponsor: Druckerei" href="http://www.allesdruck.de">Druckerei</a><!-- 201107010240 r.leo --> |
| </div> |
| <div class="sponsor"> |
| <a title="Sponsor: Web Hosting" href="http://www.bodhost.com/hosting.shtml">Web Hosting</a><!-- 201104010090 --> |
| </div> |
| <div class="sponsor"> |
| <a title="Sponsor: Image Converter" href="http://www.batchphoto.com">Image Converter</a><!-- 201103010900 Bits Coffee--> |
| </div> |
| <div class="sponsor"> |
| <a title="Sponsor: Flyer drucken" href="http://www.online-druck.biz">Flyer drucken</a><!-- 201109010900 Floeter--> |
| </div> |
| <div class="sponsor"> |
| <a title="Sponsor: Druckerei" href="http://print24.com/de/">Druckerei</a><!-- 201110010720 --> |
| </div> |
| <div class="sponsor"> |
| <a title="Sponsor: Custom T-Shirts" href="http://www.ooshirts.com">Custom T-Shirts</a><!-- 2011050100030 ooshirts.com--> |
| </div> |
| </div> |
| </div> |
| </div>
|
|
|
| <div class="eastbar">
|
| <script type="text/javascript">
|
| <!--
|
| google_ad_client = "pub-3129977114552745";
|
| google_ad_slot = "0574824969";
|
| google_ad_width = 160;
|
| google_ad_height = 600;
|
| //-->
|
| </script>
|
| <script type="text/javascript"
|
| src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
| </script>
|
| </div>
|
|
|
| <div class="main">
|
|
|
| <h1>ImageMagick Image Composition</h1> |
| <p>This page descibed the Image composition methods that is used to define how |
| two images should be merged together in various image operations. For the |
| Command Line API it is typically set using the <A |
| HREF="../www/command-line-options.html#compose" >-compose</A> setting option. </p> |
| |
| |
| <p>The description of composition uses abstract terminology in order to allow |
| the description to be more precise, while avoiding constant values which are |
| specific to a particular build configuration. Each image pixel is represented |
| by red, green, and blue levels (which are equal for a gray pixel). The |
| build-dependent value <em class="QR">QuantumRange</em> is the maximum integral |
| value which may be stored, per pixel, in the red, green, or blue channels of |
| the image. Each image pixel may also optionally (if the image matte channel is |
| enabled) have an associated level of opacity, ranging from <em>opaque</em> to |
| <em>transparent</em>, which may be used to determine the influence of the pixel |
| color when compositing the pixel with another image pixel. If the image matte |
| channel is disabled, then all pixels in the image are treated as opaque. The |
| color of an opaque pixel is fully visible while the color of a transparent |
| pixel color is entirely absent (pixel color is ignored).</p> |
| |
| <p>By definition, raster images have a rectangular shape. All image rows are of |
| equal length, as are all image columns. By treating the alpha channel as a |
| visual "mask" the rectangular image may be given a "shape" by treating the |
| alpha channel as a cookie-cutter for the image. This is done by setting the |
| pixels within the shape to be opaque, with pixels outside the shape set as |
| transparent. Pixels on the boundary of the shape may be between opaque and |
| transparent in order to provide antialiasing (visually smooth edges). The |
| description of the composition operators use this concept of image "shape" in |
| order to make the description of the operators easier to understand. While it |
| is convenient to describe the operators in terms of "shapes" they are by no |
| means limited to mask-style operations since they are based on continuous |
| floating-point mathematics rather than simple boolean operations.</p> |
| |
| <p>The following alpha blending (Duff-Porter) compose methods are available:</p> |
| |
| <table class="doc"> |
| <tbody> |
| <tr valign="top"> |
| <th align="left" style="width: 8%">Method</th> |
| <th align="left">Description</th> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">clear</td> |
| <td valign="top">Both the color and the alpha of the destination are |
| cleared. Neither the source nor the destination are used (except for |
| destinations size and other meta-data which is always preserved.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">src</td> |
| <td valign="top">The source is copied to the destination. The destination |
| is not used as input, though it is cleared.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">dst</td> |
| <td valign="top">The destination is left untouched. The source image is |
| completely ignored.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">src-over</td> |
| <td valign="top">The source is composited over the destination. this is |
| the default alpha blending compose method, when neither the compose |
| setting is set, nor is set in the image meta-data.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">dst-over</td> |
| <td valign="top">The destination is composited over the source and the |
| result replaces the destination.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">src-in</td> |
| <td valign="top">The part of the source lying inside of the destination |
| replaces the destination.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">dst-in</td> |
| <td valign="top">The part of the destination lying inside of the source |
| replaces the destination. Areas not overlaid are cleared.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">src-out</td> |
| <td valign="top">The part of the source lying outside of the destination |
| replaces the destination.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">dst-out</td> |
| <td valign="top">The part of the destination lying outside of the source |
| replaces the destination.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">src-atop</td> |
| <td valign="top">The part of the source lying inside of the destination is |
| composited onto the destination.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">dst-atop</td> |
| <td valign="top">The part of the destination lying inside of the source is |
| composited over the source and replaces the destination. Areas not |
| overlaid are cleared. </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">xor</td> |
| <td valign="top">The part of the source that lies outside of the |
| destination is combined with the part of the destination that lies |
| outside of the source. Source or Destination, but not both. </td> |
| </tr> |
| |
| </tbody> |
| </table> |
| |
| <p>Any of the 'Src-*' methods can also be specified without the 'Src-' part. |
| For example the default compose method can be specified as just 'Over'.</p> |
| |
| <p>Many of these compose methods will clear the destination image which was |
| not overlaid by the source image. This is to be expected as part of that |
| specific composition methods defintion. You can disable this by setting the |
| special <A HREF="../www/command-line-options.html#define" |
| >-define</A> 'compose:outside-overlay' to a value of 'false' will turn off |
| this behaviour. </p> |
| |
| <p>On top of the above 12 Duff-Porter Alpha Composition methods, one special |
| related method '<kbd>Copy</kbd>' has been provided. This is equivelent to |
| using the '<kbd>Src</kbd>' with the special <A HREF="../www/command-line-options.html#define" |
| >-define</A> option '<kbd>compose:outside-overlay</kbd>' set to |
| '<kbd>false</kbd>', so as to only modify the overlaid area, without clearing |
| the rest of the image outside the overlaid area. </p> |
| |
| <br><br> |
| |
| <p>The following mathemathical composition methods are also available. </p> |
| |
| <table class="doc"> |
| <tbody> |
| <tr valign="top"> |
| <th align="left" style="width: 8%">Method</th> |
| <th align="left">Description</th> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">multiply</td> |
| <td valign="top">The source is multiplied by the destination and replaces |
| the destination. The resultant color is always at least as dark as |
| either of the two constituent colors. Multiplying any color with black |
| produces black. Multiplying any color with white leaves the original |
| color unchanged.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">screen</td> |
| <td valign="top">The source and destination are complemented and then |
| multiplied and then replace the destination. The resultant color is |
| always at least as light as either of the two constituent colors. |
| Screening any color with white produces white. Screening any color |
| with black leaves the original color unchanged.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">plus</td> |
| <td valign="top">The source is added to the destination and replaces the |
| destination. This operator is useful for averaging or a controled |
| merger of two images, rather than a direct overlay.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">add</td> |
| <td valign="top">As per 'plus' but transparency data is treated as matte |
| values. As such any transparent areas in either image remain |
| transparent. </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">minus</td> |
| <td valign="top">Subtract the colors in the source image from the |
| destination image. When transparency is involved, opaque areas is |
| subtracted from any destination opaque areas. </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">subtract</td> |
| <td valign="top">Subtract the colors in the source image from the |
| destination image. When transparency is involved transparent areas are |
| subtracted, so only the opaque areas in the source remain opaque in |
| the destination image. </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">difference</td> |
| <td valign="top">Subtracts the darker of the two constituent colors from |
| the lighter. Painting with white inverts the destination color. |
| Painting with black produces no change.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">exclusion</td> |
| <td valign="top">Produces an effect similar to that of 'difference', but |
| appears as lower contrast. Painting with white inverts the |
| destination color. Painting with black produces no change.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">darken</td> |
| <td valign="top">Selects the darker of the destination and source colors. |
| The destination is replaced with the source when the source is darker, |
| otherwise it is left unchanged.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">lighten</td> |
| <td valign="top">Selects the lighter of the destination and source colors. |
| The destination is replaced with the source when the source is |
| lighter, otherwise it is left unchanged. </td> |
| </tr> |
| |
| </tbody> |
| </table> |
| |
| <p>Typically these use the default 'Over' alpha blending when transparencies |
| are also involved, except for 'Plus' which uses a 'plus' alpha blending. This |
| means the alpha channel of both images will only be used to ensure that any |
| visible input remains visible even in parts not overlaid. It also means that |
| any values are weighted by the alpha channel of the input and output images. |
| This 'Over' alpha blending is also applied to the lighting composition methods |
| below. </p> |
| |
| <p>As of IM v6.6.1-6, if the special '<kbd>Sync</kbd>' flag is not specified |
| (enabled by default) with the <a href="../www/command-line-options.html#channel" |
| >-channel</a> setting, then the above mathematical compositions will nolonger |
| syncronise its actions with the alpha channel. Instead the math composition |
| will be applied on an individual channel basis as defined by the <a |
| href="../www/command-line-options.html#channel" |
| >-channel</a>. This includes the alpha channel. This special usage |
| allows you to perform true mathematics of the image channels, without alpha |
| compostion effects, becomming involved. </p> |
| |
| <p>This special flag is not applied to the lighting composition methods (see |
| below) even though they are closely related to mathematical composition |
| methods.</p> |
| |
| <br><br> |
| |
| <p>The following lighting composition methods are also available. </p> |
| |
| <table class="doc"> |
| <tbody> |
| <tr valign="top"> |
| <th align="left" style="width: 8%">Method</th> |
| <th align="left">Description</th> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">linear-dodge</td> |
| <td valign="top">This is equivelent to 'Plus' in that the color channels |
| are simply added, however it does not 'Plus' the alpha channel, but |
| uses the normal 'Over' alpha blending, which transparencies are |
| involved. Produces a sort of additive multiply-like result. Added |
| ImageMagick version 6.5.4-3. </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">linear-burn</td> |
| <td valign="top">As 'Linear-Dodge', but also subtract one from the result. |
| Sort of a additive 'Screen' of the images. Added ImageMagick version |
| 6.5.4-3. </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">color-dodge</td> |
| <td valign="top">Brightens the destination color to reflect the source |
| color. Painting with black produces no change.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">color-burn</td> |
| <td valign="top">Darkens the destination color to reflect the source |
| color. Painting with white produces no change. Fixed in ImageMagick |
| version 6.5.4-3. </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">overlay</td> |
| <td valign="top">Multiplies or screens the colors, dependent on the |
| destination color. Source colors overlay the destination whilst |
| preserving its highlights and shadows. The destination color is not |
| replaced, but is mixed with the source color to reflect the lightness |
| or darkness of the destination.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">hard-light</td> |
| <td valign="top">Multiplies or screens the colors, dependent on the source |
| color value. If the source color is lighter than 0.5, the destination |
| is lightened as if it were screened. If the source color is darker |
| than 0.5, the destination is darkened, as if it were multiplied. The |
| degree of lightening or darkening is proportional to the difference |
| between the source color and 0.5. If it is equal to 0.5 the |
| destination is unchanged. Painting with pure black or white produces |
| black or white.</td> |
| </tr> |
| |
| |
| <tr valign="top"> |
| <td valign="top">linear-light</td> |
| <td valign="top">Like 'Hard-Light' but using linear-dodge and linear-burn |
| instead. Increases contrast slightly with an impact on the |
| foreground's tonal values.</td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">soft-light</td> |
| <td valign="top">Darkens or lightens the colors, dependent on the source |
| color value. If the source color is lighter than 0.5, the destination |
| is lightened. If the source color is darker than 0.5, the destination |
| is darkened, as if it were burned in. The degree of darkening or |
| lightening is proportional to the difference between the source color |
| and 0.5. If it is equal to 0.5, the destination is unchanged. Painting |
| with pure black or white produces a distinctly darker or lighter area, |
| but does not result in pure black or white. Fixed in ImageMagick |
| version 6.5.4-3. </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">pegtop-light</td> |
| <td valign="top">Almost equivelent to 'Soft-Light', but using a |
| continuious mathematical formula rather than two conditionally |
| selected formulae. Added ImageMagick version 6.5.4-3. </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">vivid-light</td> |
| <td valign="top">A modified 'Linear-Light' designed to preserve very stong |
| primary and secondary colors in the image. Added ImageMagick version |
| 6.5.4-3. </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">pin-light</td> |
| <td valign="top">Similar to 'Hard-Light', but using sharp linear shadings, |
| to similate the effects of a strong 'pinhole' light source. Added |
| ImageMagick version 6.5.4-3. </td> |
| </tr> |
| |
| </tbody> |
| </table> |
| |
| |
| <br><br> |
| |
| <p>Also included are these special purpose compose methods:</p> |
| |
| <table class="doc"> |
| <tbody> |
| <tr valign="top"> |
| <th align="left" style="width: 8%">Method</th> |
| <th align="left">Description</th> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">copy</td> |
| <td valign="top">This is equivelent to the Duff-Porter composition method |
| '<kbd>Src,</kbd>' but without clearing the parts of the destination |
| image that is not overlaid. </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">copy-*</td> |
| <td valign="top">Copy the specified channel (Red, Green, Blue, Cyan, |
| Magenta, Yellow, Black, or Opacity) in the source image to the |
| same channel in the destination image. If the channel specified |
| does not exist in the source image, (which can only happen for methods, |
| '<kbd>copy-opacity</kbd>' or '<kbd>copy-black</kbd>') then it is |
| assumed that the source image is a special grayscale channel image |
| of the values that is to be copied. </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">change-mask</td> |
| <td valign="top">Replace any destination pixel that is the similar to the |
| source images pixel (as defined by the current <a |
| href="../www/command-line-options.html#fuzz">-fuzz</a> factor), with transparency. |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| |
| <br><br> |
| |
| <p>On top of these composed methods are a few special ones that not only require |
| the two images that are being merged or overlaid, but have some extra numerical |
| arguments, which are tabled below. </p> |
| |
| <p>In the "<code>composite</code>" command these composition methods are |
| selected using special options with the arguments needed. They are usually, |
| but not always, the same name as the composte 'method' they use, and replaces |
| the normal use of the <a href="../www/command-line-options.html#compose" >-compose</a> |
| setting in the "<code>composite</code>" command. For example... </p> |
| |
| <p class='crt'><span class="crtprompt"> $magick> </span><span class='crtin'>composite ... -blend 50x50 ...</span></p> |
| <p>As of IM v6.5.3-4 the "<code>convert</code>" command can now also supply |
| these extra arguments to its <a href="../www/command-line-options.html#composite" |
| >-composite</a> operator, using the special <a href="../www/command-line-options.html#define">-define</a> |
| attribute of '<kbd class="arg">compose:args</kbd>'. This means you can now |
| make use of these special argumented <a href="../www/command-line-options.html#compose" |
| >-compose</a> methods, those the argument and the method both need to be set |
| separatally. For example... </p> |
| |
| <p class='crt'><span class="crtprompt"> $magick> </span><span class='crtin'>convert ... -compose blend -define compose:args=50,50 -composite ...</span></p> |
| <p>The following is a table of these special 'argumented' compose methods, |
| with a brief summary of what they do. For more details see the equivalent |
| "composite" command option name. </p> |
| |
| <table class="doc"> |
| <tbody> |
| <tr valign="top"> |
| <th align="left" style="width: 8%">Method</th> |
| <th align="left">Description</th> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">dissolve</td> |
| <td valign="top">Arguments: |
| <em class="arg">src_percent</em>[x<em class="arg">dst_percent</em>] |
| <br>Equivalent to "<code>composite</code>" <a href="../www/command-line-options.html#dissolve">-dissolve</a> |
| <br>Dissolve the 'source' image by the percentage given before overlaying |
| 'over' the 'destination' image. If <em class="arg">src_percent</em> is |
| greater than 100, it starts dissolving the main image so it will |
| become transparent at a value of '<kbd class="arg">200</kbd>'. If |
| both percentages are given, each image are dissolved to the |
| percentages given. |
| </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">blend</td> |
| <td valign="top">Arguments: |
| <em class="arg">src_percent</em>[x<em class="arg">dst_percent</em>] |
| <br>Equivalent to "<code>composite</code>" <a |
| href="../www/command-line-options.html#blend">-blend</a> |
| <br>Average the images together ('plus') according to the percentages |
| given and each pixels transparency. If only a single percentage value |
| is given it sets the weight of the composite or 'source' image, while |
| the background image is weighted by the exact opposite amount. That is |
| a <kbd>-blend 30</kbd> merges 30% of the 'source' image with 70% of |
| the 'destination' image. Thus it is equivalent to <kbd>-blend |
| 30x70</kbd>. |
| </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">mathematics</td> |
| <td valign="top">Arguments: <em class="arg">A, B, C, D</em> |
| <br>Not available in "<code>composite</code>" at this time. |
| <br>Merge the source and destination images according to the formula |
| <br> <code>A*Sc*Dc + B*Sc + C*Dc + D</code> |
| <br>Can be used to generate a custom composition method that would |
| otherwise need to be implemented using the slow <a |
| href="../www/command-line-options.html#fx">-fx</a> DIY image operator. Added |
| to ImageMagick version 6.5.4-3. |
| <br>As of IM v6.6.1-6 this method will do per-channel math compositions |
| if the 'Sync' flag is removed from <a |
| href="../www/command-line-options.html#channel" >-channel</a>, just like all |
| the other mathematical compostion methods above. |
| </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">modulate</td> |
| <td valign="top">Arguments: |
| <em class="arg">brightness</em>[x<em class="arg">saturation</em>] |
| <br>Equivalent to "<code>composite</code>" <a href="../www/command-line-options.html#watermark">-watermark</a> |
| <br>Take a grayscale image (with alpha mask) and modify the destination |
| image's brightness according to watermark image's grayscale value and |
| the <em class="arg">brightness</em> percentage. The destinations |
| color saturation attribute is just direct modified by the <em |
| class="arg">saturation</em> percentage, which defaults to 100 percent |
| (no color change). |
| |
| </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">displace</td> |
| <td valign="top">Arguments: |
| <em class="arg">X-scale</em>[x<em class="arg">Y-scale</em>][!][%] |
| <br>Equivalent to "<code>composite</code>" <a href="../www/command-line-options.html#displace">-displace</a> |
| <br>With this option, the 'overlay' image, and optionally the 'mask' |
| image, is used as a relative displacement map, which is used to |
| displace the lookup of what part of the destination image is seen at |
| each point of the overlaid area. Much like the displacement map is a |
| 'lens' that distorts the original 'background' image behind it. |
| <br><br> |
| The X-scale is modilated by the 'red' channel of the overlay image |
| while the Y-scale is modulated by the green channel, (the mask image |
| if given is rolled into green channel of the overlay image. This |
| separation allows you to modulate the X and Y lookup displacement |
| separatally allowing you to di 2 dimentional displacements, rather |
| than 1 dimentional verctored displacements (using grayscale image). |
| <br><br> |
| If the overlay image contains transparency this is used as a mask |
| of the resulting image to remove 'invalid' pixels. |
| <br><br> |
| The '%' flag makes the displacement scale relative to the size of the |
| overlay image (100% = half width/height of image). Using '!' switches |
| percentage arguments to refer to the destination image size instead. |
| <br><br> |
| Special flags were added Added to ImageMagick version 6.5.3-5. |
| </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">distort</td> |
| <td valign="top">Arguments: |
| <em class="arg">X-scale</em>[x<em class="arg">Y-scale</em |
| >[+<em class="arg">X-center</em>+<em class="arg">Y-center</em>]][!][%] |
| <br>Not available in "<code>composite</code>" at this time. |
| <br>Exactly as per 'Displace' (above), but using absolute coordinates, |
| relative to the center of the overlay (or that given). Basically |
| allows you to generate absolute distortion maps where 'black' will |
| look up the left/top edge, and 'white' looks up the bottom/right |
| edge of the destination image, according to the scale given. |
| <br><br> |
| The '!' flag not only switches percentage scaling, to use the |
| destination image, but also the image the center offset of the lookup. |
| This means the overlay can lookup a completely different region of the |
| destination image. |
| <br><br> |
| Added to ImageMagick version 6.5.3-5. |
| </td> |
| </tr> |
| |
| <tr valign="top"> |
| <td valign="top">blur</td> |
| <td valign="top">Arguments: |
| <em class="arg">Width</em>[x<em class="arg">Height</em |
| >[+<em class="arg">Angle</em>][+<em class="arg">Angle2</em>]] |
| <br>Equivalent to "<code>composite</code>" <a href="../www/command-line-options.html#blur-composite">-blur</a> |
| <br>A Variable Blur Mapping Composition method, where each pixel in the |
| overlaid region is replaced with an Elliptical Weighted Average (EWA), |
| with an ellipse (typically a circle) of the given sigma size, scaled |
| according to overlay (source image) grayscale mapping. |
| <br><br> |
| As per 'Displace' and 'Distort', the red channel will modulate the |
| width of the ellipse, while the green channel will modulate the height |
| of the ellipse. If a single Angle value is given in the arguments, |
| then the ellipse will then be rotated by the angle specifed. |
| <br><br> |
| Normally the blue channel of the mapping overlay image is ignored. |
| However if a second ellipse angle is given, then it is assumed that |
| the blue channel defines a variable angle for the ellipse ranging from |
| the first angle to the second angle given. This allows to generate |
| radial blurs, or a rough approximation for rotational blur. Or any mix |
| of the two. |
| <br><br> |
| Added to ImageMagick version 6.5.4-0. |
| </td> |
| </tr> |
| |
| </tbody> |
| </table> |
| |
| <p>To print a complete list of all the available compose operators, use <a |
| href="../www/command-line-options.html#list">-list compose</a>.</p> |
| |
| |
|
|
| </div>
|
|
|
| <div id="linkbar">
|
| <span id="linkbar-west"> </span>
|
| <span id="linkbar-center">
|
| <a href="http://www.imagemagick.org/discourse-server/">Discourse Server</a> •
|
| <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Studio</a>
|
| </span>
|
| <span id="linkbar-east"> </span>
|
| </div>
|
| <div class="footer">
|
| <span id="footer-west">© 1999-2011 ImageMagick Studio LLC</span>
|
| <span id="footer-east"> <a href="http://www.imagemagick.org/script/contact.php">Contact the Wizards</a></span>
|
| </div>
|
| <div style="clear: both; margin: 0; width: 100%; "></div>
|
| <script type="text/javascript">
|
| var _gaq = _gaq || [];
|
| _gaq.push(['_setAccount', 'UA-17690367-1']);
|
| _gaq.push(['_trackPageview']);
|
|
|
| (function() {
|
| var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
| ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
| var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
| })();
|
| </script>
|
| </body>
|
| </html>
|