Every Color Once
This image contains every 18-bit color exactly once I've been reminded of this age-old stack overflow coding challenge the other day and wanted to figure out how one could use fragment shaders to transform any input image into an image that uses every $n$-bit color exactly once. The approach I took was to map every pixel from the input image into a ${(2^n)}^3$-cube, sort the pixels inside the cube by their RGB value respectively, and replace every pixel in the image by the final coordinate of the corresponding pixel inside the cube....