University of Auckland
ENGGEN 131 Project 1, Semester 2 2018
This Project uses the k-means clustering algorithm to find the clusters of similar pixels in the picture and then turns those clusters into a single pixel color by taking the average of the whole cluster. Hence, taking a picture with millions of colors and converting it to just a few while still retaining the original image.
For more information about the algorithm see: https://en.wikipedia.org/wiki/K-means_clustering
- Place the picture that you want to modify in the project directory.
- Run the ConvertImage file.
- Enter the name of the file (e.g. clocktower.jpg).
- Enter the number of colors you need in the picture (e.g. 10).
- Enter the upper bound for the number of iterations (e.g. 200).
- Voila! If convergence is met within the number of iterations then you will see the picture with k colors otherwise you will see an approximation of the image with k colors.