Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/divy9881/prominent-colors-detector

A engine which detects prominent colors from the image.
https://github.com/divy9881/prominent-colors-detector

Last synced: 8 days ago
JSON representation

A engine which detects prominent colors from the image.

Awesome Lists containing this project

README

        

# prominent-colors-detector
![PyPI - Downloads](https://img.shields.io/pypi/dm/image-pcd)

A engine which detects prominent colors from the image.

## Install Python Package
```
pip install image-pcd
```

## Usage

```python
from pcd import ImageProminentColor
from sklearn.cluster import KMeans

image_color = ImageProminentColor("")
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.

```python
image_color.get_image_plot("")
image_color.get_color_plot("")
```
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](https://raw.githubusercontent.com/divy9881/prominent-colors-detector/master/images/colorful.jpg) | ![#215d1d](https://via.placeholder.com/15/215d1d/000000?text=+) `#215d1d`
![#97244a](https://via.placeholder.com/15/97244a/000000?text=+) `#97244a`
![#1d8197](https://via.placeholder.com/15/1d8197/000000?text=+) `#1d8197` | ![colorful_color](https://raw.githubusercontent.com/divy9881/prominent-colors-detector/master/images/colorful_color.png) | ![colorful_image](https://raw.githubusercontent.com/divy9881/prominent-colors-detector/master/images/colorful_image.png) |
| ![php](https://raw.githubusercontent.com/divy9881/prominent-colors-detector/master/images/php.png) | ![#7579b0](https://via.placeholder.com/15/7579b0/000000?text=+) `#7579b0`
![#fdfdfe](https://via.placeholder.com/15/fdfdfe/000000?text=+) `#fdfdfe`
![#010101](https://via.placeholder.com/15/010101/000000?text=+) `#010101` | ![php_color](https://raw.githubusercontent.com/divy9881/prominent-colors-detector/master/images/php_color.png) | ![php_image](https://raw.githubusercontent.com/divy9881/prominent-colors-detector/master/images/php_image.png) |
| ![nodejs](https://raw.githubusercontent.com/divy9881/prominent-colors-detector/master/images/nodejs.png) | ![#fefefe](https://via.placeholder.com/15/fefefe/000000?text=+)`#fefefe`
![#323232](https://via.placeholder.com/15/323232/000000?text=+) `#323232`
![#67a15d](https://via.placeholder.com/15/67a15d/000000?text=+) `#67a15d` | ![nodejs_color](https://raw.githubusercontent.com/divy9881/prominent-colors-detector/master/images/nodejs_color.png) | ![nodejs_image](https://raw.githubusercontent.com/divy9881/prominent-colors-detector/master/images/nodejs_image.png) |