composite.html revision 82a2ff27ee83c3408dce06c0f129386bd13eb17f
1<!DOCTYPE html>
2<html lang="en">
3<head>
4  <meta charset="utf-8">
5  <meta http-equiv="X-UA-Compatible" content="IE=edge">
6  <meta name="viewport" content="width=device-width, initial-scale=1">
7  <title>ImageMagick: Command-line Tools: Composite</title>
8  <meta http-equiv="content-language" content="en-US">
9  <meta http-equiv="content-type" content="text/html; charset=utf-8">
10  <meta http-equiv="reply-to" content="magick-users@imagemagick.org">
11  <meta name="application-name" content="ImageMagick">
12  <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.">
13  <meta name="application-url" content="http://www.imagemagick.org">
14  <meta name="generator" content="PHP">
15  <meta name="keywords" content="command-line, tools:, composite, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert">
16  <meta name="rating" content="GENERAL">
17  <meta name="robots" content="INDEX, FOLLOW">
18  <meta name="generator" content="ImageMagick Studio LLC">
19  <meta name="author" content="ImageMagick Studio LLC">
20  <meta name="revisit-after" content="2 DAYS">
21  <meta name="resource-type" content="document">
22  <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC">
23  <meta name="distribution" content="Global">
24  <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1">
25  <link rel="icon" href="/images/wand.png">
26  <link rel="shortcut icon" href="/images/wand.ico" type="images/x-icon">
27  <link rel="stylesheet" href="css/bootstrap.min.css">
28  <link rel="stylesheet" href="css/magick.css">
29</head>
30
31<body>
32<div class="main">
33<div class="magick-masthead">
34  <div class="container">
35    <script type="text/javascript">
36    <!--
37      google_ad_client = "pub-3129977114552745";
38      google_ad_slot = "5439289906";
39      google_ad_width = 728;
40      google_ad_height = 90;
41    //-->
42    </script>
43    <center><script type="text/javascript" src="http://localhost/pagead/show_ads.js">
44    </script></center>
45    <nav class="magick-nav">
46      <a class="magick-nav-item " href="/index.html">Home</a>
47      <a class="magick-nav-item " href="binary-releases.html">Downloads</a>
48      <a class="magick-nav-item " href="command-line-tools.html">Tools</a>
49      <a class="magick-nav-item " href="command-line-options.html">Options</a>
50      <a class="magick-nav-item " href="api.html">Development</a>
51      <a class="magick-nav-item" href="http://www.imagemagick.org/discourse-server/">Community</a>
52      <a class="magick-nav-item pull-right " href="http://www.imagemagick.org/script/search.php">Search</a>
53    </nav>
54  </div>
55</div>
56<div class="container">
57<div class="magick-header">
58<p class="text-center"><a href="composite.html#usage">Example Usage</a> • <a href="composite.html#options">Option Summary</a></p>
59
60<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>
61
62<h2 class="magick-header"><a id="usage"></a>Example Usage</h2>
63
64<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>
65
66<pre>
67composite -gravity center smile.gif  rose: rose-over.png
68</pre>
69
70<ul>
71  <a href="/images/smile.gif"><img src="/images/smile.gif" width="48" height="48" alt="smile"></a>
72  <img src="/images/over.gif" width="56" height="46" alt="over">
73  <a href="/images/rose.jpg"><img src="/images/rose.jpg" width="70" height="46" alt="rose"></a>
74  <img style="margin-top:13px; margin-bottom:13px;" src="/images/right.gif" width="20" height="20" alt="==&gt;">
75  <a href="/images/rose-over.png"><img src="/images/rose-over.png" width="70" height="46" alt="rose"></a>
76</ul>
77
78<p>You can create three-dimensional effect with the <var>Atop</var>:</p>
79
80<pre>
81convert -size 70x70 canvas:none -fill red -draw 'circle 35,35 10,30' red-circle.png
82convert -size 70x70 canvas:none -draw 'circle 35,35 35,20' -negate \
83-channel A -gaussian-blur 0x8 white-highlight.png
84composite -compose atop -geometry -13-17 white-highlight.png red-circle.png red-ball.png
85</pre>
86
87<ul>
88  <a href="/images/white-highlight.png"><img src="/images/white-highlight.png" width="70" height="70" alt="white highlight"></a>
89  <img src="/images/atop.gif" width="56" height="70" alt="atop">
90  <a href="/images/red-circle.png"><img src="/images/red-circle.png" width="70" height="70" alt="red circle"></a>
91  <img style="margin-top:25px; margin-bottom:25px;" src="/images/right.gif" width="20" height="20" alt="==&gt;">
92  <a href="/images/red-ball.png"><img src="/images/red-ball.png" width="70" height="70" alt="red ball"></a>
93</ul>
94
95<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>
96
97<h2 class="magick-header"><a id="options"></a>Option Summary</h2>
98
99<p>The <code>composite</code> command recognizes these options.  Click on an option to get more details about how that option works.</p>
100
101<table class="table table-condensed table-striped">
102  <tbody>
103  <tr>
104    <th align="left">Option</th>
105    <th align="left">Description</th>
106  </tr>
107
108  <tr>
109    <td><a href="command-line-options.html#affine">-affine <var>matrix</var></a></td>
110    <td>affine transform matrix</td>
111  </tr>
112
113  <tr>
114    <td><a href="command-line-options.html#alpha">-alpha</a></td>
115    <td>on, activate, off, deactivate, set, opaque, copy",
116transparent, extract, background, or shape the alpha channel</td>
117  </tr>
118
119  <tr>
120    <td><a href="command-line-options.html#authenticate">-authenticate <var>value</var></a></td>
121    <td>decrypt image with this password</td>
122  </tr>
123
124  <tr>
125    <td><a href="command-line-options.html#blend">-blend <var>geometry</var></a></td>
126    <td>blend images</td>
127  </tr>
128
129  <tr>
130    <td><a href="command-line-options.html#blue-primary">-blue-primary <var>point</var></a></td>
131    <td>chromaticity blue primary point</td>
132  </tr>
133
134
135  <tr>
136    <td><a href="command-line-options.html#border">-border <var>geometry</var></a></td>
137    <td>surround image with a border of color</td>
138  </tr>
139
140  <tr>
141    <td><a href="command-line-options.html#bordercolor">-bordercolor <var>color</var></a></td>
142    <td>border color</td>
143  </tr>
144
145  <tr>
146    <td><a href="command-line-options.html#channel">-channel <var>type</var></a></td>
147    <td>apply option to select image channels</td>
148  </tr>
149
150  <tr>
151    <td><a href="command-line-options.html#colors">-colors <var>value</var></a></td>
152    <td>preferred number of colors in the image</td>
153  </tr>
154
155  <tr>
156    <td><a href="command-line-options.html#colorspace">-colorspace <var>type</var></a></td>
157    <td>set image colorspace</td>
158  </tr>
159
160  <tr>
161    <td><a href="command-line-options.html#comment">-comment <var>string</var></a></td>
162    <td>annotate image with comment</td>
163  </tr>
164
165  <tr>
166    <td><a href="command-line-options.html#compose">-compose <var>operator</var></a></td>
167    <td>set image composite operator</td>
168  </tr>
169
170  <tr>
171    <td><a href="command-line-options.html#compress">-compress <var>type</var></a></td>
172    <td>image compression type</td>
173  </tr>
174
175  <tr>
176    <td><a href="command-line-options.html#debug">-debug <var>events</var></a></td>
177    <td>display copious debugging information</td>
178  </tr>
179
180  <tr>
181    <td><a href="command-line-options.html#decipher">-decipher <var>filename</var></a></td>
182    <td>convert cipher pixels to plain</td>
183  </tr>
184
185  <tr>
186    <td><a href="command-line-options.html#define">-define <var>format:option</var></a></td>
187    <td>define one or more image format options</td>
188  </tr>
189
190  <tr>
191    <td><a href="command-line-options.html#density">-density <var>geometry</var></a></td>
192    <td>horizontal and vertical density of the image</td>
193  </tr>
194
195  <tr>
196    <td><a href="command-line-options.html#depth">-depth <var>value</var></a></td>
197    <td>image depth</td>
198  </tr>
199
200  <tr>
201    <td><a href="command-line-options.html#displace">-displace <var>geometry</var></a></td>
202    <td>shift image pixels defined by a displacement map</td>
203  </tr>
204
205  <tr>
206    <td><a href="command-line-options.html#dissolve">-dissolve <var>value</var></a></td>
207    <td>dissolve the two images a given percent</td>
208  </tr>
209
210  <tr>
211    <td><a href="command-line-options.html#dither">-dither  <var>method</var></a></td>
212    <td>apply error diffusion to image</td>
213  </tr>
214
215  <tr>
216    <td><a href="command-line-options.html#encipher">-encipher <var>filename</var></a></td>
217    <td>convert plain pixels to cipher pixels</td>
218  </tr>
219
220  <tr>
221    <td><a href="command-line-options.html#encoding">-encoding <var>type</var></a></td>
222    <td>text encoding type</td>
223  </tr>
224
225  <tr>
226    <td><a href="command-line-options.html#endian">-endian <var>type</var></a></td>
227    <td>endianness (MSB or LSB) of the image</td>
228  </tr>
229
230  <tr>
231    <td><a href="command-line-options.html#extract">-extract <var>geometry</var></a></td>
232    <td>extract area from image</td>
233  </tr>
234
235  <tr>
236    <td><a href="command-line-options.html#filter">-filter <var>type</var></a></td>
237    <td>use this filter when resizing an image</td>
238  </tr>
239
240  <tr>
241    <td><a href="command-line-options.html#font">-font <var>name</var></a></td>
242    <td>render text with this font</td>
243  </tr>
244
245  <tr>
246    <td><a href="command-line-options.html#geometry">-geometry <var>geometry</var></a></td>
247    <td>preferred size or location of the image</td>
248  </tr>
249
250  <tr>
251    <td><a href="command-line-options.html#gravity">-gravity <var>type</var></a></td>
252    <td>horizontal and vertical text placement</td>
253  </tr>
254
255  <tr>
256    <td><a href="command-line-options.html#green-primary">-green-primary <var>point</var></a></td>
257    <td>chromaticity green primary point</td>
258  </tr>
259
260  <tr>
261    <td><a href="command-line-options.html#help">-help</a></td>
262    <td>print program options</td>
263  </tr>
264
265  <tr>
266    <td><a href="command-line-options.html#identify">-identify</a></td>
267    <td>identify the format and characteristics of the image</td>
268  </tr>
269
270  <tr>
271    <td><a href="command-line-options.html#interlace">-interlace <var>type</var></a></td>
272    <td>type of image interlacing scheme</td>
273  </tr>
274
275  <tr>
276    <td><a href="command-line-options.html#interpolate">-interpolate <var>method</var></a></td>
277    <td>pixel color interpolation method</td>
278  </tr>
279
280  <tr>
281    <td><a href="command-line-options.html#label">-label <var>string</var></a></td>
282    <td>assign a label to an image</td>
283  </tr>
284
285  <tr>
286    <td><a href="command-line-options.html#level">-level <var>value</var></a></td>
287    <td>adjust the level of image contrast</td>
288  </tr>
289
290  <tr>
291    <td><a href="command-line-options.html#limit">-limit <var>type value</var></a></td>
292    <td>pixel cache resource limit</td>
293  </tr>
294
295  <tr>
296    <td><a href="command-line-options.html#log">-log <var>format</var></a></td>
297    <td>format of debugging information</td>
298  </tr>
299
300  <tr>
301    <td><a href="command-line-options.html#monitor">-monitor</a></td>
302    <td>monitor progress</td>
303  </tr>
304
305  <tr>
306    <td><a href="command-line-options.html#monochrome">-monochrome</a></td>
307    <td>transform image to black and white</td>
308  </tr>
309
310  <tr>
311    <td><a href="command-line-options.html#negate">-negate</a></td>
312    <td>replace each pixel with its complementary color </td>
313  </tr>
314
315  <tr>
316    <td><a href="command-line-options.html#page">-page <var>geometry</var></a></td>
317    <td>size and location of an image canvas (setting)</td>
318  </tr>
319
320  <tr>
321    <td><a href="command-line-options.html#pointsize">-pointsize <var>value</var></a></td>
322    <td>font point size</td>
323  </tr>
324
325  <tr>
326    <td><a href="command-line-options.html#profile">-profile <var>filename</var></a></td>
327    <td>add, delete, or apply an image profile</td>
328  </tr>
329
330  <tr>
331    <td><a href="command-line-options.html#quality">-quality <var>value</var></a></td>
332    <td>JPEG/MIFF/PNG compression level</td>
333  </tr>
334
335  <tr>
336    <td><a href="command-line-options.html#quantize">-quantize <var>colorspace</var></a></td>
337    <td>reduce image colors in this colorspace</td>
338  </tr>
339
340  <tr>
341    <td><a href="command-line-options.html#quiet">-quiet</a></td>
342    <td>suppress all warning messages</td>
343  </tr>
344
345  <tr>
346    <td><a href="command-line-options.html#red-primary">-red-primary <var>point</var></a></td>
347    <td>chromaticity red primary point</td>
348  </tr>
349
350  <tr>
351    <td><a href="command-line-options.html#regard-warnings">-regard-warnings</a></td>
352    <td>pay attention to warning messages.</td>
353  </tr>
354
355  <tr>
356    <td><a href="command-line-options.html#respect-parentheses">-respect-parentheses</a></td>
357    <td>settings remain in effect until parenthesis boundary.</td>
358  </tr>
359
360  <tr>
361    <td><a href="command-line-options.html#rotate">-rotate <var>degrees</var></a></td>
362    <td>apply Paeth rotation to the image</td>
363  </tr>
364
365  <tr>
366    <td><a href="command-line-options.html#sampling-factor">-sampling-factor <var>geometry</var></a></td>
367    <td>horizontal and vertical sampling factor</td>
368  </tr>
369
370  <tr>
371    <td><a href="command-line-options.html#scene">-scene <var>value</var></a></td>
372    <td>image scene number</td>
373  </tr>
374
375  <tr>
376    <td><a href="command-line-options.html#seed">-seed <var>value</var></a></td>
377    <td>seed a new sequence of pseudo-random numbers</td>
378  </tr>
379
380  <tr>
381    <td><a href="command-line-options.html#set">-set <var>attribute value</var></a></td>
382    <td>set an image attribute</td>
383  </tr>
384
385  <tr>
386    <td><a href="command-line-options.html#sharpen">-sharpen <var>geometry</var></a></td>
387    <td>sharpen the image</td>
388  </tr>
389
390  <tr>
391    <td><a href="command-line-options.html#shave">-shave <var>geometry</var></a></td>
392    <td>shave pixels from the image edges</td>
393  </tr>
394
395  <tr>
396    <td><a href="command-line-options.html#size">-size <var>geometry</var></a></td>
397    <td>width and height of image</td>
398  </tr>
399
400  <tr>
401    <td><a href="command-line-options.html#stegano">-stegano <var>offset</var></a></td>
402    <td>hide watermark within an image</td>
403  </tr>
404
405  <tr>
406    <td><a href="command-line-options.html#stereo">-stereo <var>geometry</var></a></td>
407    <td>combine two image to create a stereo anaglyph</td>
408  </tr>
409
410  <tr>
411    <td><a href="command-line-options.html#strip">-strip</a></td>
412    <td>strip image of all profiles and comments</td>
413  </tr>
414
415  <tr>
416    <td><a href="command-line-options.html#swap">-swap <var>indexes</var></a></td>
417    <td>swap two images in the image sequence</td>
418  </tr>
419
420  <tr>
421    <td><a href="command-line-options.html#synchronize">-synchronize</a></td>
422    <td>synchronize image to storage device</td>
423  </tr>
424
425  <tr>
426    <td><a href="command-line-options.html#taint">-taint</a></td>
427    <td>mark the image as modified</td>
428  </tr>
429
430  <tr>
431    <td><a href="command-line-options.html#thumbnail">-thumbnail <var>geometry</var></a></td>
432    <td>create a thumbnail of the image</td>
433  </tr>
434
435  <tr>
436    <td><a href="command-line-options.html#tile">-tile</a></td>
437    <td>repeat composite operation across and down image</td>
438  </tr>
439
440  <tr>
441    <td><a href="command-line-options.html#transform">-transform</a></td>
442    <td>affine transform image</td>
443  </tr>
444
445  <tr>
446    <td><a href="command-line-options.html#transparent-color">-transparent-color <var>color</var></a></td>
447    <td>transparent color</td>
448  </tr>
449
450  <tr>
451    <td><a href="command-line-options.html#treedepth">-treedepth <var>value</var></a></td>
452    <td>color tree depth</td>
453  </tr>
454
455  <tr>
456    <td><a href="command-line-options.html#type">-type <var>type</var></a></td>
457    <td>image type</td>
458  </tr>
459
460  <tr>
461    <td><a href="command-line-options.html#units">-units <var>type</var></a></td>
462    <td>the units of image resolution</td>
463  </tr>
464
465  <tr>
466    <td><a href="command-line-options.html#unsharp">-unsharp <var>geometry</var></a></td>
467    <td>sharpen the image</td>
468  </tr>
469
470  <tr>
471    <td><a href="command-line-options.html#verbose">-verbose</a></td>
472    <td>print detailed information about the image</td>
473  </tr>
474
475  <tr>
476    <td><a href="command-line-options.html#version">-version</a></td>
477    <td>print version information</td>
478  </tr>
479
480  <tr>
481    <td><a href="command-line-options.html#virtual-pixel">-virtual-pixel <var>method</var></a></td>
482    <td>access method for pixels outside the boundaries of the image</td>
483  </tr>
484
485  <tr>
486    <td><a href="command-line-options.html#watermark">-watermark <var>geometry</var></a></td>
487    <td>percent brightness and saturation of a watermark</td>
488  </tr>
489
490  <tr>
491    <td><a href="command-line-options.html#white-point">-white-point <var>point</var></a></td>
492    <td>chromaticity white point</td>
493  </tr>
494
495  <tr>
496    <td><a href="command-line-options.html#white-threshold">-white-threshold <var>value</var></a></td>
497    <td>force all pixels above the threshold into white</td>
498  </tr>
499
500  <tr>
501    <td><a href="command-line-options.html#write">-write <var>filename</var></a></td>
502    <td>write images to this file</td>
503  </tr>
504
505  </tbody>
506</table>
507</div>
508  <footer class="magick-footer">
509    <div class="magick-nav-item pull-left">
510      <a href="support.html">Donate</a>
511    </div>
512    <p><a href="sitemap.html">Sitemap</a> •
513    <a href="links.html">Related</a> •
514    <a href="http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi">Image Studio</a> •
515    <a href="http://jqmagick.imagemagick.org/">JqMagick</a> •
516    <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a>
517</p>
518    <p><a href="composite.html#">Back to top</a> •
519    <a href="http://www.imagemagick.org/script/contact.php">Contact Us</a></p>
520    <p class="small">©  1999-2015 ImageMagick Studio LLC</p>
521  </footer>
522</div><!-- /.container -->
523
524  <script src="https://localhost/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
525  <script src="/js/bootstrap.min.js"></script>
526  <script type="text/javascript">
527    /* <![CDATA[ */
528    (function() {
529        var s = document.createElement('offline-script'), t = document.getElementsByTagName('offline-script')[0];
530        s.type = 'text/javascript';
531        s.async = true;
532        s.src = 'http://api.flattr.com/js/0.6/load.js?mode=auto';
533        t.parentNode.insertBefore(s, t);
534    })();
535    /* ]]> */
536  </script>
537</div>
538</body>
539</html>
540