On 10/22/2015 11:56 PM, Nikolaus Waxweiler wrote:
Perhaps, this is the explanation I was looking for. You are basically
saying that sRGB imposed by the monitor is not a good idea for high
contrast text rendering and has to be undone. I can buy that. So when
you talk about gamma of about 2 you actually mean power of about 1/2.
I was confused.

Uhm, wait, this is not about "good idea" or taste but rather "technical 
correctness". The sRGB gamma curve is fine as is -- it just needs to be taken into account to 
get the correct rendering. I would say FT produces universal bitmaps in linear space because it 
doesn't know on what display they end up on, the rest is up to the rendering library. 1.8 is a 
compromise that will still give good results across a wide range of sRGB displays and probably even 
the 2.2 AdobeRGB ones.

Good explanations, Nikolaus. I offer a few minor additions:

Alexei, the linear blending process requires both an inverse gamma step and a 
gamma step. You correctly note that 1/2 is the power for inverse gamma of 2.

True, FT doesn't know the display gamma (but we could guess sRGB). More 
importantly, it doesn't know the foreground and background colors to be blended 
in the compositing step.

To composite an antialiased pixel:

1. Take the foreground and background colors (e.g., in sRGB space) and apply 
gamma to get them in a linear space.
2. Blend the two linear colors using the alpha value from FT. This is a "density" or 
"coverage" value, giving the proportion of the pixel covered by the filled glyph.
3. Apply inverse gamma to the blended pixel and write it back to the image.

-Dave
_______________________________________________
Freetype-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/freetype-devel

Reply via email to