7

While 8 or 16 colors can offer a relatively satisfying result of dithering, 4 color palette results varies. Below are some acceptable results.

Raw
BBC micro mode 2 8 colors BBC micro mode 2 8 colors
NES 4 color full screen NES 4 color full screen
CGA mode 04h Bright 2 CGA mode 04h Bright 2
via https://8bitworkshop.com/dithertron/

So what 4-color combination can give the best color fidelity without knowledge of image input? Or more specifically, which four colors can provide the greatest coverage of color-space and can offer even distribution of possible colors in that color-space with, say, 4x4 matrix Ordered Dithering algorithm?


Comment: The problem can be reduced into both optimizing the posture then maximizing the volume of a Tetrahedron into a #RRGGBB Cube with all 4 vertices inside the cube, which has to be it since the limitation of circuitry(or were there a workaround back in the day allowing the expansion of brightness range?). The first impression came to me which would be RGBW, but that failed to cover bright Cyan, Yellow and Magenta thus not seems very convincing to me. Maybe a little rotation would be better?

enter image description here

2

1 Answer 1

5

This seems nominally Retrocomputing, because there were plenty of computers that only offered a 4-color palette - or even just 2-color - at times. However, without reference to an actual production system, I'm skeptical that there were many, if any, practical systems using arbitrary colors in a small palette. See below for an actual implementation - Apple IIGS.

Typically a 4-color palette used 4 system-defined colors, with no easy way to change them. For example, IBM CGA had a 4-color 320x200 display mode. In this mode, each palette/intensity selection, which applied to the entire screen, used 4 colors from the standard 16-color system palette. Each 4-color palette included 3 fixed selections (green/red/yellow, cyan/magenta/white or cyan/red/white) plus one more color from the 16, which defaulted to black. You picked a mode and palette for your software from what you had available, and that was that. No tweaking of the R vs. G vs. B.

Later cards such as EGA allowed for selection of each color in a palette. However, those same cards typically skipped over the 4-color modes. For example, EGA modes included 640x350x2 (monochrome has its advantages at times in terms of speed and memory usage) and then jumps to 16 colors at various resolutions.

In the hypothetical sense of "what would be best", logically a 4-color palette matching the native mode of the device would be best. Which for most consumer devices from the past 40 years means:

  • Red, Green, Blue, Black for monitors
  • Cyan, Magenta, Yellow, White for printers

In each case, all other colors are built up from the primary colors, including white on monitors or black (except really a muddy gray) for printers (which is why printers normally have 4 colors - CMY + black (K) - but that would be a minimum of 5 colors - Cyan, Magenta, Yellow, Black, White (no ink)). *Except as pointed out in a comment, if you fill in a monitor at native resolution with an even mix of red pixels,green pixels and blue pixels, you get an overall "white" effect (at high enough resolution, at least) but really a muddied (possibly colorful, depending on the monitor and resolution) gray because it will be at ~ 1/3 the native white brightness of the monitor.

In fact, with printers it generally is a binary mode for each color - you can increase resolution or change the printed dot size, but you really can't say "50% cyan, 25% magenta, 10% yellow". On monitors it is different as both CRT and LCD monitors can vary the intensity of each pixel.


Apple IIGS to the rescue!

A bit of poking around and I found that the Apple IIGS includes a 4-color user-defined palette. According to Wikipedia, it included:

640×200 (4 colors, selectable from 4,096 color palette)

Presumably (I haven't verified, but nothing else makes sense) the 4,096 color palette is 4-bits (16 levels) for each of Red, Green, Blue.

That being said, if I had absolutely no advance knowledge of the contents of an image, I'd still go for Red, Green, Blue, Black as the universal 4-color palette. There may be some advantage to a particular intensity of Red vs. Green vs. Blue based on human vision, type of monitor, etc. but full intensity Red, Green and Blue plus Black (i.e., #FF0000, #00FF00, #0000FF, #000000) is certainly the easiest way to go.

16
  • 1
    I would think it fairly likely that at least some machines with 4-color graphics would have used something like a 4x4 register file to turn a two-bit index into a 4-bit color selector, since doing so would take much less circuitry than approaches like those in the CGA, while offering much more versatility. The 4x4 register file chip is used on the IBM PC motherboard, so it would have been familiar to at least some computer designers of that era.
    – supercat
    Dec 14, 2022 at 16:15
  • 1
    I think the Bally Astrocade allowed arbitrary four-color palettes, as would arcade machines like Missile Command. Not sure how they were implemented, though. There were lots of 8-bit computer designs, so it's hard to know all the designs they used.
    – supercat
    Dec 14, 2022 at 16:51
  • 3
    Electronika BK-0010 used the fixed red-green-blue-black palette.
    – Leo B.
    Dec 14, 2022 at 17:24
  • 2
    The BBC and Electron offer any four out of the TTL eight in four-colour modes; the Amstrad CPC offers any four out of 27 (i.e. 3*3*3); the Enterprise any four out of 256; the Sam Coupé any four out of 128…
    – Tommy
    Dec 14, 2022 at 18:42
  • 2
    8 colors = 3 bits really makes things tremendously easier because then you get black + RGB + CMY + white - which at a high enough resolution can get simulate anything (within the color gamut of the monitor). But that needs 3 bits. Which isn't the question, and which I don't know if I've seen - 4 bits - often RGB + intensity but can also be a selectable palette, is very common. 3 isn't a power of 2 so we don't see it so much. Dec 15, 2022 at 3:32

Not the answer you're looking for? Browse other questions tagged .