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?
resize & append
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: resize & append
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