mmcirvin: (Default)
[personal profile] mmcirvin
My adapter cable arrived, so I'm now running my new LCD over a wondrous DVI connection.

(My G4 is from the era when Apple insisted on using their own digital monitor interface, ADC, which had the advantage of being able to supply power. Fortunately going from ADC to a DVI monitor seems to be an easy matter of connecting pins, though going the other way takes a more expensive adapter, probably because of the power issue. Since then, Apple seems to have capitulated and gone back to DVI; like most of Apple's moves toward standardization on commodity hardware, it eliminates a lot of interoperability and replacement headaches at some small cost in elegance. Probably to the good, on the whole.)

I was wondering if I really needed the DVI cable after looking at output over the analog connection, but DVI is actually better. Sharpness is no different as far as I can tell, but what's missing now is the just-perceptible dark ghosting to the right of certain text characters.



The monitor is sharp enough to make jaggies in diagonal and curved lines perfectly evident at 1600x1200, so antialiasing (the use of intermediate-brightness pixels to soften jaggedness and other irregularities) really helps. With an LCD, you can get a benefit from sub-pixel methods. The idea is that on an LCD monitor (unlike a CRT), the screen is actually organized into physical pixels, and each pixel is divided, usually horizontally, into red, green and blue elements. So when you change the color of a pixel, you're also subtly changing the spatial portion of it that is illuminated, and by being clever about tweaking colors around the edge of a text character you can render its outline at a resolution that is effectively greater on the horizontal axis. Relative to other antialiasing methods, it reduces somewhat the usual tradeoff between blur and jaggies.

I use a Linux laptop elsewhere, so I'd spent a lot of time looking at the open-source FreeType's sub-pixel output already; now I can compare regular and sub-pixel antialiasing side by side (by changing the system preference and opening the same page in different Web browsers, for instance), and check out Apple's Quartz version. The major perceptual effect of subpixel antialiasing, to me, seems to be that small strokes look much darker without being any jaggier. Comparing text rendered black-on-white with the LCD and CRT methods side by side, the CRT-antialiased text looks noticeably lighter in color.

Though I ought to be used to it by now, I'm also always amazed that I don't see any rainbow fringes around the edges of the characters when they're displayed at normal size. I suspect that part of this is the low spatial resolution of human color perception (after all, I don't see the RGB elements in a white field either), and part of it is specifically the fact that the elements are arranged red-green-blue, so that the fringes are red on one side and blue on the other: my experiments creating color composites of Cassini raw images have taught me that fringes of this sort are much less noticeable than when they're any other color. Though I haven't looked at the research on this, I suspect that the human visual system has evolved to edit minor red/blue fringes out as a natural correction for chromatic aberration in the eyeball.



Though it's partly that I'm running at a higher resolution than in the early days (though not as high in DPI terms as with my older, physically smaller monitor), I have to say that on the whole it all looks very good now. When I wrote about the early quirks and pitfalls of Mac OS X antialiasing back in 2002, Quartz font antialiasing used no subpixel tricks and was completely or almost completely unhinted (I explained what that means in the old article: in essence, the font outlines had not been adjusted to fit the pixel grid). So different typefaces were recognizable even at very small sizes but the letters were often gray and blurry. Since then, Apple's made two major improvements: the option to use a somewhat adjustable subpixel method on LCDs, and the addition of a slight degree of hinting, which as far as I can tell is mostly on the horizontal strokes (which would not benefit from subpixel effects).

Foley and van Dam's Computer Graphics: Principles and Practice, an otherwise indispensable text, suggests that antialiasing eliminates the need for font hinting. This is incorrect. One way to think of it is that font rendering can be described as the interaction of two tradeoffs: jaggies vs. blur, and overall readability vs. typeface aesthetics. Antialiasing has to do with the first tradeoff, hinting with the second. Aggressively hinting characters will lessen (though not eliminate) the degree to which you have to worry about the first tradeoff at all, at the expense of making every font look anonymous and squarish at small sizes. If you don't use antialiasing, hinting is absolutely necessary at low resolution; but even with antialiasing it can have advantages in reducing blur and grayness.

Different implementors have chosen different points in this continuum over time, and preferences are largely a matter of taste. People like to talk about the difference between Microsoft antialiasing and Apple antialiasing, but the real differences are in the hinting, and the battle lines aren't drawn exactly where people think they are.

Today, both Windows PCs and Macs usually use TrueType fonts (I'm glossing over lots of details here, but you can think of it that way; there's a maddeningly persistent myth that "Windows uses TrueType and Mac uses PostScript" that is an oversimplified version of practices from over a decade ago, but "both use TrueType" is a more accurate oversimplification today).

TrueType was the creation of a consortium that included both Microsoft and Apple. I believe that the hinting algorithm currently used in Windows for TrueType fonts is descended from an old one originally written (and partly patented, causing legal headaches to this day) by Apple! Modern Mac partisans like to deride it as crude, but in a sense, it is more sophisticated than what Mac OS X does now. It relies on a kind of program code embedded in the font file itself, and was designed for low-resolution screens with no antialiasing, so for typical fonts, it is extremely aggressive at distorting shapes to fit the pixel grid. Fonts rendered this way look sharp and readable, but unless the size is so large that the hinting doesn't matter, they are not particularly beautiful. They become squarish to the point that you sometimes can't tell whether or not they are being antialiased unless you look closely.

