Page 1 of 1

Antialiasing and fonts

Posted: 2009-11-07T04:27:42-07:00
by fantomas
Hello,

I make websites, and use FLIR image replacement ( http://facelift.mawhorter.net/ ) technique for text rendering.
With FLIR I have two choices - either using GD or IM.
Judging from experiments with a given font, GD results worse then with IM, so I decided to continue with IM and get appropriate picture.

The problem is how anti-aliasing works for a font. Are there any ways to modify AA behaviour in IM?
For example, this image illustrates different settings for AA in Adobe Photoshop (right column) and AA in IM (left column):

http://www.onlinedisk.ru/view/261136

To get this picture I first drawn right column in PS, exported it in PNG and then wrote text in IM:

convert out/fonts_test_18px.png \
-font Fonts/PF_Din_Text_Comp_Pro_Regular.ttf \
-fill red \
-density 72 \
-pointsize 18 \
+antialias \
-annotate 0x0+60+55 "ЗАПЧАСТИ ДЛЯ МАШИН AA = Off" \
-antialias \
-annotate 0x0+60+105 "ЗАПЧАСТИ ДЛЯ МАШИН AA = On" \
-annotate 0x0+60+155 "ЗАПЧАСТИ ДЛЯ МАШИН AA = On" \
-annotate 0x0+60+205 "ЗАПЧАСТИ ДЛЯ МАШИН AA = On" \
-annotate 0x0+60+255 "ЗАПЧАСТИ ДЛЯ МАШИН AA = On" \
out/out.png

As you can see, letters "A", "M" looking not nice at all. Any ideas how to enhance AA in IM for my case?

Re: Antialiasing and fonts

Posted: 2009-11-07T09:31:03-07:00
by fmw42
I don't know if it will help, but you can try adding -stroke red and/or -strokewidth X, where X = 0,1,2...

see http://www.imagemagick.org/Usage/draw/#stroke

Re: Antialiasing and fonts

Posted: 2009-11-07T12:13:45-07:00
by fantomas
Thank you for reply and suggestion - I tried stroke with different -strokewidth , result is not appropriate yet.

Re: Antialiasing and fonts

Posted: 2009-11-07T12:29:47-07:00
by fmw42
try -draw rather than -annotate. Not sure if -annotate is sensitive to -antialias (probably is, but won't hurt to try -draw)

see http://www.imagemagick.org/Usage/draw/

also see other options at http://www.imagemagick.org/script/magic ... aphics.php