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 details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file prettypic-1.2.1.tar.gz.
File metadata
- Download URL: prettypic-1.2.1.tar.gz
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.4 Linux/5.15.0-1041-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af96e399251f0acacd807f11e9a1cf868c58e34493160cb626d6b0ac33210b6e
|
|
| MD5 |
5a59fa30407e32352e905f715866353f
|
|
| BLAKE2b-256 |
ad14b2aa882933530ce9aceda38680cbe2f1d647017caea2206968d7f684f7ff
|
File details
Details for the file prettypic-1.2.1-py3-none-any.whl.
File metadata
- Download URL: prettypic-1.2.1-py3-none-any.whl
- Upload date:
- Size: 3.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.4 Linux/5.15.0-1041-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b44a4c9d1ea5a65de898e6618eb846ec3884290b71e3c5cd7373a7e263719392
|
|
| MD5 |
cf9a47f0172d55aa3b03111d43c00eb2
|
|
| BLAKE2b-256 |
35ac237be2298afd11adbb32777a49e3768012345e46ac26a49fa4ceba567d98
|