prettyPic
A fairly simple image utility library that has one single purpose: to extract the dominant color from an image.
Installation
pip install prettyPic
Usage
from prettypic import color_from_image
color = color_from_image('path/to/image.png')
print(color.color)
KMeans or DBSCAN
from prettypic import color_from_image
color = color_from_image('path/to/image.png', algorithm='kmeans')
# or
color = color_from_image('path/to/image.png', algorithm='dbscan')
Response
color.color # (r, g, b)
color.color_as_image # PIL.Image
color.color_as_rgb # rgb(rrr, ggg, bbb)