Page 1 of 1
Montage with a fix size resulting image
Posted: 2014-01-21T17:00:09-07:00
by novito
Say I want to have a montage which size is 160x600. I have several images and I want to be able to put them there (resize if necessary) so that the resulting montage is 160x600.
Is there any way to specify the size of the montage? Or you can just specify the size of the tiles?
Thanks!
Re: Montage with a fix size resulting image
Posted: 2014-01-21T17:16:12-07:00
by snibgo
How about montaging them, and resizing at the end?
Re: Montage with a fix size resulting image
Posted: 2014-01-21T17:22:19-07:00
by novito
Let me clarify what I want and what I have:
I have:
- Set of N images with unknown width/height - I just know that width*height > 1200px
I need:
- A montage of 160x600 with the images of the above set on it (they can be repeated). So, if for example, the set of images height is small, the montage will have more rows.
I have thought on doing the following:
- Since we can set the size of the tile (for example, we can say that each tile is 40x100) we could do some maths and have:
Number of rows = 600/100 = 6 rows (we would need to take into account the margin between rows...)
Number of columns = 160/40 = 4 columns
However, if for example the images have a really short height, the rezing to 40x100 will mantain the aspect ratio, and therefore I would need more rows in order to fill up to 600px.
Any thoughts on how to do this?
Re: Montage with a fix size resulting image
Posted: 2014-01-21T19:45:46-07:00
by fmw42
The -tile argument sets the number of tiles horizontally and vertically.
see
http://www.imagemagick.org/Usage/montage/#settings
-tile {cols}x{rows}
The number of images across and down used to fill a single montage image. If more images were read in or created than fits in a single montage image, then multiple images will be created. (See Tile Controls above)
You can use the -geometry argument to resize the images (and spacing).
see linke above
-geometry {W}x{H}+{X}+{Y}
Resize images after they have all been read in before montage overlays them onto its canvas. It also defines the size and the spacing between the tiles into which the images are drawn. If no size is specified the images will not be resized.
But in the end, you may have to resize the output to get the size you want.
Re: Montage with a fix size resulting image
Posted: 2014-01-23T15:36:27-07:00
by novito
Thanks
