A color quantization script using k-means clustering. It finds the best n
colors that make up an image and redraws them along with the palette that made it possible.
Using Lab colorspace throughout the calculations lead to big gains in accuracy.
It can render multiple iterations increasing the number of colors.
To use: python palette.py imagename startcolors endcolors