The goal of this project is to convert the image into a data frame and then displaying as a plot. Thanks to this we can reduce the number of colors to the desired amount and also choose the number of random points we want to use.
The function was created to prepare the data set for the exercise "How different algorithms see the flags", but also work for other types of images.
Reference:
- k-Means Clustering on an Image: https://www.r-bloggers.com/r-k-means-clustering-on-an-image/
- flags task description and manual method for creating data set: https://rstudio-pubs-static.s3.amazonaws.com/334419_79f6b26f117b442d932346effec3d491.html
- same for norway flag: https://github.com/JoanClaverol/ubiqum_fun_with_flags/blob/master/scripts/norway_flag_flagPartition.R

