Takes a picture and finds the best color equality using machine learning. The use case this was built for was album cover backdrops, but others exist.
Project description
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)
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
prettypic-1.2.1.tar.gz
(6.0 kB
view hashes)
Built Distribution
Close
Hashes for prettypic-1.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b44a4c9d1ea5a65de898e6618eb846ec3884290b71e3c5cd7373a7e263719392 |
|
MD5 | cf9a47f0172d55aa3b03111d43c00eb2 |
|
BLAKE2b-256 | 35ac237be2298afd11adbb32777a49e3768012345e46ac26a49fa4ceba567d98 |