Page 1 of 1

Text rotation

Posted: 2007-11-19T15:43:11-07:00
by knedl2007
Hi,

i want to make a transparent png with a rotated text in it. My Code is as follows:

Code: Select all

convert ( -size 235x53 xc:none ) ( ( -size 250x50 xc:none ) ( -size 0x0 -background none -font journal.ttf -pointsize 23 -fill #111111 label:"Text Text Text" -rotate -5 ) -gravity center -composite )  -composite -depth 8 -quality 95 grouptext.png
But, whatever i try, when i rotate the text is blurred.
Without the -rotate argument, the text is sharp.

The Code above is a little bit complicated because I need the transparent canvas. Here is the essential extract:

Code: Select all

convert -background none -font journal.ttf -pointsize 23 -fill #111111 label:"Text Text Text" -rotate -5 -depth 8 -quality 95 grouptext.png
It is the same here, without the rotation it is fine, but with the rotation it is blured.

The effect is independent of the font.

thx, knedl

Re: Text rotation

Posted: 2007-11-19T21:45:23-07:00
by anthony
Text is blured by rotation.

Two solutions. Rotate larger text, then shrink it using resize.
That works very very well.

the alturnative is to use -distort SRT
to do it. However this is still in development but does do a better job than the default -rotate. In the next month or so I will have gotten back to its development and it will do an even better job!

Operator can also do a lot more than just rotate text, it can perspetive, or even curve, circle the text or other images. I even hope to have it do lots more still.

Re: Text rotation

Posted: 2007-11-20T10:20:33-07:00
by knedl2007
Thanks a lot!

nice, that it is not my fault ;) and the hack with resizing a larger text works really fine!

Re: Text rotation

Posted: 2007-11-20T13:55:15-07:00
by knedl2007
by the way: could it be that the phenomenon also appears with image rotation?

Re: Text rotation

Posted: 2007-11-20T17:23:01-07:00
by anthony
Yes. It is caused by -rotate being defined as 3 shearing operations (for speed, not that IM is fast in this respect), rather than as a reversed pixel mapping as it is in -distort.

You can see the bluring in the enlarged view of a -rotate line...
http://imagemagick.org/Usage/distorts/#rotate_line

Compare that to using a reversed pixel mapping (-distort)
http://imagemagick.org/Usage/misc/#interpolate_line

Note that -distort will only use interpolation pixel mapping (filtering) when no minification is needed. However this may change as I am just finishing up work on resize filters (re-writing the whole resize page actually)
http://imagemagick.org/Usage/resize/
and I will be able to get back to distortion improvements.