Mathematica
Non-competing because the builtt-in HilbertCurve
was introduced in Mathematica 11.1 in 2017.
Inspired by Joe K's answer. Generates 9 images in one program. Arranges the colors in three different orderings: the lexicographical order, the Z-order curve, the Hilbert curve; then places them in the image in (the 2-dimensional version of) these three orderings.
Table[Image@Partition[a[[Ordering@b]]/2^6f[m_, 2^9], n_] {a,:= {Tuples[Range[2^6]Tuples[Range[2^m] - 1, 3]n], FromDigits[Partition[#, 3]n], 2] & /@ Tuples[{0, 1}, 3*6]n*m], First@HilbertCurve[6First@HilbertCurve[m, 3]}n]},; {b, {Tuples[Range[2^9] - 1, 2], FromDigits[Partition[#Table[Image@Partition[a[[Ordering@b]]/2^6, 2]2^9], 2] & /@ Tuples[{0a, 1}f[6, 2*9]3]}, {b, First@HilbertCurve[9f[9, 2]}}]