1. Computing & Technology
Linux / Unix Command: composite
Command Library

NAME

composite - composite images together.  

SYNOPSIS

composite [ options ... ] image composite [ mask ] composited

 

DESCRIPTION

composite composite images to create new images. composite is the base image and image contains the changes. composited is the result, and normally has the same dimensions as composite.

The optional mask can be used to provide matte information for composite when it has none or if you want a different mask. A mask image is typically grayscale and the same size as composite. If mask is not grayscale, it is converted to grayscale and the resulting intensities are used as matte information.  

EXAMPLES

To composite an image of a cockatoo with a perch, use:


    composite cockatoo.miff perch.ras composite.miff

To compute the difference between images in a series, use:


    composite -compose difference series.2 series.1
              difference.miff

To composite an image of a cockatoo with a perch starting at location (100,150), use:


    composite -geometry +100+150 cockatoo.miff
              perch.ras composite.miff

To tile a logo across your image of a cockatoo, use


    convert +shade 30x60 cockatoo.miff mask.miff
    composite -compose bumpmap -tile logo.png
              cockatoo.miff mask.miff composite.miff

To composite a red, green, and blue color plane into a single composite image, try


    composite -compose CopyGreen green.png red.png
              red-green.png
    composite -compose CopyBlue blue.png red-green.png 
              composite.png  

OPTIONS

Options are processed in command line order. Any option you specify on the command line remains in effect only for the image that follows. All options are reset to their default values after each image is read.

For a more detailed description of each option, see ImageMagick(1).

-background <color>
the background color
-cache <threshold>
megabytes of memory available to the pixel cache
-colors <value>
preferred number of colors in the image
-colorspace <value>
the type of colorspace
-comment <string>
annotate an image with a comment
-compose <operator>
the type of image composition
-compress <type>
the type of image compression
-debug
enable debug printout
-density <width>x<height>
vertical and horizontal resolution in pixels of the image
-depth <value>
depth of the image
-displace <horizontal scale>x<vertical scale>
shift image pixels as defined by a displacement map
-display <host:display[.screen]>
specifies the X server to contact
-dispose <method>
GIF disposal method
-dissolve <percent>
dissolve an image into another by the given percent
-dither
apply Floyd/Steinberg error diffusion to the image
-encoding <type>
specify the font encoding
-endian <type>
specify endianness (MSB or LSB) of output image
-filter <type>
use this type of filter when resizing an image
-font <name>
use this font when annotating the image with text
-geometry <width>x<height>{+-}<x>{+-}<y>{%}{@} {!}{<}{>}
preferred size and location of the Image window.
-gravity <type>
direction primitive gravitates to when annotating the image.
-help
print usage instructions
-interlace <type>
the type of interlacing scheme
-label <name>
assign a label to an image
-matte
store matte channel if the image has one
-monochrome
transform the image to black and white
-negate
replace every pixel with its complementary color
-page <width>x<height>{+-}<x>{+-}<y>{%}{!}{<}{>}
size and location of an image canvas
-profile <filename>
add ICM, IPTC, or generic profile to image
-quality <value>
JPEG/MIFF/PNG compression level
-resize <width>x<height>{%}{@}{!}{<}{>}
resize an image
-rotate <degrees>{<}{>}
apply Paeth image rotation to the image
-sampling_factor <horizontal_factor>x<vertical_factor>
sampling factors used by JPEG or MPEG-2 encoder and YUV decoder/encoder.
-scene <value>
set scene number
-sharpen <radius>x<sigma>
sharpen the image
-size <width>x<height>{+offset}
width and height of the image
-stegano <offset>
hide watermark within an image
-stereo
composite two images to create a stereo anaglyph
-treedepth <value>
tree depth for the color reduction algorithm
-trim
trim an image
-type <type>
the image type
-units <type>
the type of image resolution
-unsharp <radius>x<sigma>
sharpen the image with an unsharp mask operator
-verbose
print detailed information about the image
-watermark <brightness>x<saturation>
percent brightness and saturation of a watermark
-write <filename>
write an image sequence [convert, composite]

For a more detailed description of each option, see ImageMagick(1).

 

SEE ALSO

animate(1), display(1), conjure(1), convert(1), identify(1), ImageMagick(1), import(1), mogrify(1), montage(1)

 


Important: Use the man command (% man) to see how a command is used on your particular computer.

>> Linux/Unix Command Library

>> Shell Command Library

Discuss in my forum

©2012 About.com. All rights reserved.

A part of The New York Times Company.