Page 1 of 1

How to enlarge canvas of various images to one size

Posted: 2011-11-02T12:58:24-07:00
by coldkingnowhere
Part of what I'm currently trying to do has me resizing a number of images to be within 800x800px (but they all have different aspect ratios) and then center each image on a 1920x1080 canvas.

All of the functions I've looked at (-border, -extent, -frame, -splice) seem to be dependent on adding a constant number of pixels to the canvas but I want the same canvas size (1920x1080) no matter what image is being processed without altering that image in any other way.

Ideas?

Re: How to enlarge canvas of various images to one size

Posted: 2011-11-02T13:26:04-07:00
by Bonzo
Try:

Code: Select all

convert -size 1920x1080 xc:white image.jpg -gravity center -composite output.jpg
OR

Code: Select all

convert image.jpg -background white -gravity center -extent 1920x1080 output.jpg

Re: How to enlarge canvas of various images to one size

Posted: 2011-11-02T13:51:55-07:00
by coldkingnowhere
That worked great! Thanks.

Re: How to enlarge canvas of various images to one size

Posted: 2011-11-02T19:08:31-07:00
by anthony
Bonzo wrote:

Code: Select all

convert image.jpg -background white -gravity center -extent 1920x1080 output.jpg
to include the resize... to fit in a 800x800 area in the center of the 1920x1080 canvas image...

Code: Select all

convert image.jpg -resize 800x800 -background white -gravity center -extent 1920x1080 output.jpg