Montage problems

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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Montage problems

Post by fmw42 »

MatStyle wrote:Hi,

I try to make an image montage with IM. So I want to set 4 pictures (PNG) in one picture:

pic1.png pic2.png pic3.png pic4.png -mode Concatenate -tile x1 montage.png

There are two issues:

- I want to have overlapped images (left part of the next picture on the right part of the last picture). So I use "-geometry -100+0". The first usage (pic 2 on pic 1) is fine. But the next overlappings (pic 3 on pic 2 and pic 4 on pic 3) have much more distance!?
- The source PNG files have transparency. But with the montage action the transparency in the montage picture get's lost and it has white background.

Thank you very much for any ideas.

Best regards

Mat Weber
see montage command http://www.imagemagick.org/Usage/montage/
or convert or composite commands http://www.imagemagick.org/Usage/layers/

to get transparency add -channel rgba -alpha on
see http://www.imagemagick.org/Usage/channels/ and http://www.imagemagick.org/Usage/basics/#alpha
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Montage problems

Post by anthony »

The use of negative geometry to overlay images was not designed into montage, it was just an accident that to was found to be useful.

However when you use negatives the canvas size montage generated is too small.
To correct this ad a 'null:' image to the start and end of the montage image sequence. You can trim the resulting image later.


A better way to do this may be to DIY the image placement yourself. See
http://www.imagemagick.org/Usage/layers/#example
for a couple of techniques to do this, including a programing placement technique.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply