Page 1 of 1

-distort SRT

Posted: 2010-12-19T18:11:12-07:00
by GreenKoopa
I'm not getting what I expect for case "c". This case should be "ScaleX,ScaleY Angle", but looks like "X,Y Angle". Would someone please run and confirm?

http://www.imagemagick.org/script/comma ... hp#distort

convert -size 80x80 xc:red -virtual-pixel black -distort SRT "5" a.png
convert -size 80x80 xc:red -virtual-pixel black -distort SRT "0.5 5" b.png
convert -size 80x80 xc:red -virtual-pixel black -distort SRT "1,0.5 5" c.png
convert -size 80x80 xc:red -virtual-pixel black -distort SRT "0,0 1 5" d.png
convert -size 80x80 xc:red -virtual-pixel black -distort SRT "0,0 1,0.5 5" e.png

convert a.png b.png c.png d.png e.png -bordercolor none -border 10x10 +append abcde.png
Image

EDIT: Simplified test and added image.

Re: -distort SRT

Posted: 2010-12-19T18:38:43-07:00
by anthony
It is X,Y Angle!
See IM Examples, SRT distort...
http://www.imagemagick.org/Usage/distorts/#srt

Basically when 3 values are provided it assumes you have given it the center coordinates (control point) for the rotation, not separate X,Y scaling factors.

However you can simply substitute '%[fx:w/2],%[fx:h/2]' for those values (center point of image - may be a floating point number!), to make it a 5 value SRT distortion. That is...
-distort SRT '%[fx:w/2],%[fx:h/2] 1,0.5 5'

Remember coordinate values are in Image Coordinates. meaning that the top left edge is 0,0 but the center of the top left pixels is 0.5,0.5 If you want to rotate around a actual pixel, then the coordinate will be X+0.5,Y+0.5 See
Image Coordinates vs Pixel Coordinates
http://www.imagemagick.org/Usage/distor ... oordinates

Re: -distort SRT

Posted: 2010-12-19T18:47:26-07:00
by GreenKoopa
Should I contact someone (who and how) about this documentation error?

http://www.imagemagick.org/script/comma ... hp#distort
is in conflict with
http://www.imagemagick.org/Usage/distor ... oordinates

-----

Using -set option:distort:scale, can separate x & y scaling factors be specified?

Re: -distort SRT

Posted: 2010-12-19T18:53:06-07:00
by anthony
Hmmm it seems that the offical documentation has it wrong. I will fix that.

The documentation is correct in the source and on IM Examples, just wrong on the command line options site. -- Fixed give it s few hours for various web caches to update.