Page 1 of 1

Resize after crop

Posted: 2011-03-10T07:58:04-07:00
by lenz1979
Hello!

I want to crop a part of an image and after that resize the cropped part of the original image.

i tried the following:

convert -crop 640x269+0+0 -geometry 585

so get 640x269 of the original image and resize to 585 width.

BUT: the resize will be executed before the crop. so it first resizes the original image and than crops the part of the resized.

How can it be achieved to first crop and after the crop resize the cropped part? (within one command if possible)

many thanks

Re: Resize after crop

Posted: 2011-03-10T08:34:38-07:00
by Bonzo
This should work:

Code: Select all

convert input -crop 640x269+0+0 +repage -resize x585 +repage output

Re: Resize after crop

Posted: 2011-03-10T18:37:20-07:00
by anthony
Specifically, you should specify your input image FIRST.

Also I do not recommend the use of -geometry for resizing. Use -resize instead, same arguments.

Re: Resize after crop

Posted: 2011-03-11T04:58:53-07:00
by lenz1979
many thanks. that worked perfectly. My problem was that i used it within typo3 library and the typo3 lib function produces the convert command in the follwoing order:

convert params INPUT FRAME OURPUT

and with this order it was not possible.

Re: Resize after crop

Posted: 2011-03-11T10:25:01-07:00
by fmw42