version 6.7.5-7 on Linux Mint 10
My program extracts a portion of an image using "convert -extract wxh+x+y input.tif interim.tif" syntax, and that gives me the results I am looking for. However, when I subsequently want to extract a portion of interim.tif using the same syntax "convert -extract wxh+x+y interim.tif output.tif", it does not give me the expected results. It either gives me an unexpected output.tif (different location or different size) or doesn't find anything. I think that my program is correct because if I open the interim.tif in GIMP and then resave it as interim.tif, I do get the expected output.tif results. So it looks like ImageMagick must be using some sort of saved property when doing "convert -extract" conversions? Can anyone confirm how I should be doing multiple "convert -extract" conversions (input.tif->convert/extract->interim.tif->convert/extract->output.tif)?
Issues with Multiple "convert -extract wxh+x+y"
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Issues with Multiple "convert -extract wxh+x+y"
Why use -extract?
Use -crop
The +repage is important as crop (and probably extract) preserves the virtual canvas (where the image was cropped from).
ASIDE: IMv7 will likely see -crop automatically do a +repage, while +crop (layers crop) does not, for ALL crop operations.
IMv6 +crop just does the same thing as the current -crop
Use -crop
Code: Select all
convert input_image -crop WxH+X+Y +repage -crop WxH+X+Y +repage save_image
ASIDE: IMv7 will likely see -crop automatically do a +repage, while +crop (layers crop) does not, for ALL crop operations.
IMv6 +crop just does the same thing as the current -crop
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Issues with Multiple "convert -extract wxh+x+y"
OK.. I'll give -crop a try and report back. Although I omitted it in my post, I did have a +repage in my "convert -extract" syntax so would have expected it to work.