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.
Metadata
Release files for color-harmony 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| color-harmony-1.0.1.tar.gz | 5.0 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| color_harmony-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 10.9 kB
Release files / color-harmony-1.0.1.tar.gz
| Download URL | color-harmony-1.0.1.tar.gz |
|---|---|
| Size | 5.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b26456778f48ae465dc5a6c0d83278139d93ca062d483e746f7dbab64026db38
|
|
BLAKE2b-256 checksum How to use checksums |
2ed41d35d2ec90698acca74e9dea6cedfe2b6183e543c501d6d182c236f9e283
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.0
|
Release files / color_harmony-1.0.1-py3-none-any.whl
| Download URL | color_harmony-1.0.1-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
866d246ff06e28d3472cd8ed595a05df56e4dedb1c8bab11c90f24d58ba58618
|
|
BLAKE2b-256 checksum How to use checksums |
a079a12fb23f22a7ed4d6c2ef62d0bcc78cb451352d5bc3cf85a8397129f221d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.0
|
Security for color-harmony 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.