Before I attempt to write this is Nim: https://github.com/pixelogik/ColorCube/blob/master/Python/ColorCube.py
I thought I'd check if anyone here knew if we had a library that'd let me extract the most frequent colours in an image?