Page 1 of 1
Question about the operation sequence
Posted: 2008-07-22T02:55:03-07:00
by hanselda
Does anyone know how to influence the sequence of the operations applied to a image? For example:
convert a.jpg -opt1 -opt2 -opt3 b.jpg
What is the sequence of the operations? It seems that in imagemagick there is some internal priority of the operations. For example:
convert a.jpg -crop 10x10+2+2 -rotate 90 b.jpg
Here the rotation is always applied before cropping. How can one influence the operation sequence in this case?
Thanks!
Re: Question about the operation sequence
Posted: 2008-07-22T10:14:24-07:00
by fmw42
You will get a different result if you do
convert a.jpg -rotate -crop 10x10+2+2 b.jpg
also keep in mind you need to add +repage when doing -crop to get rid of the virtual canvas
Not all options are order dependent, though.
Re: Question about the operation sequence
Posted: 2008-07-23T00:07:21-07:00
by anthony
What is your IM version number????
Im version 5 had a problem in that multiple options would be stored and executed in an internal priority.
IM version 6 was developed with the idea of doing all options IN THE ORDER GIVEN!
See
http://imagemagick.org/Usage/basics/ for details.
Re: Question about the operation sequence
Posted: 2008-07-23T05:12:27-07:00
by hanselda
Well that is right. I made a mistake:
If I do
Code: Select all
convert a.jpg -crop 10x10+2+2 -rotate 90 b.jpg
, the crop is applied before rotation, i.e. the right sequence. But if I do
Code: Select all
convert -crop 10x10+2+2 -rotate 90 a.jpg b.jpg
, the crop is applied after rotation.
Re: Question about the operation sequence
Posted: 2008-07-23T05:55:44-07:00
by Bonzo
Anything after version 6 you are supposed to read in the image first so:
This is correct:
Code: Select all
convert a.jpg -crop 10x10+2+2 -rotate 90 b.jpg
This is incorrect
Code: Select all
convert -crop 10x10+2+2 -rotate 90 a.jpg b.jpg