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

https://github.com/pd-mera/dominant-color-kmeans

Using K-means to get dominant colors of an image
https://github.com/pd-mera/dominant-color-kmeans

Last synced: 3 months ago
JSON representation

Using K-means to get dominant colors of an image

Awesome Lists containing this project

README

        

# Find Dominant Color of an image using K-means

This project simply using list of RGB pixels to clustering dominant colors using K-means

## Environments and Dependencies

- Python 3.10.6

Install

``` bash
python -m pip install --upgrade pip
pip install -r requirements.txt
```

## Install package

``` bash
git clone https://github.com/PD-Mera/Dominant-Color-Kmeans.git
cd Dominant-Color-Kmeans
pip install -e .
```

## Demo

Simply modify inputs in `color_kmeans.py` and run

``` bash
python color_kmeans.py
```

## Results

![Image 1](/assets/image1.jpg "Image 1")

![Image 2](/assets/image2.jpg "Image 2")

![Image 3](/assets/image3.jpg "Image 3")