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