Skip to content

divy9881/prominent-colors-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

prominent-colors-detector

PyPI - Downloads
A engine which detects prominent colors from the image.

Install Python Package

pip install image-pcd

Usage

from pcd import ImageProminentColor
from sklearn.cluster import KMeans

image_color = ImageProminentColor("<path to image file>")
prominent_colors = image_color.get_prominent_colors(KMeans, 3)

The above code-snippet gives you top 3 prominent colors in RGB form sorted in decreasing order of prominence from the image.

image_color.get_image_plot("<Save image file path>")
image_color.get_color_plot("<Save image file path>")

The above code-snippet allows you to save the images of plots of the prominent color and image original colors in 3D-space with RGB components as axis.

Samples (For top-3 Prominent Colors)

Sample Image Prominent Colors Prominent Colors Plot Image Colors Plot
colorful #215d1d #215d1d
#97244a #97244a
#1d8197 #1d8197
colorful_color colorful_image
php #7579b0 #7579b0
#fdfdfe #fdfdfe
#010101 #010101
php_color php_image
nodejs #fefefe#fefefe
#323232 #323232
#67a15d #67a15d
nodejs_color nodejs_image

About

A engine which detects prominent colors from the image.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published