I have had several requests for the Color Sorting code I used to create these images. The pixel-based color sorting uses linear and Hilbert sorting techniques in RGB, YIQ, and HSV color spaces.
So now, ColorSorting is now on Github.
The code is not polished, so use at your own risk. Enjoy!