Essentially the same hinting algorithm was used on Macs running Mac OS 7/8/9, and it was also used in early versions of Mac OS X by most applications running under the Carbon framework (it actually had to do with QuickDraw vs. Quartz; the gory details are in that old article). Mac OS 8, 9 as well as X could actually antialias fonts that were rendered this way, though I suspect that, as with Windows, many users never realized it was happening.

Apple's initial change for Mac OS X's Quartz rendering was not to introduce antialiasing, as is commonly believed, but to throw out the hinting. This made the effect of antialiasing much more noticeable: suddenly the character shapes closely matched the printed page, but they also got gray and blurry. If the screen resolution is sufficiently high, this is probably a better or at least prettier strategy than retaining the full TrueType hinting, but Apple was working a little bit ahead of the technological curve and the degree of blur irritated many users. It also meant that there were rare situations in which somebody actually turned off the antialiasing but the hinting was still off, and the characters looked like utter crap.

I suspect that Apple is still ignoring the TrueType hinting codes in the fonts (so that now, most of the time, Microsoft is using Apple's patent but Apple isn't). The subtle hinting they've put back in seems to be some kind of simple automatic algorithm that just detects horizontal edges and adjusts them so that they lie on pixel boundaries. FreeType can do something similar for people who want to work around the patent issue, though its adjustments are larger and it tweaks vertical strokes too. When Apple's current auto-hinting went in, probably in Panther (I forget), the most noticeable change in appearance was that letters like O and D in Lucida Grande changed slightly in shape, stretched a little so that their tops and bottoms were better positioned relative to the pixels. At the same time, the blur went incrementally down.



In related news, the Wikipedia article on font hinting is a miserable stub, and I think I need to write a real one.

Date: 2006-03-11 10:26 am (UTC)
From: [identity profile] pentomino.livejournal.com
I wonder what the effect is when you zoom in on this antialiased text with MacOS X's built-in zooming feature. (I don't think my old iBook did it, but it was using Panther and had a G3 processor.)

Date: 2006-03-11 10:29 am (UTC)
From: [identity profile] mmcirvin.livejournal.com
The fringe pixels show up as pastel-colored. Of course, the zoom doesn't magnify the individual color elements of your LCD, so the relationship with what actually appears at normal size is complicated.

Date: 2006-03-11 11:08 am (UTC)
From: [identity profile] mmcirvin.livejournal.com
In my historical overview, I forgot to mention that Adobe and Microsoft had subpixel antialiasing before Mac OS did. For a little while, the one place where you could see it on Macs was in Acrobat Reader.

Also, there's the parallel story of PostScript Type 1 fonts and Adobe Type Manager (which brought screen antialiasing to Macs before Apple did it with TrueType, and had a somewhat different take on hinting and antialiasing), but that would have been a major digression...

Date: 2006-03-11 11:48 am (UTC)
From: [identity profile] mmcirvin.livejournal.com
...and then there's that whole argument over whether the Apple II had subpixel rendering before its generally accepted invention by IBM, which the Wikipedia article covers better than I could...

Date: 2006-03-11 11:15 am (UTC)
From: [identity profile] mmcirvin.livejournal.com
Also, here is a great primer on TrueType hinting on Microsoft's site (http://www.microsoft.com/typography/tools/trtalr.htm).

Date: 2006-03-13 08:33 am (UTC)
From: [identity profile] paracelsvs.livejournal.com
I can't say that I've looked at any 1600x1200 displays, but on my 1280x1024 LCD display, sub-pixel rendering causes some very noticable colour fringing, and I really can't stand to look at it. My eyesight is not very good, but it still looks like some sort of typographical puke. I disable it everywhere it turns up.

What I wonder, though, is what exactly BeOS did for its font hinting. I recall being very impressed with the text rendering it did. I think it hinted very aggressively, and then antialiased, and the results were very sharp and readable. I really wish OS X would hint more. I also wish there was better control over when to antialias and when not, because I like coding in Courier, but both Courier and Courier New are pretty much unreadable with the standard OS X antialiasing - one disappears into a thin mist of light grey lines, and one is extremely blurry and bold.

Date: 2006-03-13 04:27 pm (UTC)
From: [identity profile] mmcirvin.livejournal.com
Actually, I think my experience is similar with my parents' lower-resolution LCD connected to a Windows box.

It may be that the efficacy of these schemes depends sensitively on the spatial resolution; around 100 DPI it looks pretty good, not so good if it's significantly lower. One thing that surprised me is that the skinny Courier is actually readable on my current display, though it's still too light.

Wrong subpixel order?

Date: 2006-07-07 10:13 pm (UTC)
From: (Anonymous)
I would think that the subpixel order is wrong...

Even on a 1024x768 there should be more or less no fringing.

June 2025

S M T W T F S
1234567
89101112 1314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jun. 14th, 2025 06:01 pm
Powered by Dreamwidth Studios