Page 1 of 1

[R] How can i complete an image ?

Posted: Thu Feb 24, 2011 3:39 pm
by peuchere83
Hello everyone,

I'm a new french user and my english is poor (sorry by advance). :P

I have a picture (jpg) whith that size : height 220 pixels and width 327 pixels (landscape image).
I search to complete with a border in green color for a square (327 x 327).
How can i do that ?

An other question :
How can i detect the image orientation (landscape or portrait) ?
Because i search to obtain a square with these 2 orientations.

In summary i search to convert in square all my pictures by completing the picture with a border color.

Best regards.

Re: [..] How can i complete an image ?

Posted: Thu Feb 24, 2011 8:14 pm
by xnview
You can try 'canvas resize'

Re: [..] How can i complete an image ?

Posted: Fri Feb 25, 2011 8:15 am
by peuchere83
Thank you for that response.

I found the solution :

Code: Select all

nconvert -resize 100% 100% -canvas 400 400 center -bgcolor 255 255 255 -o c:\result.jpg c:\try.jpg
But i have another question :
Is it possible to know the maximum size of my picture to chose the correct size of the canvas ?

Thank you