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!
Question about the operation sequence
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Question about the operation sequence
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.
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.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Question about the operation sequence
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.
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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Question about the operation sequence
Well that is right. I made a mistake:
If I do, the crop is applied before rotation, i.e. the right sequence. But if I do , the crop is applied after rotation.
If I do
Code: Select all
convert a.jpg -crop 10x10+2+2 -rotate 90 b.jpg
Code: Select all
convert -crop 10x10+2+2 -rotate 90 a.jpg b.jpg
Re: Question about the operation sequence
Anything after version 6 you are supposed to read in the image first so:
This is correct:
This is incorrect
This is correct:
Code: Select all
convert a.jpg -crop 10x10+2+2 -rotate 90 b.jpg
Code: Select all
convert -crop 10x10+2+2 -rotate 90 a.jpg b.jpg