Montage tiling order

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
Grujah
Posts: 2
Joined: 2011-01-15T17:20:52-07:00
Authentication code: 8675308

Montage tiling order

Post by Grujah »

I have 54 images that I need to tile, 8 in a file, 2 rows with 4 images each. I did it this way:

Code: Select all

montage *.jpg \-geometry 750x1050>+0+0 \-tile 4x2 final.jpg
The problem is that in last "montaged" image, because there is only 6 images, it ends up with 4 images in 1st row and 2 images in 2nd row. I don't want that. I want 3 images in each row i.e. that when ImageMagick tiles, it goes by columns and not by rows. Is that doable?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Montage tiling order

Post by fmw42 »

to montage by columns first, see http://www.imagemagick.org/Usage/montage/#columns or (less efficient) http://www.fmwconcepts.com/imagemagick/ ... ntage_cols

If you have command on one line, then you don't need the two \ for line breaks. I presume this is an error in pasting your command. Or is it an escape for the minus sign (which should not be needed)?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Montage tiling order

Post by anthony »

Not by default.

What you can do is montage the images into a single image of two long rows -tile x2
You can then tile crop this into 4x2 images (when you have worked out the montage tile size)
http://www.imagemagick.org/Usage/crop/#crop_tile
The last image will be 3x2 images.

However the order of the images will be to put the first half of the images along the top row
and the second half along the bottom, without any regard for the division of the images.


Another alternative which was just worked out is presented in
http://www.imagemagick.org/Usage/montage/#columns

This montages the images into seperate columns (in your case pairing the images in columns of two)
You then use a second montage to collect the columns into lots of 4 and trim the unused columns from the
last image, OR just create again one long image (horizontal append) and tile crop this into sections.

Basically which method you use depends on how you want the images ordered in your results.
There are many ways of doing it, and in the future we may have a set of 'layout' operators that will make it easier.
In the mean time you will need to DIY it in some way.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Grujah
Posts: 2
Joined: 2011-01-15T17:20:52-07:00
Authentication code: 8675308

Re: Montage tiling order

Post by Grujah »

Yeah, I feel kind of a stupid, I just found the thread asking the same question on page 2. And I also missed that section in the guide. :oops:

I changed the script to

Code: Select all

montage *.jpg \-geometry 750x1050>+0+0 \-tile 1x2 final.jpg 
montage final*.jpg -geometry +0+0 -tile 4x1 final.jpg
and it works great.

(well, it leaves few unwanted images but that not really a problem).

Thanks!
Post Reply