Base (move mouse over canvas to change): _

Explanation:

I came across this image, which was generated by mapping each pixel's X,Y coordinates into RGB color space by applying the inverse of a 2D Hilbert curve followed by a 3D Hilbert curve.

Even though the Hilbert curves are continuous, the resulting function from the unit square to the unit cube is not, because the inverse of the 2D Hilbert curve isn't continuous. However, it has the property that discontinuities larger than a given (arbitrarily small) magnitude can only occur on the boundaries between a finite set of rectangular regions in the image. This "weak continuity" is preserved even when we replace the Hilbert curves with certain simpler (non-continuous) functions from [0, 1] onto [0, 1]n.

One such function that's easy to implement consists of (un-)interleaving the digits of the numbers' base-b representations. For example, to map [0, 1] onto [0, 1]2, we map the number 0.d1d2d3d4... to the pair (0.d1d3d5d7..., 0.d2d4d6d8...).

This page uses that scheme, computing the color for each pixel by reshuffling the digits from its (x, y) coordinates to build three (r, g, b) coordinates digit-by-digit. The procedure is generalized to support non-integer "bases".

View source for details.