Page 1 of 1

How do I use convert -extract

Posted: 2007-08-04T08:38:44-07:00
by mcanedo
Hi:
I'm trying to simply extrat an area from an image, I use a command like:

Code: Select all

convert -extract 100x100 origen.png destino.png
but the resulting file is exactly the same than the original.
Am I using a wrong syntax??

I found this bug comment, but with no comments, so I don't know if I'm writing wrong (I'm completly new to ImageMagick)....

http://redux.imagemagick.org/discussion ... 971#p28971

Re: How do I use convert -extract

Posted: 2007-08-04T10:40:35-07:00
by el_supremo
Try forcing the x,y coordinate to zero with
-extract 100x100+0+0

Wizards:
When I tested this with 100x100, I either get the fullsized image or one that has been reduced to no larger than 100x100.
My guess is that the geometry isn't being initialized to zero in ReadImage in constitute.c

Pete

Re: How do I use convert -extract

Posted: 2007-08-06T07:33:05-07:00
by mcanedo
Forcing did not worked either,
I solve my problem using

Code: Select all

convert -crop
Do crop and extract are the same?

Re: How do I use convert -extract

Posted: 2007-08-12T22:11:42-07:00
by anthony
no they are not -extract is a stream processing option that may not work with all image formats. -crop works on the image that was completely read into memory.

WARNING: crop also preverves the images 'offset' meta-data on the virtual canvas. Some formats save that info, and it can effect other operations. I suggest if you don't care about the offset you add +repage after the -crop.

See http://www.imagemagick.org/Usage/crop/