Friday, June 4, 2010

More colors on a mobile device = bad?

Intuition says that more colors is better than fewer colors, right? Many mobile devices use size of the color palette as a marketing point. The hotly anticipated new Android phone, the HTC Evo 4G, has come under criticism for supporting "only" 65K colors (16-bit) while the competition (iPhone) supports 4 times as many (18-bit or 262,144 colors).

Are these colors really necessary? Is there any reason why would a new flagship model have only 1/4th of the colors of the reigning champ? Mike Calligaro from the Windows Mobile Team Blog has the answer.

First, it is very difficult to efficiently utilize the circuitry needed to drive 262,144 colors. This many colors requires 18 bits (2^18) per pixel. These data bits are held in a specialized memory location called a frame buffer. They are fed to the frame buffer by the CPU (or perhaps a GPU). Nearly all mobile devices work on a 32 bit CPU. Nearly all modern processors are designed around powers of two, and that is why we commonly see 32 and 64 bit processors today. One register in a 32 bit CPU can store the data for 2 pixels, with no wasted space in the register, and operations can be performed on two pixels in a single pass. Processing an 18 bit pixel with a 32 bit CPU means that only one pixel can be fit in the data register and 14 bits (32-18) of the computational cycle is wasted. One way to combat this is with sophisticated programming and circuitry to spread a portion of the next pixel over the remaining CPU space. This difficulty is explained more thoroughly in the blog post.

So what does this mean? This means the CPU has to do significantly more work to drive the same number of pixels for these extra colors. Mobile devices in particular are often CPU constrained in an attempt to save energy usage and meet a target cost. Wasting CPU power on extra colors could result in sluggish performance.
(click to enlarge)

Secondly, after a point the number of colors means little more than a line of marketing propaganda. The screens on mobile devices are typically 3.5" to 4.3" at best. Even at larger sizes it is often impossible to distinguish between the higher color depths. The Windows Mobile Team Blog has provided a very simple app which encodes a 24-bit source image into 18, 16, and 12 bit color depths. The 12 bit is quite noticeably poorer in color fidelity, but the remaining images are difficult to distinguish, and almost certainly not worth the performance hit that higher color depths require. So remember when comparing the specs on new devices that the numbers alone do not tell the whole story.