Page 1 of 1

Stroke overlaps the text

Posted: 2008-02-11T10:11:33-07:00
by DSanburn
I've found that when I am attempting to do a stroke on text, the stroke color overlaps the fill color and makes my text look choppy and ugly. Here is the command I am using:

convert -background none -fill black -font /usr/share/fonts/TrueType/times.ttf \
+pointsize +antialias -gravity center -size 800x100 \
-stroke white -undercolor none \
caption:'ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems.' \
out.png

I would appreciate any help or suggestions you might be able to offer.
Thanks

Re: Stroke overlaps the text

Posted: 2008-02-11T10:31:29-07:00
by Bonzo
This works for me; I have used a different font, added a font size and changed the stroke colour so it stands out on my page :D

Code: Select all

convert -size 800x100 -background none -fill black -stroke blue -strokewidth 1 -pointsize 20 -font verdana.ttf -gravity center caption:"ImageMagick is free software delivered as a ready-to-run binary distribution or as source code that you may freely use, copy, modify, and distribute. Its license is compatible with the GPL. It runs on all major operating systems." out1.png
I think the problem was the +antialias

Re: Stroke overlaps the text

Posted: 2008-02-11T10:58:17-07:00
by DSanburn
Yeah, the problem is I need the antialiasing off. My need is for a solid text without any of the dispersion or faded edges.

Re: Stroke overlaps the text

Posted: 2008-02-19T22:54:12-07:00
by anthony
The outside edge, or both edges of the stroke?

Re: Stroke overlaps the text

Posted: 2008-02-20T08:31:41-07:00
by DSanburn
I'm wanting a solid inside with just a single pixel outline. I've been able to fake it by writing the text four times with an offset of 1 pixel in each direction and then writing the text once in the center. This works and does what I want but it takes a lot longer to process than I would think this feature should.

-Doug

Re: Stroke overlaps the text

Posted: 2008-02-20T17:39:43-07:00
by anthony
You can draw the image twice, once with a stroke color and strokewidth of say 2, and again without those options.

It is a bit like http://imagemagick.org/Usage/fonts/#thick_stroke but using a thiner initial stroke width.

You ware talking about anti-aliasing before, do you want a smooth anti-aliased stroke, or a aliased (two color only) stroke?

You could try using the options
+antialias -fill white -stroke black -strokewidth .5
though the line does not look very smooth due to the aliasing (staircase) effects.