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