Skip to main content

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

MIT

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)

Uploaded Source

Built Distribution

prettypic-1.2.1-py3-none-any.whl (3.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page