Skip to main content

Palette detection from images.

Project description

Image palette detection in Python modelled after Paul Annesley’s color detector in PHP. palette_detect determines what the most important colors used in your image are, and if one of them is a background color.

by Dennis Hotson & Lars Yencken

Usage

palette_detect is meant to run in a streaming manner. You can run it on a single image by echo’ing in the image:

$ echo myimage.png | palette_detect
myimage.png #3e453f,#2ea3b7,#bee6ea,#51544c,#373d38 #ffffff

Each input line should be a filename. Each output line will be a tab-delimited string containing the filename, major colors in order, and (optionally) a detected background color.

To run on an entire directory tree of images:

$ find . -name '*.jpg' | palette_detect

palette_detect has an experimental multiprocessing mode, accessed by the -n argument. For example, to run the same example using 8 processes:

$ find . -name '*.jpg' | palette_detect -n 8

You can also get usage information by running palette_detect –help.

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

palette_detect-0.1.0.tar.gz (3.6 kB view details)

Uploaded Source

File details

Details for the file palette_detect-0.1.0.tar.gz.

File metadata

File hashes

Hashes for palette_detect-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e8567426b2689e716326ce6a3226e11b76e447801f357923eca8edc2a056dd7b
MD5 75e741179676568f1e1cfbec1305b62b
BLAKE2b-256 0a0152904e94bd413b6ec6c9f9779ab887f4a8a57e51c9ae007261fbfc6bd15c

See more details on using hashes here.

Supported by

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