Page 1 of 1

resize & append

Posted: 2011-10-28T04:11:18-07:00
by errx
I have first image with dimensions:30x40 and second 500x200

I want to append small image to the big one (using -append) but before appending I want to resize canvas (not image) of the small image to second image dimensions (500x200). Is it possible to do this with a single command?

Re: resize & append

Posted: 2011-10-28T09:25:21-07:00
by fmw42
errx wrote:I have first image with dimensions:30x40 and second 500x200

I want to append small image to the big one (using -append) but before appending I want to resize canvas (not image) of the small image to second image dimensions (500x200). Is it possible to do this with a single command?

Depends upon how you want it centered and what background color for the canvas. Here is one example

convert largeimage smallimage \
\( -clone 0 -fill white -colorize 100% \) \
\( -clone 2 -clone 1 -gravity center -compose over -composite \) \
-delete 1 -append resultimage

These are Unix command syntax. For windows see http://www.imagemagick.org/Usage/windows/

see
http://www.imagemagick.org/Usage/basics/#parenthesis
http://www.imagemagick.org/Usage/layers/#convert
http://www.imagemagick.org/Usage/canvas/#blank