Resize canvas to one side

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
opalepatrick
Posts: 2
Joined: 2012-11-04T10:20:15-07:00
Authentication code: 67789

Resize canvas to one side

Post by opalepatrick »

I tried this

Code: Select all

mogrify -path /canvassed/ -background black -gravity East -extent 602x400 -density 72x72 -quality 85  *.jpg
in the hope that I would take an image that was 291x400, change the canvas size to 602x400 and, have the original image positioned extreme right of the result.

What happened was that the original image just resized to the extent.

Have to be doing something wrong but after searching can't work it out. Appreciate any help.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Resize canvas to one side

Post by fmw42 »

It works fine for me under IM 6.8.0.4 Q16 Mac OSX Snow Leopard

create two empty directories, rosetest and rosetest2

cd rosetest
convert rose: rose1.jpg
convert rose: rose2.jpg
convert rose: rose2.jpg

mogrify -path /Users/fred/images/rosetest2 -format jpg -background black -gravity east -extent 200x200 -density 72x72 -quality 85 *.jpg

Produces 3 images of the same name with black canvas of size 200x200 with the small rose image placed at the center of the right side of the canvas.
opalepatrick
Posts: 2
Joined: 2012-11-04T10:20:15-07:00
Authentication code: 67789

Re: Resize canvas to one side

Post by opalepatrick »

Thanks fmw42,

for some reason or other, after starting up (Linux Ubuntu) again this morning. It worked first time. Very bizarre. But thanks for confirming otherwise I could have been scrabbling around for hours :-)
Post Reply