Page 1 of 1

(Rotate) query on win-com-line (test code inside)

Posted: 2007-10-04T05:58:28-07:00
by Ravinderjit S.Sidhu
I am trying Rotation in windows platfom on command line:
-----------------------------------------------------------------------------------

Code: Select all

convert -size 2100x1200 xc:white ^
  ( -font  arial  -pointsize 105 -fill rgb(255,0,0)   -draw  " rotate +0 text  100, 100 '1.ImageMagick'" ) ^
  ( -font  arial  -pointsize 105 -fill rgb(0,0,0)     -draw  " rotate +5 text  100, 100 '1.ImageMagick'" ) ^
  ( -font  arial  -pointsize 105 -fill rgb(255,0,0)  -draw  " rotate +0 text  100, 900 '2.ImageMagick'" ) ^
  ( -font  arial  -pointsize 105 -fill rgb(0,0,0)     -draw  " rotate +5 text  100, 900 '2.ImageMagick'" ) ^
  output.BMP

Output
----------
Output.bmp shows two black text lines ("ImageMagicK") at 100,100 location and another at 100,900 location.
Rotation of both the text is "+5".
But the rotation effect of second line is different with first line (Why so?)
and How i can get the good desired result (Please suggest me)

Thanks and Regards
Ravinderjit Singh Sidhu

Re: (Rotate) query on win-com-line (test code inside)

Posted: 2007-10-04T20:01:00-07:00
by anthony
First parenthesis are not needed as you are only dealing with one image
you are not trying to modify one image separatally to other images in
memory.

OKAY I see your problem....

The "rotate" setting in draw is NOT a text rotate, but a WHOLE CANVAS ROTATE

See IM Examples, Annotating Images, Text Rotation with Translation
http://imagemagick.org/Usage/annotating/#text_rotation

Also see Draw, Warping the Drawing Surface
http://imagemagick.org/Usage/draw/#transform

What you want is to either translate then rotate (the canvas) as shown
in the first link above. OR use annotate to rotate the test BEFORE
it 'draws' it.
http://imagemagick.org/Usage/text/#annotate

It is also a lot simplier than using "draw"
here is a cleaned up version.

Code: Select all

   convert -size 2100x1200 xc:white -font  arial  -pointsize 105 \
            -fill red   -annotate 0x0+100+100 "1.ImageMagick" \
            -fill black -annotate 5x5+100+100 "1.ImageMagick" \
            -fill red   -annotate 0x0+100+900 "2.ImageMagick" \
            -fill black -annotate 5x5+100+900 "2.ImageMagick" \
            win:
The "win:" output displays directly on your screen rather than to a
file. Under UNIX you can use "x:" as well.

PS: Next time use a SMALLER image for testing!!

Re: (Rotate) query on win-com-line (test code inside)

Posted: 2007-10-04T21:48:18-07:00
by Ravinderjit S.Sidhu
Thankyou for your very very good guidance, it helped a lot.
Regards
Ravinderjit Singh Sidhu