Skip to main content

Extract dominant colors, generate PNG palettes, JSON exports, and name colors using custom palettes.

Project description

🎨 Color Palette Extractor

A modern Python package for extracting dominant colors from images, generating PNG palette previews, exporting color data to JSON, and naming colors using any custom palette (e.g., Pantone, Material, Brand palettes).

This package includes:

  • Dominant color extraction using K-Means
  • RGB or HEX output
  • PNG color palette image generation
  • JSON export
  • Optional color naming using custom palettes (Pantone-compatible if you provide the licensed palette)
  • Command-line interface (colorpalette)
  • Clean import API for integration in other scripts

Installation

Run:

pip install .

CLI Usage

colorpalette input.jpg --colors 5 --format hex --json palette.json --png palette.png

Color Naming

Provide a custom palette JSON:

colorpalette input.jpg --name-colors --palette pantone.json

Python Usage

from color_palette_extractor import extract_palette
colors, names = extract_palette("image.jpg", num_colors=5, output_format="hex")

Package Structure

color_palette_extractor/

  • extractor.py
  • palette_image.py
  • utils.py
  • color_naming.py
  • cli.py
  • init.py

License

MIT 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

color_palette_extractor-1.2.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

color_palette_extractor-1.2.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file color_palette_extractor-1.2.0.tar.gz.

File metadata

  • Download URL: color_palette_extractor-1.2.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for color_palette_extractor-1.2.0.tar.gz
Algorithm Hash digest
SHA256 13d448b8de4575e5e328f540f52d980e867d960b6c12f0de6bf0b45e84042ca5
MD5 05045a2b4a38e44760e3e0fabd776857
BLAKE2b-256 7b4e6c90db7499cfb5a25f89d67b31e24401d4ace2d7f4a01a50495d6e82e79b

See more details on using hashes here.

File details

Details for the file color_palette_extractor-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for color_palette_extractor-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e12791be83083b713eb53319f83378535b4e2bcc68c36b3b9f576f0ad60e456c
MD5 eebc3caf5533735eb41af40353bd6784
BLAKE2b-256 a0baebc523905fef1afeade816f9f3827d9f6823509ae14d8ace497c40627438

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