Visual perception, raster displays

CS 248 - Introduction to Computer Graphics
Autumn Quarter, 2008
Marc Levoy
Lecture notes for Thursday September 25


Table of contents:

Note: There is more detail in these notes than I covered in my lecture today, mainly on the topic of CRTs. As I mentioned in class, it is no longer worth spending much time on that increasingly obsolete topic. You are not responsible (e.g. on the exams) for material I don't cover in class. For most classes, the written notes will follow the lectures more closely.



Press here for the Powerpoint slides I showed in class about triads and pixels ( PPT or PDF). Reiterating the explanation I gave in class, in the case of the integral pixel font on the LCD, the pixel outlined in yellow is blackened because the stroke covers more than some threshold percentage of the pixel's area; otherwise, it would have been left white. Blackening the pixel turns all three of its color stripes (R,G,B) black. In the antialiased font, the outlined pixel is darkened in proportion to the percentage of the pixel's area that covered by the stroke. Again, all three of its stripes are darkened equally. However, notice that the stroke covers only the red stripe (mostly) and the green stripe (partially); it doesn't cover the blue stripe at all. The subpixel font takes advantage of this fact by adjusting the color of the pixel such that each of its three color stripes are darkened in proportion to the percentage of that stripe's area that is covered by the stroke. Thus, the red stripe is darkened the most, the green stripe is darkened only a bit, and the blue stripe is left untouched. This combination of darkenings corresponds to some RGB color, which is loaded into the frame buffer for this pixel. Thus, the three color stripes within a pixel are not individually "addressable" in the sense of having their own coordinates; they are addressable by employing the trick of adjusting the color displayed in that pixel.

As I mentioned in class, subpixel font rendering technology only works if the alignment of pixels to color stripes can be guaranteed. In other words, it works on an LCD, but not on a CRT. My example assumes that the text is black on a white background, but the technology also works for a colored text and/or background. Of course, if the text is pure red on black, then we have only the red stripes to play with, and subpixel fonts gain you nothing. By the way, it's hard to properly explain this technology before we've covered rasterization and antialiasing. It would be worth your while to come back and take a second look at this slide in a few weeks.

So assuming you're using an LCD, which computer system vendors use subpixel font rendering? Microsoft does, at least in Vista. Mac does too, at least in Leopard (OS 10.5). However, if you tell the Mac (in the Displays control panel) that you've rotated your monitor by 90 degrees, so that the subpixel stripes run horizontally instead of vertically, Apple wisely knows that this would break the rendering algorithm - producing horrible visual artifacts. Their solution is to revert to simple grayscale antialiasing. Fortunately, as the spatial resolution of displays grows (my 30" monitor has over 100 dpi), subpixel font rendering matters less and less. On such monitors, grayscale antialiasing looks nearly indistinguishable from subpixel font rendering.

For more information on this fascinating technology, look at http://grc.com/cleartype.htm. For a discussion of font rendering on the Mac, see this blog.



Section D requires an understanding of Fourier analysis, which we won't cover until Oct. 2, but in case you're interested...


I covered part I (flicker sensitivity) when I discussed persistence in CRTs. I didn't cover parts II or III, but the ideas are obvious. As I said, you are not responsible on the exams for material I don't cover in class, and for most classes, the written notes will follow the lectures more closely.

So how many bits do we need per pixel?

Click here to see a demo that addresses this question.
Make sure you view this demo on a gamma-corrected monitor, as the instructions say.

By the way, if you want more gory details on gamma correction as practiced by different computer vendors, with particular attention paid to the Mac, see this great article by Charles Poynton on Gamma correction on the Apple Macintosh.


levoy@cs.stanford.edu
Copyright © 2008 Marc Levoy
Last update: September 25, 2008 05:14:31 PM