I am using ImageMagick 6.3.4 06/01/07 Q16 on Windows.
If I run the following command:
convert test.psd -affine -1,0,0,-1,0,0 -transform rotated.jpg
Then the result is the image rotated (as a jpeg), as expected. However, if I want to flatten the layers, e.g.
convert test.psd -affine -1,0,0,-1,0,0 -transform -flatten rotated-flattened.jpg
then the result is a white image.
This happens regardless of the source format, e.g.
convert test.jpg-affine -1,0,0,-1,0,0 -transform -flatten rotated-flattened.jpg
does the same.
Is this a bug or am I doing something wrong?
Thanks,
Martin
Rotating and flattening produces white image
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Rotating and flattening produces white image
You rotated the image out of the positive position space! Remember all affine transforms takes into account any negatge offsets the result image may get, though few image formats understand a negative offset. As such saving the roatted image to say JPEG shows the image rotated, but flattening directly does not see a negativally positioned image!
As such no image was in the area when flattened.
You need to junk the image offset using +repage or adjust your affine with an appropriate offset.
For full details see IM examples, Position of Affine Results
http://www.imagemagick.org/Usage/distorts/#affine_pos
Also see, Affine Result Re-Positioning...
http://www.imagemagick.org/Usage/distorts/#affine_repos
As such no image was in the area when flattened.
You need to junk the image offset using +repage or adjust your affine with an appropriate offset.
For full details see IM examples, Position of Affine Results
http://www.imagemagick.org/Usage/distorts/#affine_pos
Also see, Affine Result Re-Positioning...
http://www.imagemagick.org/Usage/distorts/#affine_repos
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Rotating and flattening produces white image
Thanks Anthony.
I read through your examples and it makes sense now. In fact, as all I was trying to achieve was rotation, I have switched to using the -rotate option.
I read through your examples and it makes sense now. In fact, as all I was trying to achieve was rotation, I have switched to using the -rotate option.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Rotating and flattening produces white image
It is faster and simplier to use if that is all you want.
If you jkust want to flip or flop the image that is posible too.
See the top of the Image distortion page.
http://www.imagemagick.org/Usage/distorts/
If you jkust want to flip or flop the image that is posible too.
See the top of the Image distortion page.
http://www.imagemagick.org/Usage/distorts/
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/