**One of Many: Countless Possibilities in the Arrangement of Pixels**

**One of Many: Countless Possibilities in the Arrangement of Pixels**

*A Photo and Essay*

Since we’re looking at infinity this week, I thought I’d discuss an idea that’s been bouncing around in my head for a couple of years: *There’s an arrangement of pixels for everything you can possibly imagine*.

It’s true. If you can imagine something visually, it can be depicted with a particular arrangement of pixels. Even more amazing than that:

*The number of different possible arrangements of pixels that can be saved in a digital image file, and what those arrangements might depict, is a number so vast that it can accommodate every real or imagined scene in the past, present and future. In fact, it’s a number so vast that it’s greater than the total number of subatomic particles in the universe.*

I’ll attempt to present this idea in a way that will require no advanced knowledge of mathematics, digital imaging technology or computer science. If you know what a pixel is, and are even slightly familiar with digital cameras and pictures, you already have a head start.

##### A Digital Image Refresher

When you look at a digital photo, or any modern digital image on a computer, you’re looking at rows and columns of small colored dots or squares, often called pixels, that when taken together and viewed from a little distance, combine visually to form the picture. If you’ve seen a mosaic of tiles, where each tile in a grid is colored differently so that an image is formed, you’re already aware of the effect. Pixels are just like the tiles in a mosaic, only smaller. In a full-color digital image, each pixel may be any one of millions of colors. To save and present pictures on computer screens and other displays, millions of pixels are stored in a file, in a particular order, and with a particular number of rows and columns.

It’s likely that you’ve heard the term *megapixel* by now. A megapixel just means a million pixels. So, a 5-megapixel image contains 5 million pixels, each one a certain color, with all of them arranged into rows and columns. In general, as the number of megapixels increases, so too does the quality and sharpness of the image.

##### The Idea

Consider some imaginary scene. It can be anything at all, as long as you can picture it in your mind. Be creative. *For whatever you conjure up*, there exists a corresponding set of pixels that depict exactly that. It could be a picture of your great-grandma doing a flip on a snowboard into the Red Sea, or it could be a 5-legged alien with a torch in a pincer, welding the last minaret to the top of a tiny model of the Kremlin.

It’s worth repeating. *For any picture you can imagine*, there is a corresponding set of pixels that could be ordered and saved into a digital image file. Since there are so many different things you can dream up, and since each of those can be depicted with a set of pixels, this leads to the question, “How many arrangements are there?”

Another way this could be asked is, “How many conceivable digital pictures are there?” The answer to this question is truly astounding.

##### The Math

The math involved in calculating the number of possible arrangements requires knowing the total number of pixels under consideration, as well as the number of different colors that each pixel can be. Different digital devices and image files can have any number of total pixels, and the number of colors that a single pixel can represent also varies greatly. To make the math relatively simple, I’ll use some nice round numbers for both the number of pixels and the number of colors available per pixel.

**Pixel Count (number of pixels)**

Digital cameras, and software for drawing or painting images with a computer typically produce files that contain between 1 million and 40 million pixels. Using the term megapixels, that would be between 1 megapixel and 40 megapixels. Images of only 1 megapixel are now considered poor quality, while 40-megapixel images are leading-edge. For purposes of this calculation, I’ll settle on 5-megapixel images. Partly because 5 million is a nice round number, and partly because it’s a good approximation of digital images that you see every day on the internet and in print.

**Pixel count = 5,000,000**(5 megapixels)

**Color Depth (number of colors per pixel)**

The number of colors per pixel in a digital image file also varies, and is often referred to as color depth.

In industry jargon, color depths are often expressed using bits. You may have heard terms like 24-bit color, or 36-bit, or 48-bit. Those are industry terms having to do with binary math and computer handling and storage, so I’ll ignore them here and instead use the more familiar decimal numbers. It happens that 24-bit color is rather common for the digital image files you see on your computer screen and devices, and it equates to just under 17 million colors per pixel. So, if you consider any one specific pixel in a digital image, it could be any one of about 17 million colors.

