composite
combine images with blending and compositing operations
TLDR
Overlay one image on top of another
SYNOPSIS
composite [options] overlay background [mask] output
DESCRIPTION
composite is the ImageMagick tool for combining two or more images into a single image. It provides extensive compositing operations similar to layer blending in graphics editors, enabling complex image manipulation from the command line.
The overlay image is placed over the background image according to the specified compose method and positioning. An optional mask image can control which parts of the overlay affect the final result. Common operations include watermarking, creating image collages, and applying visual effects.
The gravity option provides convenient positioning (center, corners, edges) while geometry allows pixel-precise placement. Blend modes like multiply, screen, and overlay follow standard graphics compositing mathematics.
PARAMETERS
-compose METHOD
Compositing operator: over, multiply, screen, overlay, darken, lighten, etc.-geometry GEOMETRY
Position offset for overlay (+X+Y format).-gravity TYPE
Anchor point: center, north, south, east, west, northeast, etc.-blend GEOMETRY
Blend percentages for source and destination.-dissolve PERCENT
Dissolve overlay into background at specified percentage.-watermark BRIGHTNESS
Apply overlay as watermark with given brightness.-tile
Tile the overlay image across the background.-stegano OFFSET
Hide the overlay within the background image (steganography).-stereo OFFSET
Create a stereo anaglyph image.-density VALUE
Set image resolution.-quality VALUE
Output compression quality (0-100).
CAVEATS
Image order matters: overlay comes before background in the command. The output inherits dimensions from the background image by default. Alpha channels affect compositing; use -alpha options for explicit control. For batch operations, consider mogrify or magick for better performance.
HISTORY
composite is part of ImageMagick, originally created by John Cristy in 1990. It has evolved to support dozens of compositing operators, matching capabilities found in professional image editing software. The tool remains essential for scriptable image manipulation.
