A Python package to get color harmonies of a given image.
Project description
color-harmony.py
A python script that extract main color groups from an image using k-means clustering and returns the color harmony based on the RGB wheel
Dependencies
- Python 3.7+
- sklearn
- Pillow
- matplotlib
Installation
Pip
The stable releases of gallery-dl are distributed on PyPI and can be easily installed or upgraded using pip:
$ python -m pip install color-harmony
From Source
Clone the repository or download the folder from github, then navigate to the respective directory and run:
python setup.py install
Usage
To use color-harmony, simply include the path to your image file:
$ color-harmony [OPTION]... [FilePATH]
See also python color-harmony --help
.
Examples
Default run on an image file will return both RGB colors and create a color palette image with the same name but with "_colors.png":
$ color-harmony sample.png
You can also set the number of clusters, tolerance, and output configurations:
$ color-harmony -k 5 -t 1.5 -o text icon.png
Color Scheme Analysis of Popular Illustrations (Python Notebook on Github)
You will need to download the dataset from: https://www.kaggle.com/profnote/pixiv-popular-illustrations or use your own images.
ColorSchemeAnalysis.ipynb
Main jupyter notebook for the analysis, can use the data files below:
harmonies.csv
File containing the harmonies of each illustration in the dataset.
Column names: "Monochromatic", "Complementary", "Split Complementary", "Triad", "Square", "Rectangular", "Analogous", "Other"
wheelColors_arr.csv
Wheel color representations of each illustration in the dataset, starting from Red -> Green -> Blue -> Red.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for color_harmony-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cb1bc48fd81d06dea2d288f64c676a399ad816f49a1f1c9985eb0733fd2adb5e |
|
MD5 | e5dab37ee630f5ac707527ce129d69e7 |
|
BLAKE2b-256 | cada9f36b6c5bcb4dbf41fb699b4394de6493b463c99e54f795e0be6d293bd58 |