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