Hilbert’s palette

A space-filling path through this square is matched to an analogous path through the color-cube.

I had this idea in mind for years but the algorithm for Hilbert’s curve defeated me; then I stumbled on Steve Witham’s Python code, and whipped up this doodle in half an hour.

This entry was posted in eye-candy, mathematics. Bookmark the permalink.

4 Responses to Hilbert’s palette

  1. jonas says:

    It’s funny how this apparently lacks a perfectly white pixel.

  2. Anton says:

    When I’m done rendering the full version with all 2^24 colors, I’ll let you know!

  3. Anton says:

    It’s done: png.gz, 3.4 MB. (Compression doesn’t help much in this case, but I do it anyway to discourage kids from using it for a background on Myspace.) The white pixel should be at (3868, 3413).

  4. Anton says:

    Instead of the 2D Hilbert curve, I could use a knight’s tour.

Leave a Reply

Your email address will not be published. Required fields are marked *