Fringes

A screen has a fixed budget, and colour and horizontal detail are both drawn from it. Two machines twenty-one years apart noticed the same thing and went opposite ways with it: one spent detail and got colour, the other spent colour and got detail. Both are in patents, both are arithmetic on a clock, and both leave coloured edges behind.

New to drawing on a screen? Start here

A grid of dots on a clock

A screen is a grid of coloured dots, redrawn from top to bottom on a fixed beat. Everything drawn on it is a decision about which dots and what colour, made before the beat arrives.

The clock is the part that makes this hard. It does not wait, and it does not care whether the drawing was finished, so a picture that took too long is shown half-done. Most of the machines in this topic exist because of that deadline rather than because of the picture.

The machine for this idea on its own is Eight Sprites, if you would rather press it than read about it.

A computer only has numbers

There are no letters in a computer, no colours and no sound. There are numbers, and an agreement about what a given number means. The letter A is a particular number because a committee said so, and for no other reason.

That agreement is an encoding, and the interesting part is never the table. It is what the table costs: how many bits each symbol takes, which symbols were favoured, what happens to the ones nobody thought of, and whether you can start reading in the middle. Every machine in this topic is an argument about that cost, settled differently.

The machine for this idea on its own is ASCII, if you would rather press it than read about it.

One exchange rate, run forwards, sideways, and backwards

1 Spend: bit patterns beat against the colour subcarrier and buy colour with resolution

The Apple II has no colour hardware. It shifts bits out of a byte at a rate the colour subcarrier divides exactly, and a television cannot tell a deliberate colour signal from an accidental one. Every number below comes from one crystal.

Seven dots in a byte

180°180°180°

3 lit dots, showing green. A lone dot carries the hue of its phase; a dot with a neighbour is part of a white run.

master clock
14.318180 MHz
colour subcarrier
3.579545 MHz, the clock over 4
dot rate
7.159090 MHz, the clock over 2
dots per colour cycle
2, so one dot is 180° of phase
what it costs
140 colours across a 280-dot line

2 Smear: a CGA screenshot sampled as RGBI is not what the monitor showed

The same mechanism, at twice the dot rate, on a different machine. CGA's 640-wide mode clocks dots at the full 14.318 MHz, which puts four of them in a colour cycle instead of two, so a four-dot pattern is one whole turn of phase and there are sixteen of them. A two-colour mode that a composite monitor decodes into sixteen. Screenshots of that era were captured from the digital side, where those sixteen do not exist.

16 four-dot patterns, each a different mixture of phases, out of a mode that has two colours.

dots per colour cycle
4, so one dot is 90°
patterns in one cycle
16
and the shape is wrong too
320×200 on a 4:3 screen is a pixel 1.2× taller than wide

3 Reverse: an LCD subpixel buys resolution with colour, which is the same trade backwards

An LCD pixel is not a dot. It is three separately addressable coloured lights in a row. Ask how much of each stripe a letter's stem covers, rather than how much of the whole pixel, and you have three times as many horizontal positions. Drag the stem: on a pixel boundary nothing fringes and nothing is gained, and everywhere else you are paying in colour.

On a pixel boundary. Nothing to gain here and nothing paid: all three stripes are lit the same, which at the size a pixel really is would simply be white.

positions available
18 across 6 pixels
colour spent
none
ink on the row
1.000, the width of the stem

4 End: the shortage eased, and macOS removed the trick

Both halves of this page are answers to a shortage. When the shortage went away, so did the answer. Nothing else on this site has an ending like it.

Subpixel rendering is worth doing when a stem is about as wide as a pixel. Trebling the horizontal positions on a display that already has more pixels than the eye can separate buys nothing, and the colour is still paid. Apple removed subpixel antialiasing from macOS in Mojave in 2018, six years after the first Retina laptop. High pixel density is the reason usually given and it is not the whole one: Apple’s own account at WWDC 2018 also points at the range of panels and scaling modes a modern system has to draw on, where a fixed assumption about the order of the red, green and blue stripes stops being safe. Subpixel rendering has to know that order, and rotating a monitor is enough to invert it. The Apple II's trick ended more simply: composite video went away, and on anything with a digital connection those hi-res colours are not there at all.

Why it is one mechanism and not two

Both machines are exploiting the same gap: a display can be addressed more finely than it can be addressed in colour, or more finely in colour than in position, and whichever one you are not using is available to spend. The Apple II had a black-and-white shift register and a television that decoded phase as hue, so it spent position and received colour. An LCD has three coloured stripes where the software assumes one grey dot, so ClearType spent colour and received position.

