ImageMagick v6 Examples --
Compose Tables

Index
ImageMagick Examples Preface and Index

Compose Tables

The following tables of most of the IM compose methods with various matte channels, with and without a third masking image. That are use as a basic summary of these important alpha compositing methods.

Note that there are a number of methods which are not listed in the ImageMagick manuals, which I display in these table, on the otherhand I do not display all the compose operators either.

Some methods which are available require extra arguments, specifically, Dissolve, Modulate, and Watermark. These are explored seperatally, not here, as you can not supply the argument with the compose methods setting.

The command I run is...

  convert  {Dst} {Src} -compose {method} -composite {result}

For these first set of tables with I am using two images which are simular to the test images used in the documentation for SVG Alpha Compositing. They are perfect for demonstrating the 12 'Duff-Porter' compose operators. They are trianglular images containng no semi-transparent pixels (only transparent and opaque colors.

As some of compositing operators will modify the whole background (destination) image, including outside the overlaid area, or even if the source is completely transparent. Because of this I have increased the size of the background (destination) image slightly, and added a "-gravity center" setting. Operators that do this are; Clear, Src, In, Dst_In, Out, and Dst_Atop.

[IM Output] [IM Output]


However while the Duff-Porter methods are usful for basic image overlays, Their are a set of math methods that are much more useful with image masks.

To demostrate I created some black and white images of circles which overlap, so you can see the results.

[IM Output] [IM Output]

WARNING: The output from "Minus" appears fully transparent as not only is the color subtracted, but also the Alpha Channel, resulting in a fully transparent image.

Note the 'edge' effects that result in some of the above images. These are caused by the edges of the circles being some shade of gray (anti-aliasing), rather than purely black or white. They appear in 'Add' and 'Subtract' as these are 'modulus wrapped'. (See the specific section on Add and Subtract, mathematical composition for more details.


Gradients make the best demonstration of the mathematical methods as well as "Channel Coping" and "Color Manupliation" alpha blending methods.

[IM Output]
[IM Output] [IM Output]
[IM Output] [IM Output]


Created: 5 January 2004
Updated: 11 July 2009
Author: Anthony Thyssen, <A.Thyssen@griffith.edu.au>
Examples Generated with: [version image]
URL: http://www.imagemagick.org/Usage/compose/tables/