https://github.com/metakirby5/colorz
:art: A k-means color scheme generator.
https://github.com/metakirby5/colorz
color-scheme kmeans
Last synced: 7 months ago
JSON representation
:art: A k-means color scheme generator.
- Host: GitHub
- URL: https://github.com/metakirby5/colorz
- Owner: metakirby5
- License: mit
- Created: 2015-07-03T01:41:17.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-10-25T04:48:17.000Z (about 7 years ago)
- Last Synced: 2025-04-09T20:13:20.689Z (7 months ago)
- Topics: color-scheme, kmeans
- Language: Python
- Homepage:
- Size: 875 KB
- Stars: 184
- Watchers: 7
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
========
colorz
========
|Sample Usage|
A k-means color scheme generator.
Installation
------------
::
pip install colorz
or just move ``colorz.py`` to somewhere in your ``$PATH``.
If you do the latter, you must install the dependencies in the
following section manually.
Arch Linux:
::
git clone https://aur.archlinux.org/colorz.git
cd colorz
makepkg -si
Dependencies
------------
- Python (2 or 3)
- Pillow
- scipy
Usage
-----
::
usage: colorz [-h] [-n NUM_COLORS] [--minv MINV] [--maxv MAXV] [--bold BOLD]
[--font-size FONT_SIZE] [--bg-color BG_COLOR] [--no-bg-img]
[--no-preview]
image
A color scheme generator. Takes an image (local or online) and grabs the most
dominant colors using kmeans. Also creates bold colors by adding value to the
dominant colors. Finally, outputs the colors to stdout (one normal and one
bold per line, space delimited) and generates an HTML preview of the color
scheme.
positional arguments:
image the image file or url to generate from.
optional arguments:
-h, --help show this help message and exit
-n NUM_COLORS number of colors to generate (excluding bold).
Default: 6
--minv MINV minimum value for the colors. Default: 170
--maxv MAXV maximum value for the colors. Default: 200
--bold BOLD how much value to add for bold colors. Default: 50
--font-size FONT_SIZE
what font size to use, in rem. Default: 1
--bg-color BG_COLOR what background color to use, in hex format. Default:
#272727
--no-bg-img whether or not to use a background image in the
preview. Default: background image on
--no-preview whether or not to generate and show the preview.
Default: preview on
Thanks to
---------
- http://charlesleifer.com/blog/using-python-and-k-means-to-find-the-dominant-colors-in-images/
- https://gist.github.com/radiosilence/3946121
.. |Sample Usage| image:: http://i.imgur.com/QVLSXqK.png
:target: colorz.png
:alt: Color preview.