2 ms·
When trying to blend two different colors, for instance when you have antialiased white text on black background (or for that matter, fuchsia text on an image),
by Sesse__ 4y ago
When trying to blend two different colors, for instance when you have antialiased white text on black background (or for that matter, fuchsia text on an image), there's a question on how you do the blending mathematically. The “obvious” way of doing a*alpha + b*(1-alpha) for the pixel values is wrong, since the pixel values don't correspond directly to the number of photons (they are compressed using a non-linear curve, because that allows us to use 8-bit displays instead of, say, 16-bit). In particular, this means that white-on-black and black-on-white don't actually render visually the same.
This patch corrects that, and adds some contrast controls since few people would prefer the 100% physically correct blending (I'd assume fonts are not designed for that in the first place, so the alpha value coming out of the subpixel calculation isn't really optimal). This brings it closer to macOS' Terminal.app.