Page 1 of 1

Re: selection of a square part of a photo or image

Posted: 2008-10-02T17:09:36-07:00
by fmw42
denisp wrote:hello,

is it possible to select a square part (not a rectangular part) of an image using command lines?

The images will be human photos and i have to select the head and shoulders.

The square may not be the same size because photos are not taken exactly at the same distance and the photos may not be centered.

Put in other words, i need a dynamic size square who can be drag over an image to select a part of the image.

Thanks for your time.
command line mode is not visually interactive! However, in command line mode, you can select any square region you want using the syntax:

convert image.jpg[WxH+X+Y] output.jpg

or

convert image.jpg -crop WxH+X+Y\! +repage output.jpg

where W is the width of the area, H is the height of the area, where in your case W=H, and X and Y are the location of the upper left corner of the region you want relative to the upper left corner of the image.

See:

http://www.imagemagick.org/Usage/files/#read_mods
http://www.imagemagick.org/script/comma ... s.php#crop

I do not know if you can select a region interactively using the X display mode:

display image.jpg