Skip to main content

Python Palette Extractor: extracts color palettes from images into json files.

Project description

PyPalEx

Python Palette Extractor

Table of Contents

DESCRIPTION

PyPalEx is a tool for extracting color palettes from images and generating a JSON format file with light, normal, and dark color schemes/palettes. This tool is intended to be non-OS dependant, for use by the tech community for developing their own custom theme managers or by artists who want to generate color palettes for thier art from images/pictures/wallpapers they adore.

PyPalEx does NOT select only dominant colors from an image. Instead, it picks out the most prominant light, normal, and dark color for each of the base colors (red, yellow, green, cyan, blue, magenta) in an image and constructs a color palette for each of these three variants. When a specific color is not present in an image, that color is borrowed from one of the colors that is present. (e.g. Colors red and cyan are missing from an image, so red and cyan are borrowed from the colors that are present in the image.)

NOTE

Future update may include a -p --pastel option for generating pastelle palettes as well as a -g --generate option for generating missing colors from their respective hue range instead of borrowing missing colors from pre-existing colors in the image.

INSTALLATION

DEPENDENCIES

  • Python 3.7+
  • Pillow (PIL) 9.0+
    • For performing operations on images.
  • NumPy 1.21+
    • To manage large amounts of image data.
  • filetype 1.0+
    • To confirm filetypes are images file types.

Aside from Python, the rest are python packages/libraries that are installable with pip.

ENVIRONMENT VARIABLES

Two shell environement variables PYPALEX_CACHE_DIR and PYPALEX_CONFIG_DIR can be set in terminal. PyPalEx, by default, will either store generated palettes into PYPALEX_CONFIG_DIR OR wherever (XDG_CONFIG_HOME/palex or $HOME/.config/palex) points to.
This default storing location is, of course, overriden if pypalex is used with the -o --Output option.

INSTALL

PIP INSTALL

System-wide install (sudo)

pip3 install pypalex

User install (No sudo)

pip3 install --user pypalex

# Add local 'pip' to PATH:
# (In your .bashrc, .zshrc etc)
export PATH="${PATH}:${HOME}/.local/bin/"

MANUAL/GIT INSTALL

git clone https://github.com/AlTimofeyev/pypalex
cd pypalex
pip3 install --user .

# Add local 'pip' to PATH:
# (In your .bashrc, .zshrc etc)
export PATH="${PATH}:${HOME}/.local/bin/"

CODE DOCUMENTATION

[Documentation]

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

pypalex-1.0.3.tar.gz (18.6 kB view details)

Uploaded Source

Built Distribution

pypalex-1.0.3-py3-none-any.whl (19.6 kB view details)

Uploaded Python 3

File details

Details for the file pypalex-1.0.3.tar.gz.

File metadata

  • Download URL: pypalex-1.0.3.tar.gz
  • Upload date:
  • Size: 18.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.0

File hashes

Hashes for pypalex-1.0.3.tar.gz
Algorithm Hash digest
SHA256 482740fba3d1dfc7b89549c9dcead1344ab2eca975584fc81d36c216e3a2c5de
MD5 5f5b8fe9b58544f73ef7a55cb20f2c24
BLAKE2b-256 e430bb17c2eac8963dfaf0a35da05b19d78aa87765a465a4c6570d71e12962ef

See more details on using hashes here.

File details

Details for the file pypalex-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: pypalex-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 19.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/33.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.63.0 importlib-metadata/4.11.2 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.0

File hashes

Hashes for pypalex-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 72e964562f1982d0220d909a0b31398c5125052f4541bed347766cdff8d4dfab
MD5 67150461e23259a44ac3168ccbf54f1c
BLAKE2b-256 d4d39e573ad4b3ace51b5872097aedd704b33205f2f1e6798e516655f6ae875a

See more details on using hashes here.

Supported by

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