How to cheat at finding pixels in π

Blurry image of man with red and white toque

The cheating mentioned in the last post is this: Although the image data really is part of the hexadecimal expansion of π, I’ve added a palette to the gif to reinterpret the bytes as convenient colors.

If we just interpreted the same exact bytes in a reasonable way, say as grayscale values, it looks like this:

Grayscale noise

Nothing there. The trick is that we can reassign the colors using a palette. And in fact you always need to do this; you have to somehow decide which color each byte should represent. Another “standard” choice of palette, instead of grayscale, would be the Plan9 Palette. That makes the same bytes of π look like this:

Colorful noise

The somewhat standard Web-safe palette wouldn’t work for us, because it only assigns 216 of the 256 possible byte values.

So I chose a palette that made it look more like Waldo. The restriction is that a given byte can only represent one color. So, for instance, wherever you see the same shade of gray in the grayscale image above, you have the same color in the final result.

So we have to search the digits of π to find a part where the patterns of repeated bytes match up the best with similar colors in our desired outcome.

Written on March 31, 2022