Sample code for extracting dominant colours from an image, a la iTunes 11.