2012-12-05 22:21:23 UTC
I have been using GraphicsMagick for a few days now and have been having a lot of fun.
But there is one thing I haven't been able to figure out. I am generating text strings into a new image file. By default, antialiasing is on, but the font when drawn antialiases to some default background color, so the letters are trimmed in a different color. What I want is semi-transparent pixels, i.e. antialiased to transparent.
Here is the command I am using:
gm convert ^
-size 2000x300 "xc:transparent" ^
-font %3 -pointsize 120 ^
-stroke #587076 -strokewidth 3 ^
-fill transparent ^
-draw "gravity Center rotate 0 text 0,0 'Sample Text'" ^
-crop 0x0 ^
-bordercolor transparent ^
-border 10x10 ^
With "xc:transparent" (as shown) I get the stroke antialiased to a black background, so the pixels grow darker. With "xc:#FFFFFFFF" I get the stroke antialiased to white, so the pixels grow lighter. If I add:
...it seems to make no difference.
How to simply get the antialiased pixels to be semi-transparent so they will blend with whatever background I place the image on later?