Page 1 of 1

Re: flatten and resize

Posted: 2008-09-30T18:32:50-07:00
by fmw42
-size is for creating images, you need -resize

see
http://www.imagemagick.org/script/comma ... php#resize
http://www.imagemagick.org/Usage/resize/

convert \( image1 -resize ... \) \( image2 -resize ... \) -flatten output

Re: flatten and resize

Posted: 2008-09-30T18:40:09-07:00
by anthony
-size has a side effect with JPEG reading to get the library to reduce the amount of image reading an processing it does. For Image file formats it only effects JPEG. (ASIDE: -page effects postscript, PDF and text generated images).

However -size with JPEG does not resize the image to the size given, instead it reads enough to generate an image of aleast that size. As such a -size 200x100 photo.jpg will return an image that is at least 200x100 pixels (if posible) but more likely to be larger.

See IM Examples, JPEG reading controls...
http://www.imagemagick.org/Usage/formats/#jpg_read
And Thumbnails, JPEG Handling...
http://www.imagemagick.org/Usage/thumbnails/#profiles
And Montage Image Indexs...
http://www.imagemagick.org/Usage/montage/#index

So what you want is a -size about double the final size, while reading in images, then a -resize (with appropriate flags) to resize the images to fit the 'box size' specified.