https://github.com/aadit3003/colour-palette-extraction
Extracted 5-colour palettes from a dataset of 541 images of Fall 2021 Couture Fashion shows and visualized them using unsupervised learning algorithms.
https://github.com/aadit3003/colour-palette-extraction
colour-spaces k-means-clustering machine-learning unsupervised-learning
Last synced: over 1 year ago
JSON representation
Extracted 5-colour palettes from a dataset of 541 images of Fall 2021 Couture Fashion shows and visualized them using unsupervised learning algorithms.
- Host: GitHub
- URL: https://github.com/aadit3003/colour-palette-extraction
- Owner: Aadit3003
- Created: 2021-08-15T03:12:16.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-13T16:41:08.000Z (almost 5 years ago)
- Last Synced: 2025-01-24T17:45:16.657Z (over 1 year ago)
- Topics: colour-spaces, k-means-clustering, machine-learning, unsupervised-learning
- Language: Python
- Homepage:
- Size: 13.1 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Colour Palette extraction using Unsupervised Learning
This project explores innovative ways to explore relations between colour palettes in collections of images, using unsupervised machine learning algorithms from the Sci-kit library(K-Means clustering, Kernel PCA and t-SNE).
## Code
The source code is split into two parts:
1. Python code to extract a 5-Colour Hexadecimal Palette from an image.
2. Python code to visualise the relation between a list of the above extracted palettes.
## 1) [Palette Extraction](https://github.com/Aadit3003/Colour-Palette-Extraction/blob/850617ec95604604f6fe31d844a28ae39c065c1e/Palette%20Extraction.py)
The 5 colour palettes were extracted by converting the image to a 2D matrix of RGB Values(Nx3), which was used as input for the Mini Batch K-Means Clustering algorithm to return the colours(hex) from the five cluster centers.
- *Here are some examples:*

- *(Top: Schiaparelli Fall 21 Couture (Look 23))*
- *(Bottom: Van Gogh-Sunflowers (fourth version))*
## 2) [Palette Visualisation](https://github.com/Aadit3003/Colour-Palette-Extraction/blob/eb8c0b731250722a71d42c2f2affc8b2def455e2/Palette%20Visualisation.py)
A list of the 5 colour palettes obtained above, were visualised using 2 dimensionality reduction techniques. For the following visualisation, a dataset of 541 images, from multiple Fall 2021 Couture Fashion shows was used.
## Kernel PCA
The RBF Kernel PCA algorithm was able to separate the palettes with darker colours from those with lighter colours, but grouped together palettes with saturated colours.

## t-SNE
The t-SNE algorithm was more successful in grouping the palettes with similar colours and separating visually distinct palettes(such as the greens and pinks).

## 3) Possible Applications
### i) Streaming Service Recommendations
- Colour palettes of video thumbnails could be used to recommend similar videos to users.
- For the following visualisation, palettes from a random sample of 149 Netflix thumbnails were used.

- *(Top Left: RuPaul's Drag Race All Stars)*
- *(Bottom Right: Bo Bunrham: Inside)*
### ii) Fashion Trend Visualisation
- Designers could use colour palettes used in top fashion shows to gain insights about fashion trends.
- For the following visualisation, a dataset of 541 images, from multiple Fall 2021 Couture Fashion shows was used.

- *(Top Left: Valentino Fall Couture 21 Look 12)*
- *(Bottom Right: Schiaparelli Fall Couture 21 Look 20)*
### iii) Other Potential Applications
The concept explored in this project could have interesting applications in many fields like social media analytics, human computer interaction, art trends and so on. For example:
1. Social media photo trend visualisation.
2. Innovative visualisation of art pieces from different time periods.
3. Classifying different kinds of flora by their colour.