In this project an automated dominant color extraction method using clustering models (K-means, K-medoids clustering) is proposed and implemented. The functions in the jupyter file can be used as a mini toolbox to help anyone who might be interested in color extraction and/or quantification of colors in an image. Possible uses of the functions in the notebook include assistance in: marketing analysis, semiotics, sociology of colors, automatic creation of movie scene timestamps and artistic projects.
get_dominant_colors(image, k=k, model='kmedoids', plot_elbow=True, max_clusters=20, plot_dominant_colors=True, metric='distance', color_ratios=True, pearson_sensitivity=pearson_sensitivity)
get_dominant_colors(image, k=k, model='kmedoids', plot_elbow=True, max_clusters=20, plot_dominant_colors=True, metric='distance', color_ratios=True, pearson_sensitivity=pearson_sensitivity)
get_dominant_colors(image, k=k, model='kmeans', plot_elbow=True, max_clusters=20, plot_dominant_colors=True, metric='distance', color_ratios=True, pearson_sensitivity=pearson_sensitivity)
get_dominant_colors(image, k=k, model='kmeans', plot_elbow=True, max_clusters=20, plot_dominant_colors=True, metric='pearson', color_ratios=True, pearson_sensitivity=pearson_sensitivity)
get_dominant_colors(image, k=k, model='kmedoids', plot_elbow=True, max_clusters=20, plot_dominant_colors=True, metric='distance', color_ratios=True, pearson_sensitivity=pearson_sensitivity)
1/100 of the frames from Stanley kubrick's movie "The Shining"
For example the red part of the photo above is the bathroom scene: