freetype-devel
[Top][All Lists]
Advanced

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

Re: [Devel] Freetype2 & gamma correction


From: Artur Zaprzala
Subject: Re: [Devel] Freetype2 & gamma correction
Date: Sun, 30 Mar 2003 15:02:50 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3) Gecko/20030312

Vincent Caron wrote:
Keith Packard said:

So, we really need two fixes -- one fix to adjust the partial coverage  values 
to
accomodate the output device pixel characteristics, and a gamma  correction to
adjust for output device luminosity behaviour.


Keith said it all, the GRAYS_USE_GAMMA is a bad hack that works by chance in a
peculiar environment, it should go away. The 'gamma code' in the ftstring demo
implements such a hack, but it's wired to the [monochrome] rendering code here 
(thus
it failed horribly when the colors were inverted).

I have implemented a gamma-corrected alpha blending to play with (in GTK+ widh 
GdkRGB,
I think I lost the code) : http://zerodeux.net/misc/ft/aa/

Basically, you do the linear interpolation in the 'gamma corrected space', so 
it goes
like :

  dest = GammaInverse( coverage * Gamma(src) + (1 - coverage) * Gamma(dest) )

I think that physically correct is to do alpha blending in linear space. For instance, notice that when you turn two light bulbs on instead of one you get twice as much light (energy simply sums up in linear space) but it is only 50% (roughly) brighter (the response of the eye is nonlinear).


--
Artur Zaprzala






reply via email to

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