6 ms·
I don't understand why getting anti-aliasing right is so hard. Just render text a few times bigger, use some kind of low-pass filter (box filter will do) and do
by stianan 16y ago
I don't understand why getting anti-aliasing right is so hard. Just render text a few times bigger, use some kind of low-pass filter (box filter will do) and down-sample it. It's what every graphics program does. That would put an end to using Photoshop or Flash for headlines just to make them look decent.
- henrikschroder 16y agoCleartype uses subpixel rendering as well, I'm not so sure you can achieve that by simply down-sampling a larger render.
- strmpnk 16y agoActually, while it will do that it also tries to shift edges to lie on pixel boundaries when possible. This distortion can make edges look clearer though it also looks brutal with certain type faces. Most people like whatever they are used to.
- wladimir 16y agoBecause that's a very CPU and memory inefficient way of doing it. If you value performance, you don't want to render something "a few times bigger" filter it and then scale it down. You want to render the text and anti-alias it at the same time. And that's not a trivial thing.
- stianan 16y agowladimir: Up-sample/filter/down-sample is the standard way of doing it, and any other way will just be an optimization of that transformation.
- henrikschroder 16y agoFor graphics, yes, but not for fonts. If you scale text linearly, it just looks bad at smaller sizes, which is why vectorized fonts come with plenty of rendering hints. Add to that subpixel rendering and a lot of other typography rules, and font rendering is suddenly pretty difficult to get right. Try it yourself, make an image of some text in 80px, shrink it 8 times, and compare that to the same text rendered as 10px. You'll notice that the shrunken image is harder to read than the actual text.