Imagine a rainbow that includes a wide range of colors including black, white, various greys, dark colors, pastel colors, and vibrant colors. Each one of those colors would have a specific number between one and 17 million. So, a particular dark red may be indicated by a number, 1,326,334 for example. A slightly darker red would be represented by a slightly different number. Every single pixel in a digital image can be any one of nearly 17 million colors.

In order to keep the math simple, and since very, very large numbers are involved, I’ll round that 17 million number down to 10 million. Besides making the math easier, it will make for a very conservative estimate. In other words, using 10 million colors per pixel in our calculation will give us a total that is less than the actual total, while still unbelievably large. Don’t worry, even using just 10 million colors per pixel results in a total that is truly mind-boggling.

**Color depth = 10,000,000**(10 million colors per pixel).

**Calculations**

If you imagine for a moment an image with only 2 pixels (pixel count = 2) that can each be one of 2 colors (color depth = 2), the math is easy. Take the number of colors the 1st pixel can be (2), and multiply it by the number of pixels the 2nd pixel can be (2), to get 4 possibilities: AA, AB, BA, and BB. If we add a 3rd pixel, we multiply by the color depth (2) again, to get 8 total possibilities. That includes the 4 we just determined, but with either an A or B at the end (AAA, ABA, BAA, BBA, AAB, ABB, BAB, BBB). As we keep adding pixels, we simply multiply our current total by the color depth, again and again for each additional pixel.

To calculate how many different possible arrangements of colored pixels there are for a given digital image format, we start with the color depth of the 1st pixel and multiply it by the color depth of the 2nd pixel, and so on, until we’ve multiplied by the last pixel’s color depth. For those more interested, this is a repetitive permutation (read more here).

In our example, we’d start with a color depth of 10,000,000 for the 1st pixel and multiply it by 10,000,000, the color depth of the 2nd pixel, and so on, until we got to the 5-millionth pixel.

Also, since we don’t really want to write out, “times 10,000,000”, 5 million times, we can use an exponent, a math shorthand that simply means, “multiply repeatedly this many times.” It’s written as a superscript, and for easy reading, let’s shorten color depth to C, and pixel count to P.

So, the final formula to make this calculation is:

**C ^{P} (or C x C x C x C…P times)**

You may know or recall that when multiplying by 10’s, 100’s and so on, there’s a trick where you can simply add the zeroes. Now you know why I chose nice even numbers, since we have to multiply 10,000,000 by itself 5,000,000 times. We don’t really want to do that the long way, so we start with a “1” and seven zeroes (10 million), and then add seven zeroes each time we multiply, 4,999,999 times. The reason it’s 4,999,999 and not 5 million, is that the 1st seven zeroes count for the 1st pixel, so we actually have 4,999,999 additional pixels, not 5 million.

**The Results**

In our case, C = 10,000,00 and P = 5,000,000, or 10,000,000^{5,000,000}

**The total result can be written as a 1, followed by 35-million zeroes, or 10**^{(35 million)}

##### A Few Comparisons

Let’s compare that to some other huge numbers:

- According to some quick searches, the number of subatomic particles in the universe is somewhere around 10
^{80}– not even close to our number. This means that if every speck of matter in the universe were used to make a giant hard drive, and every speck could store one image, there wouldn’t even be enough material in the entire universe to store all of the different possible 5-megapixel images. In fact, it wouldn’t be enough to make even the slightest dent. Using all the matter in the universe, you couldn’t even save a trillionth of a trillionth of a billionth of a millionth (and so on) of all the different images. - If all of humanity continually took different 5-megapixel pictures at a rate of ten-trillion a second, for a billion years, it still wouldn’t scratch the surface of how many different images are possible.
- Imagine all of the bubbles in every glass of champagne that has ever been poured, and that for each and every one of those bubbles, there’s a corresponding beach on a planet somewhere in the universe. All of the grains of sand on all of those beaches still wouldn’t add up to the possible number of arrangements of pixels in a 5-megapixel digital image.

We’ll never capture, or even imagine, everything that could be seen.

Very interesting! Great post 🙂

LikeLike

Thanks a bunch, Kayla. I love dreaming up scenes that represent some of the many possibilities.

LikeLike