location of composited image

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: location of composited image

Post by Bonzo »

An example of what you are already using would help :)

You can position items with -gravity center etc. and -geometry +0+0
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: location of composited image

Post by anthony »

Thier are two ways of positionig images you want to overlay within ImageMagick.

using direct alpha composition you would use a -geometry offset and -gravity to sepecify to what corner or edge (or center) that offset is from. This is used by the "composite" command and the -composite operator in "convert"

The other method is to set the position of images in terms of 'layer' offsets also known as -page offsets (due to historical reasons) or virtual canvas offsets (a descriptive terminology). These are NOT graivity effected, but positions the images top left corner relative to a 'virtual origin'. The 'layer' images are then -flatten -mosiac or -layer merged together (the difference between these operators is in the size (and layer offset) of the final image.

For a discussion of the two methods see
Composite Geometry vs Layer Offsets
http://www.imagemagick.org/Usage/compose/#geometry

Examples of all the methods of multiple image handling is in IM examples section
Layering Multiple Images
http://www.imagemagick.org/Usage/layers/

which method is best generally depend on how the images are being generated. If just read in 'alpha composition' is best. if images are being distorted or aligned, or there are many images involved then 'Image layering' is usually best.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply