montage tiles by column 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
mese79
Posts: 1
Joined: 2011-01-01T15:31:27-07:00
Authentication code: 8675308

montage tiles by column order

Post by mese79 »

Hi
i have thousands of small tile images and i want to merge them into a big image.
My tile file names ordered by column not row. i mean like pic_x_y.png (i.e. pic_01_01.png, pic01_02.png, pic01_03.png...pic02_01.png, pic02_02.png...)
But AFAIK 'montage' command do montage by row order. so is there any option or command to do it by column order ?
thanks
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: montage tiles by column order

Post by fmw42 »

You can write a script to append by column, do as many columns as you need, then append the columns by row. See -append for columns and +append for rows.

The other way is to transpose each image, montage them, then transpose the result. For example:

convert checks.png lena2.jpg hatching.jpg zelda3.jpg -transpose miff:- | montage - -geometry +2+2 -tile 2x2 miff:- | convert - -transpose test2.jpg
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: montage tiles by column order

Post by anthony »

Using two montage's will avoid the need for transposing...

The first montage creates columns, and sets tile size, frames etc. The second just contatanates into pages (number of columns).
In this case a 5x4 montage...

Code: Select all

montage -label %f im/img_photos/*_orig.jpg -geometry 120x120+2+2 -frame 5 -tile 1x4 miff:- |\
    montage - -geometry +0+0 -tile 5x1   montage_columns.jpg
If only one image of variable number of columns is wanted replace the second montage wit ha convert append.

Code: Select all

montage -label %f im/img_photos/*_orig.jpg -geometry 120x120+2+2 -frame 5 -tile 1x4 miff:- |\
  convert - +append montage_columns_2.jpg
I am adding this to IM Examples, Montage, Montage into Columns
http://www.imagemagick.org/Usage/montage/#columns
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply