8 ms·
AA is bad if you do not have a concept of how gamma works. If you have a program[1] that does not understand the difference between sRGB and Linear RGB, the co
by DiabloD3 5y ago
AA is bad if you do not have a concept of how gamma works.
If you have a program[1] that does not understand the difference between sRGB and Linear RGB, the color fringing is extremely nasty, especially on light-on-dark situations. If they don't get the gamma wrong, they get the blend mode wrong (cough Alacritty at one point cough)
The fix, honestly, is moving to 200% resolution screens (such as 4k 24" replacing everyone's 1080p 24", or 2880p 27" replacing everyone's 1440p 27"), and using greyscale AA: fonts are now so big, pixelwise, that hinting doesn't screw up fonts, hand hinting is no longer relevant, and any given renderer has a lot of trouble screwing it up. Greyscale with wrong gamma and/or wrong blend mode isn't fatal, it is fatal with subpixel.
1: Such as ClearType on Windows, but not the modern DirectWrite engine. Win10 tried to improve ClearType to make it look more like DirectWrite, but only made its error less harsh. Early versions of Freetype that had subpixel rendering also did this wrong.
- zamalek 5y ago> such as 4k 24" replacing everyone's 1080p 24" The problem is the prevalence of 1080p. 1440p on 24" becomes 'retina' at 28" viewing distance (vs 37" for 1080p and 19" for 4k). Grayscale anti-aliasing at that pixel density is really good, gaining you a few inches of viewing distance. I would personally like to see something commonly available between 1440p and 4K (the jump in resolution is abnormally significant). If you've worked on a high refresh rate it's also really hard to drop down and, currently, it's still mostly a choice given the bandwidth and compute requirements. The difference between 60Hz and 144Hz is like the difference between 480p and 1080p, even for tasks like text editing. 60Hz is fucking awful.
- GekkePrutser 5y agoI run 24" @ 4K at 200% scaling and it's amazing. But 24" 4K is very hard to get now. All 4K screens I can buy here are 27" and up..
- steerablesafe 5y ago> Greyscale with wrong gamma and/or wrong blend mode isn't fatal, it is fatal with subpixel. I might not be fatal with black-on-white or white-on-black, but grayscale is pretty much still horrible with colored text and background.
- rhdunn 5y agoWhich is why the greyscale should be done with an alpha channel, so it correctly blends with the background, and supports coloured text.
- steerablesafe 5y agoThat would be fine, if alpha blending was handled gamma-correctly in most software, but it isn't. Things go worse with alpha and subpixel-AA, that is just cursed.
- wakeupcall 5y agoFully agree. Moving to 4k screens (200+ dpi) is the biggest upgrade you can do for text readability, and I suggest anyone who hasn't tried to do so and see for themselves. I recently had the opportunity to switch both laptop & desktop screen to 4k to avoid hidpi switching issues and I'm glad I did. While the laptop's battery definitely suffers, this is such a massive upgrade for your eyes it's completely worth it. Hinting and AA is still relevant though. I suspect this is still going to be the case until we _exceed_ 300 dpi. As you say, the difference is that now freetype's autohinter is good enough to substitute all hand-hinting, as is grayscale AA removing subpixel rendering issues. Most of the other text shaping issues mentioned in the article are still a problem though. Text rendering is hard. On top of that, both Chrome and Firefox's text engine are also especially bad at rendering text on a physical pixel grid, which is quite ironic given "text" should be the first and foremost thing they present. FF was quite decent until the webrender switch. Pretty sad.
- spystath 5y agoUnfortunately at 4k nothing over 22" is 200+ dpi. It's definitely better than the run of the mill 90-100 dpi monitors but not enough to fully eliminate the need for AA. You need to push around a great amount of pixels to have crisp text with no AA. Presently 5k desktop monitors go for $2.5k+, 8k for $4.5k, which honestly is not terrible but still quite expensive. Even those are at 32"+ which defeats the purpose (stil below 200 dpi). It seems like the desktop display industry is not interested in pursuing this, going instead for faster refresh rates, as such it's unlikely that we will see 250+ dpi displays on anything other than sub-15" laptops and phones.
- munk-a 5y agoI personally run a 1080p projector and it's working great for me. I'm also keeping my display costs under 1k which is pretty nifty. I do understand we've got folks from all walks of life here but 4.5k for a display alone is a pretty ridiculous opportunity cost until you've literally got so much money that you don't care anymore.
- JohnBooty 5y ago
- rob74 5y agoSo we should simply throw away all non-"Retina" monitors just so software developers don't have to bother with the intricacies of subpixel rendering anymore? Not really good for the environment...
- jws 5y agoThere was a time when people ditched their perfectly fine 8 bit LUT based graphic cards and computers for 24 bit true color ones. It made life much easier for developers. All the effort to manage a color palette within a program, and to try to do something reasonable to support more than one program on the screen at a time just went away, not to mention the choices around dithering algorithms. It was glorious. Roughly speaking, we’ve had 25 years to get sub pixel vector glyph rendering right, and it still is consistently wrong in many places. It is a clever hack whose time has come and gone, I will not miss: - fails miserably if you rotate your screen. - only works for horizontal text. Anything rendered at differently angles looks different. - forces a different spatial resolution for brightness and color, in one axis but not the other. - sensitive to the monitor’s physical subpixel layout. You really can’t rely on an end user to tell you the right answer after they plug in a monitor. - color fringing is a thing, more so for people with better eyesight. Some people see it, some don’t. - difficult to reconcile with high dpi printing to make sure what you see on the screen approximates what you are going to get. - it’s hard to know if the person you send this too will see the same thing you do. Different platforms, renderer, and hardware means they may see something differently. So, it was pretty good for horizontal text on a monitor where you knew the subpixel pixel order and you got everything right so it approximated the eventual printed output. But its time has passed. Hand down that monitor to someone’s video game or media watching needs and if you deal with text, get a high dpi monitor.
- ayushnix 5y ago> The fix, honestly, is moving to 200% resolution screens (such as 4k 24" replacing everyone's 1080p 24", or 2880p 27" replacing everyone's 1440p 27") I'd absolutely love to do that but there are only 2 or 3 monitors available on the market right now which would work well with integer scaling at 4k or higher resolution. The Apple Pro XDR, Dell 8K, and LG 5K monitors are the only ones that come to mind. There is an old 24 inch 4k monitor from LG but it wouldn't be a wise decision to buy it at this point. It seems that all the progress in monitor hardware is happening towards increasing referesh rate to unreasonable and unnecessary standards.
- GekkePrutser 5y agoYeah I have this LG. It's amazing.. such a shame they stopped making a 24" model and I'm really worried if this breaks because there's no replacement. It's the 24UD58-B and cost only 220€ at the time. I wish I had bought two. Apple seem to be the only one doing 24" 4K now and I don't want a computer attached.
- enriquto 5y ago> I'd absolutely love to do that but there are only 2 or 3 monitors available on the market right now (...) Or, you know, just use good bitmap fonts on whatever monitor you have. Bitmap fonts look crisp on any low-resolution monitor.
- tshaddox 5y agoThis is a huge disappointment in the computer monitor space, and not just because of text rendering! It’s such a bummer that Apple’s Retina displays on Macs didn’t make lead to high resolution displays taking over in the desktop market. My $2000 iMac from 2015 is still my best desktop monitor, and there’s still no remotely affordable equivalent options on the market except the LG 5K that Apple sells (which is well over half the cost of a new iMac).
- ayushnix 5y agoI've resigned to cynicism when it comes to certain things such as IPv6 and integer scaling HiDPI monitors. I doubt I'll see either of them for the next decade or two, perhaps more.
- Asooka 5y agoLinear which RGB? I'm being pedantic here, but this will start being a problem as wide gamut displays become more commonplace. A colour space such as sRGB is first a definition of where in CIE space the three primaries are, and then a transfer function for how linear values can be encoded in various formats. For fonts, you should probably render them in 16 bit, keeping only coverage data, i.e. linear alpha channel only. Then you can composite in the same linear colour space as your display, but with more bits per pixel. This wasn't done in the past, because it needs custom shaders for the compositing and requires quite a lot of memory. Another option would be to rasterise directly in the final buffer, GPUs are powerful enough these days to render vector graphics in a shader. Or you could go the Direct Write route and discretise the vector outlines to triangles and let the built-in AA handle it. In short, I think we're at the point where either you're writing for a system that can handle rendering everything in 16bpc half-float linear colour, or it's so weak that pixel fonts are the most you can do. Either case doesn't suffer from gamma issues, as you apply the gamma only in the final step.
- DiabloD3 5y agoI understand what you mean, as I too have said these things. Linear RGB in the sRGB/Rec 709 color space is the correct interpretation. Monitors that are not sRGB/Rec 709 primaries with a Rec 1886 gamma ramp (as opposed to the exactly defined sRGB gamma ramp, please stop using this) outside of a strictly color-managed workflow should be replaced with ones that are. Now, if your UI compositing system is modern, then yes, just output 16 bit linear and let the OS's color management handle it (ie, Vista and up using modern APIs, which is what DirectWrite does); however, the majority of software devs only understand "2.2" or "sRGB" (which is incorrect; Rec 1886 pragmatically is 2.35, sRGB matches 2.35 inside of the 16-255 range; sRGB has never been 2.2, it is 2.2 with an offset of 16 starting at 16, with 0-15 being linear), ergo, I wrote this with the average software dev in mind.
- bjourne 5y ago> The fix, honestly, is moving to 200% resolution screens (such as 4k 24" replacing everyone's 1080p 24", or 2880p 27" replacing everyone's 1440p 27"), GNU/Linux is supposed to be usable even on old hardware so that is not a good solution. There are many ways to improve font rendering for low-dpi screens but maintainers are often unwilling to invest time in that because it makes the rendering algorithms more complex and they reason that most will get high-dpi screens eventually. There used to be a patchset called Infinality for FreeType and FontConfig that significantly improved subpixel rendering. It was discontinued as some (but not all) of its improvements were merged into FreeType. On Windows you can tune the subpixel rendering parameters using a configuration tool. That's something I wish existed for Linux desktops because screens, peoples' tolerances for color fringing, and light settings are all different. Unfortunately FreeType's subpixel rendering parameters are hard-coded in the source and can't be configured.
- ghusbands 5y ago> On Windows you can tune the subpixel rendering parameters using a configuration tool. Hasn't worked for me for a long time. At least insofar as choosing the grayscale results consistently until the tool shows only grayscale doesn't actually result in grayscale text elsewhere. Also, if you rotate your screen, it still keeps the original bgr vs rgb setting. Subpixel rendering is generally a bit broken everywhere. It's especially pleasant when it's used and then scaled-up by the OS, making the fringing no longer subpixel.
- mooman219 5y agoI wrote a small non-shaping rust rasterizer for geometry (Live demo https://mooman219.github.io/fontdue/ https://mooman219.github.io/fontdue/ ). I definitely agree that higher density screens are the solution, but bad AA and linearization can really reduce glyph quality well before then.