An RGB Image Containing All Possible Colors

Here is an 8-bit per channel RGB TIFF image file containing exactly one pixel of each of the 16,777,216 possible color values. The image is 4096 × 4096 = 16,777,216 pixels, arranged as 256 slices of the RGB color cube. It is not tagged with any profile. This image may be useful for investigating the effects that image processing or color transformations have on the number of colors in an image.

Although the image contains 16 million pixels (a 48 Mb uncompressed image), it compresses very nicely, resulting in a surprisingly small download file. Click here for a ZIP download (53K) or here for a SIT download (36K).

I have added a PNG version also.

Example: RGB-to-Lab Quantization Loss

Suppose you assign the sRGB color space profile to this image. It would then contain 16,777,216 unique sRGB colors. If you changed its color mode to Lab (in Photoshop using a Relative Colorimetric rendering intent) and analyzed the Lab result, you might be surprised by what you find. The number of unique Lab colors has been substantially reduced, down to 2,186,578 unique colors — only 13% (about one-eighth) of what we started with. All of the loss may be attributed to quantization, that is, multiple unique RGB colors collapsing into a single Lab color. We know that no clipping occurred, since in this test, the range of a* is -79 to 94, and the range of b* is -112 to 93 (Photoshop's Lab representation is limited to the range -128 to 127 for these components, so there is the possibility that in some other experiment some colors could be clipped, as discussed here).

An interesting aside gives us a fairly reasonable estimate of the sRGB gamut volume, in cubic ΔE units as 857,482 (obtained by scaling 2,186,578 by 100/255). This estimate assumes that there are no voids in the Lab respresentation (a reasonable assumption given that the quantization is 8:1).

If we convert this Lab version of the image back to sRGB, we find that the number of unique colors does not significantly decrease further. It reduces minimally to 2,186,238. This "regenerated" sRGB still spans the full RGB range of 0 to 255, but it now has holes in it, like Swiss cheese (in this particular example, we have 87% holes and only 13% cheese).