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 »

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: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Bitmap fonts choppy

Post by fmw42 »

+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 »

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

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

Re: Bitmap fonts choppy

Post 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.
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 »

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: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Bitmap fonts choppy

Post by fmw42 »

Did you remove +antialiasing as I suggested above?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Bitmap fonts choppy

Post by snibgo »

IM doesn't directly handle fonts, but uses the freetype library.
snibgo's IM pages: im.snibgo.com
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Bitmap fonts choppy

Post 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.
io12
Posts: 4
Joined: 2017-05-30T17:25:27-07:00
Authentication code: 1151

Re: Bitmap fonts choppy

Post by io12 »

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