freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Devel] on Gamma-corrected alpha blending


From: David Turner
Subject: [Devel] on Gamma-corrected alpha blending
Date: Fri, 04 Jun 2004 23:38:04 +0200
User-agent: Mozilla Thunderbird 0.5 (Windows/20040207)

As Werner already told you, I've added specific routines to the minimal graphics
library used by the "ft2demos" package in order to support gamma-corrected alpha
blending.

More precisely, the algorithm is tailored to be very fast when used to display
text, through the use of a smart lookup table / cache (I have a benchmark here
that shows that it is 1.6 to 1.8 faster than direct alpha-blending). Note that
all glyph rendering modes (gray, RGB, BGR, vRGB, vBGR) are supported.

The beauty of placing this algorithm in the graphics library is that it
generates results that are correct with any background and
foreground colors, and that it doesn't pollute the cache with distinct
variants of the same glyphs. It also works on all systems supported
by "ft2demos", which is good.

There is also a new little demo program named "ftgamma" that can be used
to determine your current screen's gamma in case you find that useful.

Interestingly, while my screens seem to have a gamma of 2.1, using a gamma
correction of 1.4 in ftview seems to produce the best text on them. At this
level, even un-hinted text seems better. I would even dare say OS-X like :-)

I don't have any clear explanation for the fact that a correction of 1.4,
instead of 2.1, produces better results, though I suspect that the human
eye hasn't linear responsiveness to luminance either.

In all cases, have a look. I'll try to incorporate the algorithm in a X11
server to see if this greatly changes the output of text on Linux. I suspect
that the specific hardware conditions might make the "fast" algorithm not
so useful if we spend our time waiting for PCI reads from the frame buffer,
but that's a different topic altogether.

Well, that's all, enjoy if you can.

- David Turner
- The FreeType Project  (www.freetype.org)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]