composite multiple images with different size

Help
Jochen
2012-07-10
2013-03-27
  • Jochen

    Jochen - 2012-07-10

    Hi!

    I've a problem using graphicsmagick…

    I need to composite different images to one image. All orginal images are about 500x500.
    One way works perfekt, where the images have the same size in the target image:

    gm montage -tile 4x7 -geometry 200x200+0+0 image1 image2 … image28 targetimage

    My problem is, that I need to composite some images with different target sizes together. My first try was to use the -page option to give the images the absolute position in the target image:

    gm montage -page +0+0 image1 +400+0 image2 +600+0 image3 +400+200 image4 +600+200 image5 + 0+400 image6 … targetimage

    Can anybody help me with this topic?

    regards

    Jochen

     
  • Bob Friesenhahn

    Bob Friesenhahn - 2012-07-10

    I think that you are on the right track but should use 'convert' rather than 'montage' and should use the -mosaic option to perform the composition.

    Something like (untested)

      gm convert image1 -page 1000x1000+0+0 image2 +400+0 image3 +400+200 -mosaic targetimage

    -flatten can be used rather similar to -mosaic except that the first image then needs to be a canvas image to composite on.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks