5 <title>ImageMagick: Command-line Tools: Composite</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8">
7 <meta name="application-name" content="ImageMagick">
8 <meta name="description" content="ImageMagick® is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.">
9 <meta name="application-url" content="http://www.imagemagick.org">
10 <meta name="generator" content="PHP">
11 <meta name="keywords" content="command-line, tools:, composite, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert">
12 <meta name="rating" content="GENERAL">
13 <meta name="robots" content="INDEX, FOLLOW">
14 <meta name="generator" content="ImageMagick Studio LLC">
15 <meta name="author" content="ImageMagick Studio LLC">
16 <meta name="revisit-after" content="2 DAYS">
17 <meta name="resource-type" content="document">
18 <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC">
19 <meta name="distribution" content="Global">
20 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1">
21 <link rel="icon" href="../images/wand.png">
22 <link rel="shortcut icon" href="../images/wand.ico">
23 <link rel="stylesheet" href="../css/magick.html">
27 <div class="magick-masthead">
28 <div class="container">
29 <script async src="http://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-3129977114552745" data-ad-slot="6345125851" data-ad-format="auto"></ins>
31 (adsbygoogle = window.adsbygoogle || []).push({});
33 <nav class="magick-nav">
34 <a class="magick-nav-item " href="../index.html">Home</a>
35 <a class="magick-nav-item " href="binary-releases.html">Download</a>
36 <a class="magick-nav-item " href="command-line-tools.html">Tools</a>
37 <a class="magick-nav-item " href="command-line-options.html">Options</a>
38 <a class="magick-nav-item " href="resources.html">Resources</a>
39 <a class="magick-nav-item " href="api.html">Develop</a>
40 <a class="magick-nav-item " href="http://nextgen.imagemagick.org/script/search.php">Search</a>
41 <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a>
45 <div class="container">
46 <div class="magick-header">
47 <p class="text-center"><a href="composite.html#usage">Example Usage</a> • <a href="composite.html#options">Option Summary</a></p>
49 <p class="lead magick-description">Use the <code>composite</code> program to overlap one image over another. See <a href="command-line-processing.html">Command Line Processing</a> for advice on how to structure your <code>composite</code> command or see below for example usages of the command.</p>
51 <h2 class="magick-header"><a id="usage"></a>Example Usage</h2>
53 <p>We list a few examples of the <code>composite</code> command here to illustrate its usefulness and ease of use. To get started, lets overlay a smiley face over a rose:</p>
56 composite -gravity center smile.gif rose: rose-over.png
60 <a href="../images/smile.gif"><img src="../images/smile.gif" width="48" height="48" alt="smile"></a>
61 <img src="../images/over.gif" width="56" height="46" alt="over">
62 <a href="../images/rose.jpg"><img src="../images/rose.jpg" width="70" height="46" alt="rose"></a>
63 <img style="margin-top:13px; margin-bottom:13px;" src="../images/right.gif" width="20" height="20" alt="==>">
64 <a href="../images/rose-over.png"><img src="../images/rose-over.png" width="70" height="46" alt="rose"></a>
67 <p>You can create three-dimensional effect with the <var>Atop</var>:</p>
70 convert -size 70x70 canvas:none -fill red -draw 'circle 35,35 10,30' red-circle.png
71 convert -size 70x70 canvas:none -draw 'circle 35,35 35,20' -negate \
72 -channel A -gaussian-blur 0x8 white-highlight.png
73 composite -compose atop -geometry -13-17 white-highlight.png red-circle.png red-ball.png
77 <a href="../images/white-highlight.png"><img src="../images/white-highlight.png" width="70" height="70" alt="white highlight"></a>
78 <img src="../images/atop.gif" width="56" height="70" alt="atop">
79 <a href="../images/red-circle.png"><img src="../images/red-circle.png" width="70" height="70" alt="red circle"></a>
80 <img style="margin-top:25px; margin-bottom:25px;" src="../images/right.gif" width="20" height="20" alt="==>">
81 <a href="../images/red-ball.png"><img src="../images/red-ball.png" width="70" height="70" alt="red ball"></a>
84 <p>You can find additional examples of using <code>composite</code> in <a href="http://www.imagemagick.org/Usage/">Examples of ImageMagick Usage</a>. You can find out more about them and the mathematics by looking at <a href="http://www.w3.org/TR/SVG12/rendering.html">SVG Alpha Compositing</a></p>
86 <h2 class="magick-header"><a id="options"></a>Option Summary</h2>
88 <p>The <code>composite</code> command recognizes these options. Click on an option to get more details about how that option works.</p>
90 <table class="table table-condensed table-striped">
93 <th align="left">Option</th>
94 <th align="left">Description</th>
98 <td><a href="command-line-options.html#affine">-affine <var>matrix</var></a></td>
99 <td>affine transform matrix</td>
103 <td><a href="command-line-options.html#alpha">-alpha</a></td>
104 <td>on, activate, off, deactivate, set, opaque, copy",
105 transparent, extract, background, or shape the alpha channel</td>
109 <td><a href="command-line-options.html#authenticate">-authenticate <var>value</var></a></td>
110 <td>decrypt image with this password</td>
114 <td><a href="command-line-options.html#blend">-blend <var>geometry</var></a></td>
115 <td>blend images</td>
119 <td><a href="command-line-options.html#blue-primary">-blue-primary <var>point</var></a></td>
120 <td>chromaticity blue primary point</td>
125 <td><a href="command-line-options.html#border">-border <var>geometry</var></a></td>
126 <td>surround image with a border of color</td>
130 <td><a href="command-line-options.html#bordercolor">-bordercolor <var>color</var></a></td>
131 <td>border color</td>
135 <td><a href="command-line-options.html#channel">-channel <var>type</var></a></td>
136 <td>apply option to select image channels</td>
140 <td><a href="command-line-options.html#colors">-colors <var>value</var></a></td>
141 <td>preferred number of colors in the image</td>
145 <td><a href="command-line-options.html#colorspace">-colorspace <var>type</var></a></td>
146 <td>set image colorspace</td>
150 <td><a href="command-line-options.html#comment">-comment <var>string</var></a></td>
151 <td>annotate image with comment</td>
155 <td><a href="command-line-options.html#compose">-compose <var>operator</var></a></td>
156 <td>set image composite operator</td>
160 <td><a href="command-line-options.html#compress">-compress <var>type</var></a></td>
161 <td>image compression type</td>
165 <td><a href="command-line-options.html#debug">-debug <var>events</var></a></td>
166 <td>display copious debugging information</td>
170 <td><a href="command-line-options.html#decipher">-decipher <var>filename</var></a></td>
171 <td>convert cipher pixels to plain</td>
175 <td><a href="command-line-options.html#define">-define <var>format:option</var></a></td>
176 <td>define one or more image format options</td>
180 <td><a href="command-line-options.html#density">-density <var>geometry</var></a></td>
181 <td>horizontal and vertical density of the image</td>
185 <td><a href="command-line-options.html#depth">-depth <var>value</var></a></td>
190 <td><a href="command-line-options.html#displace">-displace <var>geometry</var></a></td>
191 <td>shift image pixels defined by a displacement map</td>
195 <td><a href="command-line-options.html#dissolve">-dissolve <var>value</var></a></td>
196 <td>dissolve the two images a given percent</td>
200 <td><a href="command-line-options.html#dither">-dither <var>method</var></a></td>
201 <td>apply error diffusion to image</td>
205 <td><a href="command-line-options.html#encipher">-encipher <var>filename</var></a></td>
206 <td>convert plain pixels to cipher pixels</td>
210 <td><a href="command-line-options.html#encoding">-encoding <var>type</var></a></td>
211 <td>text encoding type</td>
215 <td><a href="command-line-options.html#endian">-endian <var>type</var></a></td>
216 <td>endianness (MSB or LSB) of the image</td>
220 <td><a href="command-line-options.html#extract">-extract <var>geometry</var></a></td>
221 <td>extract area from image</td>
225 <td><a href="command-line-options.html#filter">-filter <var>type</var></a></td>
226 <td>use this filter when resizing an image</td>
230 <td><a href="command-line-options.html#font">-font <var>name</var></a></td>
231 <td>render text with this font</td>
235 <td><a href="command-line-options.html#geometry">-geometry <var>geometry</var></a></td>
236 <td>preferred size or location of the image</td>
240 <td><a href="command-line-options.html#gravity">-gravity <var>type</var></a></td>
241 <td>horizontal and vertical text placement</td>
245 <td><a href="command-line-options.html#green-primary">-green-primary <var>point</var></a></td>
246 <td>chromaticity green primary point</td>
250 <td><a href="command-line-options.html#help">-help</a></td>
251 <td>print program options</td>
255 <td><a href="command-line-options.html#identify">-identify</a></td>
256 <td>identify the format and characteristics of the image</td>
260 <td><a href="command-line-options.html#interlace">-interlace <var>type</var></a></td>
261 <td>type of image interlacing scheme</td>
265 <td><a href="command-line-options.html#interpolate">-interpolate <var>method</var></a></td>
266 <td>pixel color interpolation method</td>
270 <td><a href="command-line-options.html#label">-label <var>string</var></a></td>
271 <td>assign a label to an image</td>
275 <td><a href="command-line-options.html#level">-level <var>value</var></a></td>
276 <td>adjust the level of image contrast</td>
280 <td><a href="command-line-options.html#limit">-limit <var>type value</var></a></td>
281 <td>pixel cache resource limit</td>
285 <td><a href="command-line-options.html#log">-log <var>format</var></a></td>
286 <td>format of debugging information</td>
290 <td><a href="command-line-options.html#monitor">-monitor</a></td>
291 <td>monitor progress</td>
295 <td><a href="command-line-options.html#monochrome">-monochrome</a></td>
296 <td>transform image to black and white</td>
300 <td><a href="command-line-options.html#negate">-negate</a></td>
301 <td>replace each pixel with its complementary color </td>
305 <td><a href="command-line-options.html#page">-page <var>geometry</var></a></td>
306 <td>size and location of an image canvas (setting)</td>
310 <td><a href="command-line-options.html#pointsize">-pointsize <var>value</var></a></td>
311 <td>font point size</td>
315 <td><a href="command-line-options.html#profile">-profile <var>filename</var></a></td>
316 <td>add, delete, or apply an image profile</td>
320 <td><a href="command-line-options.html#quality">-quality <var>value</var></a></td>
321 <td>JPEG/MIFF/PNG compression level</td>
325 <td><a href="command-line-options.html#quantize">-quantize <var>colorspace</var></a></td>
326 <td>reduce image colors in this colorspace</td>
330 <td><a href="command-line-options.html#quiet">-quiet</a></td>
331 <td>suppress all warning messages</td>
335 <td><a href="command-line-options.html#red-primary">-red-primary <var>point</var></a></td>
336 <td>chromaticity red primary point</td>
340 <td><a href="command-line-options.html#regard-warnings">-regard-warnings</a></td>
341 <td>pay attention to warning messages.</td>
345 <td><a href="command-line-options.html#respect-parentheses">-respect-parentheses</a></td>
346 <td>settings remain in effect until parenthesis boundary.</td>
350 <td><a href="command-line-options.html#rotate">-rotate <var>degrees</var></a></td>
351 <td>apply Paeth rotation to the image</td>
355 <td><a href="command-line-options.html#sampling-factor">-sampling-factor <var>geometry</var></a></td>
356 <td>horizontal and vertical sampling factor</td>
360 <td><a href="command-line-options.html#scene">-scene <var>value</var></a></td>
361 <td>image scene number</td>
365 <td><a href="command-line-options.html#seed">-seed <var>value</var></a></td>
366 <td>seed a new sequence of pseudo-random numbers</td>
370 <td><a href="command-line-options.html#set">-set <var>attribute value</var></a></td>
371 <td>set an image attribute</td>
375 <td><a href="command-line-options.html#sharpen">-sharpen <var>geometry</var></a></td>
376 <td>sharpen the image</td>
380 <td><a href="command-line-options.html#shave">-shave <var>geometry</var></a></td>
381 <td>shave pixels from the image edges</td>
385 <td><a href="command-line-options.html#size">-size <var>geometry</var></a></td>
386 <td>width and height of image</td>
390 <td><a href="command-line-options.html#stegano">-stegano <var>offset</var></a></td>
391 <td>hide watermark within an image</td>
395 <td><a href="command-line-options.html#stereo">-stereo <var>geometry</var></a></td>
396 <td>combine two image to create a stereo anaglyph</td>
400 <td><a href="command-line-options.html#strip">-strip</a></td>
401 <td>strip image of all profiles and comments</td>
405 <td><a href="command-line-options.html#swap">-swap <var>indexes</var></a></td>
406 <td>swap two images in the image sequence</td>
410 <td><a href="command-line-options.html#synchronize">-synchronize</a></td>
411 <td>synchronize image to storage device</td>
415 <td><a href="command-line-options.html#taint">-taint</a></td>
416 <td>mark the image as modified</td>
420 <td><a href="command-line-options.html#thumbnail">-thumbnail <var>geometry</var></a></td>
421 <td>create a thumbnail of the image</td>
425 <td><a href="command-line-options.html#tile">-tile</a></td>
426 <td>repeat composite operation across and down image</td>
430 <td><a href="command-line-options.html#transform">-transform</a></td>
431 <td>affine transform image</td>
435 <td><a href="command-line-options.html#transparent-color">-transparent-color <var>color</var></a></td>
436 <td>transparent color</td>
440 <td><a href="command-line-options.html#treedepth">-treedepth <var>value</var></a></td>
441 <td>color tree depth</td>
445 <td><a href="command-line-options.html#type">-type <var>type</var></a></td>
450 <td><a href="command-line-options.html#units">-units <var>type</var></a></td>
451 <td>the units of image resolution</td>
455 <td><a href="command-line-options.html#unsharp">-unsharp <var>geometry</var></a></td>
456 <td>sharpen the image</td>
460 <td><a href="command-line-options.html#verbose">-verbose</a></td>
461 <td>print detailed information about the image</td>
465 <td><a href="command-line-options.html#version">-version</a></td>
466 <td>print version information</td>
470 <td><a href="command-line-options.html#virtual-pixel">-virtual-pixel <var>method</var></a></td>
471 <td>access method for pixels outside the boundaries of the image</td>
475 <td><a href="command-line-options.html#watermark">-watermark <var>geometry</var></a></td>
476 <td>percent brightness and saturation of a watermark</td>
480 <td><a href="command-line-options.html#white-point">-white-point <var>point</var></a></td>
481 <td>chromaticity white point</td>
485 <td><a href="command-line-options.html#white-threshold">-white-threshold <var>value</var></a></td>
486 <td>force all pixels above the threshold into white</td>
490 <td><a href="command-line-options.html#write">-write <var>filename</var></a></td>
491 <td>write images to this file</td>
497 <footer class="magick-footer">
498 <p><a href="support.html">Donate</a> •
499 <a href="sitemap.html">Sitemap</a> •
500 <a href="links.html">Related</a> •
501 <a href="architecture.html">Architecture</a>
503 <p><a href="composite.html#">Back to top</a> •
504 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> •
505 <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p>
506 <p><small>© 1999-2015 ImageMagick Studio LLC</small></p>
508 </div><!-- /.container -->
510 <script src="http://nextgen.imagemagick.org/js/magick.html"></script>