The Universal Image

Generating every image possible. Or, limiting the infinite.

A small piece of code is powerful enough to generate whatever could happen in the perceived reality. Explore the boundaries of computation, permutation, and the visualization of every conceivable moment.

The Mathematics of Reality

All possible Images = Cartesian product of participating pixels.

  • Black and White - 8 bits per Pixel
  • RGB Version - 24 bits per pixel - Reverse Lookup enabled.

The 3x3 Generator Concept


// A small piece of code is powerful
function generateAll3x3() {
    const pixels = 9;
    const colors = 7; // Or 256 for B&W
    const totalImages = Math.pow(colors, pixels);
    
    for(let i = 0; i < totalImages; i++) {
        renderImage(i.toString(colors).padStart(pixels, '0'));
    }
}

Imagine owning every photo that has ever been taken...

The Concept

Imagine owning every photo that has ever been taken and that ever will be taken. To accustom your mind to the immensity of this concept, these photos will include a photo of you at every moment in your life at every possible angle. Now expand that to every living and dead person ever been on this planet. Add all plants, insects, animals, forests, mountains, rivers, deserts, cities. Now add every planet, star and moon that exists in this universe. Now include photos of these photos at every possible angle at every possible position in the universe. Even every CAPTCHA you’ve ever encountered.

Phew. Sounds like an infinite amount of photos, right? It’s not. It may be an extremely, extremely, extremely huge number but it’s not infinite and is technically achievable.

The Numbers

Take a 300x300 image for example. It consists of 90,000 pixels in total. Each one of these pixels has 16,581,375 possible colors to choose from. The picture’s size is 130KB. The pixels in the image is just one possible combination that a 300x300 image can make up.

To calculate the amount of images, we use Permutations. Specifically the formula n^r where n is the amount of colors (255^3) and r is the amount of pixels (width*height). For a 300x300 image, n is 16,581,375 and r is 90,000. That’s 8.4×10^649755 petabytes of storage required.

The Generation

The actual image generation is even more painful. It’s like trying to unlock a combination lock stuck on your suitcase but instead of 9 possible numbers on 3 discs, you have 16,581,375 possible numbers on 90,000 discs.

At today’s standards with the latest SSD and GPU, you could probably generate and write ~500mb per second. This would take a cosy 7.46 × 10^649754 years to complete. But what if we tweaked the numbers to be something more manageable?

Limiting Infinity

With 16 colors and 100x100 pixels, we have 16^(100^2) which is 1.58426 × 10^12041 images of an average size of 15KB. With an average write speed of 500mb/s, we can generate ~34000 images per second.

The whole notion is pretty ridiculous. What do you do once you have those absurdly large volumes of images? How do you make sense of them? However, I like to think of it as putting a cap on what previously seemed to be an infinite number, limiting infinity if you will.

— Inspired by Adrian Cooney