Page 1 of 1

Bitmap fonts choppy

Posted: 2017-05-30T17:35:03-07:00
by io12
Commands of the form:

Code: Select all

convert -font "BitmapFont" +antialias label:text ...
produce a choppy image.

Image of the problem:
Image

Code used to produce the image:

Code: Select all

convert -background white \
	-fill black \
	-font "Terminus-(TTF)" \
	-pointsize 12 \
	+antialias \
	"label:ImageMagick" \
	out.png

Re: Bitmap fonts choppy

Posted: 2017-05-30T17:38:56-07:00
by fmw42
+antialiasing disables anti-aliasing. Try removing +antialiasing. See http://www.imagemagick.org/script/comma ... #antialias

Re: Bitmap fonts choppy

Posted: 2017-05-30T17:48:58-07:00
by io12
That just makes the text look blurry. Bitmap fonts shouldn't need to be antialiased.

Image

Re: Bitmap fonts choppy

Posted: 2017-05-30T18:04:51-07:00
by snibgo
You have specified a very small size for that font, so small that some verticals are less than half a pixel thick. So if you anti-alias them the verticals are gray but visible. If you don't anti-alias, they are zero thickness.

Remedy: choose a different font or larger size.

Re: Bitmap fonts choppy

Posted: 2017-05-31T14:17:59-07:00
by io12
The font still doesn't look right at a larger size Image, but I shouldn't need to set a large size anyway. Terminus-(TTF) looks fine in gimp at 12pt. I think that this is a bug in ImageMagick. On the project page for Terminus TTF (https://files.ax86.net/terminus-ttf/), it says:
There are applications that neither support the original Terminus Font nor use bitmaps embedded in TrueType fonts. They completely rely on the automatically generated scalable outlines.
Another bitmap font I tried had the same problem. Maybe ImageMagick lacks support for bitmaps inside TTF fonts?

Re: Bitmap fonts choppy

Posted: 2017-05-31T14:48:38-07:00
by fmw42
Did you remove +antialiasing as I suggested above?

Re: Bitmap fonts choppy

Posted: 2017-05-31T14:52:23-07:00
by snibgo
IM doesn't directly handle fonts, but uses the freetype library.

Re: Bitmap fonts choppy

Posted: 2017-06-01T03:04:22-07:00
by magick
Thanks for the problem report. We can reproduce it and will have a patch to fix it in GIT master branch @ https://github.com/ImageMagick/ImageMagick later today. The patch will be available in the beta releases of ImageMagick @ http://www.imagemagick.org/download/beta/ by sometime tomorrow.

Re: Bitmap fonts choppy

Posted: 2017-06-02T14:01:19-07:00
by io12
Not sure if it was resolved from a fontconfig update or an ImageMagick update, but it works perfectly now. Thanks!