[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Antialiased rendering on a transparent image

Kirill Grouchnikov wrote:
I can't say that i agree with this approach. There are two cases:

1. Black foreground. Here, you convert all the colored pixels into translucent black. This is not how the native rendering works - the final "outlier" pixels (when they are rendered on screen) should stay colored (bluish, yellowish) to reproduce the native rendering with high fidelity.
2. Non-black foreground (say white foreground on black background or any other combination). This is not supported at all.


So, even in the first case you're losing the native rendering fidelity, and the second case is not supported at all.
Thanks
Kirill



You won't be able to achieve the same effect as subpixel rendering. With ClearType the antialiasing (and associated alpha blending) is done per subpixel. With an ImageData the alpha blending appies to the entire pixel. They just don't work the same way. I tried it and it didn't look right.


For case 2, an approach that will work is to draw the swtImage in black on white, do a pass to set all your alphas, and do a second pass to just set the entire image to the intended foreground color.

Matthew