Skip to main content

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.

Metadata

Release files for palette_detect 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for palette_detect 0.2.0
File Size Uploaded Provenance
palette_detect-0.2.0.tar.gz 4.6 kB Without provenance Details

Release files / palette_detect-0.2.0.tar.gz

Download URL palette_detect-0.2.0.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
2547dae6723c193d1e9398c20d57b5eecb56d1e15f025320597318b0e6488072
BLAKE2b-256 checksum
How to use checksums
7c0998ab51187fbbc90c85a107b69b2a4b28d50d80f3407c68d8add991130973
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for palette_detect 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.2.0 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page