[R] How can i complete an image ?

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: helmut, XnTriq, xnview

Post Reply
peuchere83
Posts: 2
Joined: Thu Feb 24, 2011 3:23 pm

[R] How can i complete an image ?

Post 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.
Last edited by peuchere83 on Mon Feb 28, 2011 10:58 am, edited 1 time in total.
User avatar
xnview
Author of XnView
Posts: 46238
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

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

Post by xnview »

You can try 'canvas resize'
Pierre.
peuchere83
Posts: 2
Joined: Thu Feb 24, 2011 3:23 pm

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

Post 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
Post Reply