An exercise in image processing and k-means