This command having started, hangs absolutely dead. It works okay without -rotate.
convert IN.JPG ^
( +clone -rotate -22.5 ) ^
-compose Src -composite ^
( +clone -flip ) ^
-append ^
-rotate 45 ^
OUT.JPG
( +distort SRT 45 works as expected.)
Thanks.
Possible Bug -append/-rotate IM 6.7.1-0 Q16 on WinXP
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Possible Bug -append/-rotate IM 6.7.1-0 Q16 on WinXP
Which -rotate? you have two of them!
Also why the -flip? for a mirror effect?
Oh I see Yes a mirror effect... Works for me under linux!
convert rose: \( +clone -rotate -22.5 \) -compose Src -composite \( +clone -flip \) -append -rotate 45 show:
Also why the -flip? for a mirror effect?
Oh I see Yes a mirror effect... Works for me under linux!
convert rose: \( +clone -rotate -22.5 \) -compose Src -composite \( +clone -flip \) -append -rotate 45 show:
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Possible Bug -append/-rotate IM 6.7.1-0 Q16 on WinXP
Glad it works on linux. The second rotate, -rotate 45 is the one I meant. That's why I added -append as part of the title to this report.
I've tried it again. Still hanging. It seems to be related to size of input image. 800x600 px works fine; 4000x3000 px doesn't.
S.
I've tried it again. Still hanging. It seems to be related to size of input image. 800x600 px works fine; 4000x3000 px doesn't.
S.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Possible Bug -append/-rotate IM 6.7.1-0 Q16 on WinXP
Then it is more likly running out of memory. After rotating the image gets bigger, (45 is maximum enlargement for a squareish image) during that stage IM need to hold at least three images in memory due to its use of 3 shears to generate the rotation
See expert notes IM examples
http://www.imagemagick.org/Usage/warping/#rotate
http://www.imagemagick.org/Usage/warping/#shear
As well as Leptonica Rotation for more detail.
http://www.leptonica.com/rotation.html
Now if IM reaches memory limits it will switch to using a Cache to Disk method which compare to memory is deathly slow!
(there are monitor and debug options that will let you watch this happen).
However the -distort SRT method only needs two images the source and destination. It uses direct mathematical mapping (using affine matrixs not trignometric functions), and full Filtered sampling of the source image (EWA resampling) whci hresults is far superiour results at the pixel level. However it will be slower as it is not simply 'scanline processing' the image (3 times). Most importantally 'low memory requirements.
Use +distort to get it to expand the resulting image, and follow with +repage to remove virtual layer positioning info afterwards.
If you want you can speed it up by turning off the EWA filter using -filter none, and it will then be faster and probably still produce a 'better' result that traditional -rotate!
See expert notes IM examples
http://www.imagemagick.org/Usage/warping/#rotate
Also see Shears for even more infoThe Rotate Operator is actually implemented using Simple Distorts followed by three Image Shears, a technique known as 'Rotate by Shear' (RBS) and first publish in research papers by Alan Paeth.
http://www.imagemagick.org/Usage/warping/#shear
As well as Leptonica Rotation for more detail.
http://www.leptonica.com/rotation.html
Now if IM reaches memory limits it will switch to using a Cache to Disk method which compare to memory is deathly slow!
(there are monitor and debug options that will let you watch this happen).
However the -distort SRT method only needs two images the source and destination. It uses direct mathematical mapping (using affine matrixs not trignometric functions), and full Filtered sampling of the source image (EWA resampling) whci hresults is far superiour results at the pixel level. However it will be slower as it is not simply 'scanline processing' the image (3 times). Most importantally 'low memory requirements.
Use +distort to get it to expand the resulting image, and follow with +repage to remove virtual layer positioning info afterwards.
If you want you can speed it up by turning off the EWA filter using -filter none, and it will then be faster and probably still produce a 'better' result that traditional -rotate!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Possible Bug -append/-rotate IM 6.7.1-0 Q16 on WinXP
ASIDE: if you want to watch the many steps needed for traditional rotating (under UNIX/Linux) use...
this shows the processing steps...
the next three the shears used to rotate the image
the last a crop to trim the excess space caused by the three shears.
The final write is not shown as "null:" does not actually write the image, just junks it!
Is it any wonder that traditional -rotate has 'blur' issues Even though it is 'reasonably fast'.
Code: Select all
convert rose: -monitor -rotate 45 null: 2>&1 | mac2unix | less
the first is reading the imageadd frame to image[ROSE]...
x shear image[ROSE]...
y shear image[ROSE]...
x shear image[ROSE]...
crop image[ROSE]...
the next three the shears used to rotate the image
the last a crop to trim the excess space caused by the three shears.
The final write is not shown as "null:" does not actually write the image, just junks it!
Is it any wonder that traditional -rotate has 'blur' issues Even though it is 'reasonably fast'.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Possible Bug -append/-rotate IM 6.7.1-0 Q16 on WinXP
Yes, I see. Thanks for the full explantion. Glad not a bug at your end or mine! Thanks again.
S.
S.
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Possible Bug -append/-rotate IM 6.7.1-0 Q16 on WinXP
No just the need for three or more images (original, an intermediate and the result)
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/