A development tool for grabbing the dominant color or representative color palette from an image
haishokuis 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
dominant colorfrom a image.
Grab the representative
color palettefrom a image.
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.paletteto 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)
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)), ...]
Arraylength <= 8
from haishoku.haishoku import Haishoku Haishoku.showPalette( image )
it will open a temporary image to show the palette.