# Best 4-color palette for dithering arbitrary images on screen

Duplicate of this question since society of retro-computing closed it and recommended it to be moved here.

In the good ol'days many computers limit their palettes to 4 to 6 colors instead of 8/16/256/4096 or more, thus dithering was applied to offer a larger collection of choices.

While 8 or 16 colors can offer a relatively satisfying result of dithering, 4 color palette results varies. Below are some acceptable results via https://8bitworkshop.com/dithertron/, results with poor revivification omitted.

BBC micro mode 2 8 colors
NES 4 color full screen
CGA mode 04h Bright 2

So, what 4-color combination can give the best color fidelity on a monitor without prior 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: I cannot quite figure out the math, but guess 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 (not RGBK, which wouldn't work since dithering doesn't add up or deduct colors but mixes into a medium tone), but that failed to cover space near bright Cyan, bright Yellow and bright Magenta thus not seems very convincing to me (but dark gray seems fine to mimic black). Maybe a little rotation of the tetrahedron would do better?

Related Question: Theoretical best colors for dithering

• Color does not obey rules of vector math, we can only build color systems that adjust one property at a time. Buy yes undobtedly the colors should be some combination of yellow-blue Red-green i would omit the cyan and magenta and choise a half color instead. Commented Dec 15, 2022 at 6:38
• I hesitate to answer this because "best" is just too subjective IMHO. I think some combination of RGB+white should work. The lack of black is problematic though. Might have to use darker shades of green and blue to compensate. an example. Commented Dec 15, 2022 at 16:59

I agree with your general analysis: in the screen’s RGB color space you would basically produce a tetrahedron subset of the RGB cube. There’s 2 tetrahedrons that tie with having the largest volume: Red-Green-Blue-White and Cyan-Magenta-Yellow-Black. That’s just largest volume in RGB space, for what it’s worth. Theoretically, you would look for largest perceptual gamut (eg largest volume in the Lab space, but in practice it is more important to consider what colors are most likely to occur in the typical images that you want to display.

In natural images (eg photographs) the red, green, white and black corners of the RGB cube are used more than eg. cyan or magenta, so starting with your proposed RGBW primaries, you might want to try shift the G a bit towards yellow and the blue towards black. Eg. Red, lime-green, dark blue, white.

But again, It all depends on the type of images.

As always. "Best" is a relative term.

I remember when a CGA drawing applications enable you to switch from Black, Magenta, Cian, and white to Black, red, green, and yellow. That was a big deal to draw a car. (Yes, I am not that young)

The simple theory will say that RGB+Black would do the job on a monitor (as CMY+White on paper, where the "black" is produced with the CMY inks)

This would be true, even if the values of the channel could not change (The same as the values of an ink droplet can not change)

The limitation comes with ,the resolution, viewing distances and the number of pixels you are willing to clamp into a group.

I think you are limiting this unit to a 4x4 block.

In offset printing you have this unit called LPI, where the levels of each color are given on the relationship between the resolution of the printer (DPI) and how many you use to produce an "LPI dot".

RGBW

Probably not. Again, you can achieve "white" by simply shooting RGB colors. On a monitor, you have clearly more limitations than on paper. You can not overlap colors or make them transparent.

Another limitation is the 4x4 block. This is not a multiple of 3, so in theory, you can not have a neutral gray. You could compensate with the color of the adjacent blocks.

Another interesting phenomenon is that our eyes tend to convert the colors into some other depending on how tired our eye cells are.

Google "there is no red on this coca cola can image" making this more difficult, because in fact for the phenomenon to happen, it needs white.

As with every limitation in life. Simply make a choice on what you are willing to sacrifice.

Seeing the LAB model would be understandable why they sacrificed Blue for Black in those CGA years because is the darkest color. Probably you could use some darker blue.

best color fidelity

This is another thing to consider. Fidelity on what?

You probably could average the colors of nature. Blue? Green? Sand? Black?

In real life, it is rare to see bright red, and pure fluorescent green for example, but again you will be sacrificing now the maximum brightest white.

Another option would be having a grayscale. White, black and two grays.

Most of the information we humans perceive is in levels of brightness, not in color.

• As I've said, dithering doesn't add up or deduct brightness, but average. You cannot get white with three pixels in red, green and blue because they all close two other channels and reduce brightness as a whole thus mix into dark gray, unless you turn up the brightness of the screen 3x which is not always possible. Commented Dec 16, 2022 at 0:04
• White is a relative term. It is most likely that you are now seeing this text on white background, and it is produced with RGB elements. Between the so-called subpixel and pixel, It is only a matter of size. Commented Dec 16, 2022 at 7:42
• @Rafael True, but Schezuk's point is that when you have to ditter Red, green and blue pixels, that two thirds of your subpixels will be off. Hence the resulting "white" would be 3x darker than your typical sub-pixel-composed white. Commented Dec 17, 2022 at 21:10
• @KrisVanBael well no. its just that you are adding too many pixels. You could treat your image the same way as subpixels. you just opt to blast to much color. If you ignore the energy balance theres nothing that you can gain in this situation. But if you treat your image as collection of subpixels you suddenly get all colors. Sure you lose brightness but thats the game in town. Commented Dec 17, 2022 at 23:19
• @joojaa true. But there are other options that sacrifice less brightness (at the expense of hue and saturation). It is subjective which is perceived as best “color fidelity on a screen”. Commented Dec 17, 2022 at 23:59