File | Date | Author | Commit |
---|---|---|---|
demo | 2017-07-19 | lancegin | [c0bcb4] add: new version |
docs | 2017-07-19 | lancegin | [201eb7] add: new version |
haishoku | 2017-07-26 | lancegin | [f7212a] add: new version |
tests | 2017-05-15 | lancegin | [589e61] add: basic structure |
.gitignore | 2017-05-17 | lancegin | [8e48da] upd: ignore DS_Store |
CODE_OF_CONDUCT.md | 2017-06-18 | Gin | [f4e6c0] add: Code of Conduct |
LICENSE | 2017-05-14 | Gin | [6e8111] Initial commit |
MANIFEST.in | 2017-05-17 | lancegin | [01bbfb] add: MANIFEST include license |
README.md | 2017-07-19 | lancegin | [201eb7] add: new version |
TODO.md | 2017-07-19 | lancegin | [2a51c8] fix: new version to fix https error |
_config.yml | 2017-05-19 | Gin | [ce2a6d] Set theme jekyll-theme-hacker |
requirments.txt | 2017-05-15 | lancegin | [589e61] add: basic structure |
setup.py | 2017-07-26 | lancegin | [f7212a] add: new version |
haishoku
is a JP word, it means palette in English.
Haishoku is a development tool for grabbing the dominant color or representative color palette from an image, it depends on Python3
and Pillow
.
Grab the dominant color
from a image.
Grab the representative color palette
from a image.
From v1.1.4
, Haishoku could load a image from remote url.
( original image's source: dribbble )
pip3 install haishoku
or maybe you should use
python3 -m pip install haishoku
from haishoku.haishoku import Haishoku
haishoku = Haishoku.loadHaishoku(image)
it will return a Haishoku instance, and you can use haishoku.dominant
and haishoku.palette
to get the image's dominant color and color palette
Also, you can use more immediately api to get them or show them temporarily, just like below:
from haishoku.haishoku import Haishoku
dominant = Haishoku.getDominant(image)
returns: (R, G, B) tuple
from haishoku.haishoku import Haishoku
Haishoku.showDominant( image )
it will open a temporary image to show the dominant color.
from haishoku.haishoku import Haishoku
palette = Haishoku.getPalette( image )
returns: [(percentage, (R, G, B)), (percentage, (R, G, B)), ...] Array
length <= 8
from haishoku.haishoku import Haishoku
Haishoku.showPalette( image )
it will open a temporary image to show the palette.