Bitmap fonts choppy

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
io12
Posts: 4
Joined: 2017-05-30T17:25:27-07:00
Authentication code: 1151

Bitmap fonts choppy

Post by io12 » 2017-05-30T17:35:03-07:00

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

User avatar
fmw42
Posts: 21863
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Bitmap fonts choppy

Post by fmw42 » 2017-05-30T17:38:56-07:00

+antialiasing disables anti-aliasing. Try removing +antialiasing. See http://www.imagemagick.org/script/comma ... #antialias

io12
Posts: 4
Joined: 2017-05-30T17:25:27-07:00
Authentication code: 1151

Re: Bitmap fonts choppy

Post by io12 » 2017-05-30T17:48:58-07:00

That just makes the text look blurry. Bitmap fonts shouldn't need to be antialiased.

Image

snibgo
Posts: 9253
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Bitmap fonts choppy

Post by snibgo » 2017-05-30T18:04:51-07:00

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.
snibgo's IM pages: im.snibgo.com

io12
Posts: 4
Joined: 2017-05-30T17:25:27-07:00
Authentication code: 1151

Re: Bitmap fonts choppy

Post by io12 » 2017-05-31T14:17:59-07:00

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?

User avatar
fmw42
Posts: 21863
Joined: 2007-07-02T17:14:51-07:00
Location: Sunnyvale, California, USA

Re: Bitmap fonts choppy

Post by fmw42 » 2017-05-31T14:48:38-07:00

Did you remove +antialiasing as I suggested above?

snibgo
Posts: 9253
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Bitmap fonts choppy

Post by snibgo » 2017-05-31T14:52:23-07:00

IM doesn't directly handle fonts, but uses the freetype library.
snibgo's IM pages: im.snibgo.com

User avatar
magick
Site Admin
Posts: 10684
Joined: 2003-05-31T11:32:55-07:00

Re: Bitmap fonts choppy

Post by magick » 2017-06-01T03:04:22-07:00

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.

io12
Posts: 4
Joined: 2017-05-30T17:25:27-07:00
Authentication code: 1151

Re: Bitmap fonts choppy

Post by io12 » 2017-06-02T14:01:19-07:00

Not sure if it was resolved from a fontconfig update or an ImageMagick update, but it works perfectly now. Thanks!

Post Reply