The arithmetic is the giveaway. On the Apple II the colour resolution is exactly the dot resolution divided by the dots in a colour cycle: 280 over 2 is 140. On an LCD the position resolution is exactly the pixel resolution multiplied by the stripes in a pixel: 6 pixels times 3 is 18. Same fraction, other way up.

What the patents actually say

Wozniak's patent describes the whole thing in one clause: video colour signals are generated directly from digital information rather than by the colour-encoding circuitry a television station would use, and the shift register's output provides either a green or violet display depending on which phase the dots land on. Two hues, one bit of phase, no colour hardware.

The ClearType patent's complaint about everything before it is equally direct: in prior systems, luminous intensity values for all the pixel sub-components of a pixel element are generated from the same portion of an image. Three lights, one question asked of them, two thirds of the addressability thrown away.

These ran in this browser when the page loaded. Each claim, whether it held, and the number behind it.

Each claim, whether it held, and the values behind it
claimheldmeasured
the master oscillator over 4 is 3579545.0 Hz against the NTSC subcarrier's 3579545.5 Hzyeswithin 0.45 Hz, and the subcarrier figure is computed as 315 MHz over 88 rather than typed
there are exactly 2 dots per subcarrier cycle, so one dot is 180 degrees of colour phaseyeswhich is why alternating dots are a colour signal and why moving a pattern by one dot changes the hue
colour costs half the horizontal resolution: 280 dots across become 140 colour positionsyesa colour needs a phase and a phase needs two dots; the number is divided rather than looked up
at the CGA dot rate a cycle is 4 dots, so a two-colour mode decodes into 16 coloursyesa screenshot taken from the digital side records the two and none of the 16
over 200 stem positions subpixel rendering triples the places a stem can sit and never changes how much ink is on the rowyesworst ink difference 1.8e-15; 200 of those positions fringe, and whole-pixel rendering fringes at none of them, which is what it is paying for

What is real here, and what is not

This page cannot know your screen, and stage three assumes one

Subpixel rendering only works if you know the physical order of the stripes, and this page does not. It assumes red, green, blue left to right, which is the common case and not the only one. Rotate a monitor into portrait and the stripes rotate with it, so the order becomes vertical and the whole technique stops applying. Most OLED phones are PenTile and do not have three equal stripes in a row at all. So the pixels here are drawn enormously and labelled: this is a model of a screen, not a picture of yours. If you look closely at your actual display and the stripes are in a different order, the model is what is wrong.

Three equal stripes is what white looks like, magnified

A pixel here is drawn about a hundred times its real size, so when its red, green and blue stripes are all fully lit you see three coloured bars rather than one white dot. That is not a fringe and nothing has been spent: at the size a pixel actually is, the eye cannot separate them and they add to white. The fringe is what happens when the three stripes are lit by different amounts, which is what the colour-spent figure in the readout measures. On a pixel boundary it reads none, and the bars are equal.

Which hue sits at which phase is a convention here

The page puts violet at zero degrees and green at a hundred and eighty because the patent names that pair and the phases are what the arithmetic gives. Which of the two lands where depends on the receiver's reference against the colour burst, which is exactly what an old television's tint knob adjusted. What is derived and not conventional is the relationship: one dot of movement is half a turn, the high bit is a quarter turn, and two adjacent dots have no alternation and therefore no hue.

The colours are named, not rendered accurately

Turning a phase into a specific red, green and blue triple needs a model of a particular receiver, and every receiver was different. The page names the four hues and shows the phase each one comes from; it does not claim the swatch on your screen is the colour your television would have produced. The mechanism is exact and the appearance is an illustration.

The Apple II clock is not exactly the NTSC subcarrier

NTSC's colour subcarrier is exactly 315/88 MHz, which is 3,579,545.45 Hz. A 14.31818 MHz crystal divided by four gives 3,579,545 Hz, about a tenth of a part per million low. A receiver's colour loop pulls that in without noticing, so it makes no practical difference, and the page shows the rounded figure the parts were sold with rather than pretending the two numbers are the same one.

Stage three is a model of coverage, not a font renderer

Real subpixel rendering filters the coverage across neighbouring subpixels to keep the fringes from being as loud as the raw arithmetic makes them, and the details of that filter are most of what makes one implementation look better than another. This page shows the unfiltered coverage, because that is where the trade is visible. It also draws a plain rectangular stem rather than a letter, since a letter's shape would be the interesting thing on screen and the stem is what the argument is about.

No screenshot here is a screenshot

Stage two is about captures of CGA output being wrong, so it would be a poor joke to illustrate it with one. What is drawn is the pattern-to-phase arithmetic, which is the part that can be stated exactly. If you want to see the difference on real software, an emulator with composite output modelling will show it far better than any static image could.

Sources