A genetic algorithm transforms a uniform image containing a grid-like pattern of every colour. It uses a reference image and swaps two pixels at a time, but only if the swap makes the image closer to the reference image. This image was run for ~5,000,000,000 generations (12 hours on my PC). You can find out more and download the program here:
http://troygamedev.blogspot.co.uk/2014/04/allrgb.html. It is fully open source and in java, feel free to use the source code as you wish =]