RANDOM
FIND YOUR IMAGE
SEARCH
INFO

HOW IT WORKS: A DIGITAL EXPLORATION OF INFINITY

This creation is a humble echo of Jorge Luis Borges’ vision of the Library of Babel—a boundless repository where every possible combination of elements exists. Here, those elements are images, distilled into a grid of 80 by 80 pixels, each a whisper of color and form. But how does this digital labyrinth transform an image into a seed, and how does that seed summon the image back from the void? Let me unveil the mechanism, step by step.

When you venture into the "FIND YOUR IMAGE" tab and upload an image, the process begins. Your image—be it a photograph, a drawing, or a fleeting moment captured—arrives in its raw form, a chaotic array of pixels defined by width and height. To fit within this library’s shelves, it must be tamed. We take the smaller of its dimensions (width or height), carve out a square from its center, and resize that square to precisely 80x80 pixels. This resizing is not a mere suggestion but a strict decree: every image, no matter its origin, becomes an 80x80 grid, a standardized tablet of 6,400 pixels. Each pixel holds four values—red, green, blue, and alpha (transparency)—but for our purposes, we focus on the RGB trio, as transparency is fixed at full opacity (255).

From this 80x80 grid, we extract the raw pixel data: a sequence of 25,600 bytes (6,400 pixels times 4 channels). To craft a seed—a key to this image’s place in the infinite library—we must condense this vast data into something manageable yet unique. We could sample sparsely, but that risks losing the image’s soul. Instead, we take every single pixel’s RGB values and simplify them. Each color channel, ranging from 0 to 255, is divided by 4, reducing it to a range of 0 to 63. This compression sacrifices some precision—subtle gradients may blur—but ensures the seed can encode the entire image. These values are then shifted by 33 (to fit within the printable ASCII range, 33 to 96), converted to characters, and strung together. For an 80x80 image, this yields a seed of 19,200 characters (6,400 pixels times 3 channels). This seed is a dense, cryptic string, a cipher that holds the essence of your image.

Why such a long seed? Because unlike a mere hash or random generator, this seed is the image itself, encoded directly. There’s no trickery of pseudo-random numbers here—each character corresponds to a specific pixel’s color, ensuring that the same seed always produces the same image, down to the last detail. When you click "COPY" in the "FIND YOUR IMAGE" tab, this 19,200-character string is silently stored in the button’s data attribute, ready to be plucked into your clipboard. You see no overwhelming wall of text—just a simple button, preserving the mystery.

Now, turn to the "SEARCH" tab. Paste that seed—or any seed of matching length—into the input field and press "SEARCH." The system reverses the process. It reads the 19,200 characters, decoding each trio back into RGB values. For each character, we subtract 33 to return to the 0-63 range, then multiply by 4 to approximate the original 0-255 range. These values are laid out across the 80x80 grid, pixel by pixel, forming an image data array. This array is first drawn onto a temporary 80x80 canvas, then scaled up to 640x640 pixels (with each pixel becoming an 8x8 block) for display. If the seed is too short or malformed, an error pattern—a checkerboard of muted grays—warns of the failure. But with a valid seed from an uploaded image, the result is identical to the original, a perfect echo across the tabs.

The "RANDOM" tab, the library’s entryway, offers a different magic. On load, and with each press of the "RANDOM" button, it conjures an 80x80 image from the ether. Every pixel’s RGB values are chosen anew, a roll of the dice between 0 and 255, creating a chaotic tapestry of color. This image, too, is encoded into a 19,200-character seed using the same method—each pixel’s colors compressed and converted to characters. Clicking "COPY" here captures this seed, letting you summon the same random vision elsewhere. It’s a glimpse into the library’s infinite possibilities, where order and chaos coexist.

All this unfolds within your browser—no server holds these secrets. The seeds are not stored beyond the moment; they live only in your clipboard or the fleeting memory of the page. The system’s charm lies in its simplicity and its fidelity: the seed is the image, the image is the seed. There’s no lossy approximation beyond the initial color compression, no reliance on external forces—just a direct mapping from pixels to characters and back again. This is a library of exactitude within its constraints, a finite window into Borges’ infinite dream, where every 80x80 image ever conceived could, in theory, find its place.