Hi there,
I am trying to resize and rotate a part of an image and then crop it to a smaller size.
This command worked perfectly fine with ImageMagick 6.2.8:
convert $1 -crop 1280x800+0+0 -region 1280x800+0+8 -resize 960x600 -crop 960x600+0+0 -region 960x600+0+8 -rotate 2.5 -resize 118% -roll -26-92 $1
The result was a jpg with 960x600px
On a second machine with ImageMagick 6.5.4-7 the result is an image with 1280x800px. I also tried +repage after crop - without success.
What's the missing piece? Any help is appreciated.
Ralf
crop doesn't work
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: crop doesn't work
Why are you using -region with -crop?
That combination of operations does not make a lot of sense!
-region is essentually a 'temporary crop' with the results compsed back onto the original image on the next -region command, or a end of region (+region) operation.
That is the final image size will be restored after a set of region operations is finished!
See Region and Sub-Region Images
http://www.imagemagick.org/Usage/masking/#regions
That combination of operations does not make a lot of sense!
-region is essentually a 'temporary crop' with the results compsed back onto the original image on the next -region command, or a end of region (+region) operation.
That is the final image size will be restored after a set of region operations is finished!
See Region and Sub-Region Images
http://www.imagemagick.org/Usage/masking/#regions
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: crop doesn't work
I'm using region because of a 8px border on the top of the image which must stay intact.
Re: crop doesn't work
Using +region results in
convert: wand/mogrify.c:8067: SyncImageSettings: Assertion `image->signature == 0xabacadabUL' failed.

convert: wand/mogrify.c:8067: SyncImageSettings: Assertion `image->signature == 0xabacadabUL' failed.

Re: crop doesn't work
Updated to ImageMagick-6.8.9-0 and +region works now.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: crop doesn't work
did that solve your problem?
Another thing that may be giving issues is is that -region is essentually a 'saved original, and crop' operation. However the page offset from the crop is not removed, though it is also not used when the region image is composed back onto the original (saved) image. However that offset can effect a operation like crop that is appied to the regon image, unless you took that into account, or removed the offset using +repage after using -region.
See notes at the Region Example Link given previously.
Another thing that may be giving issues is is that -region is essentually a 'saved original, and crop' operation. However the page offset from the crop is not removed, though it is also not used when the region image is composed back onto the original (saved) image. However that offset can effect a operation like crop that is appied to the regon image, unless you took that into account, or removed the offset using +repage after using -region.
See notes at the Region Example Link given previously.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/