Skip to main content

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]

Metadata

Release files for pypalex 1.0.3

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

Source distribution (sdist)

Source distribution for pypalex 1.0.3
File Size Uploaded
pypalex-1.0.3.tar.gz 18.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypalex 1.0.3
File Interpreter ABI Platform
pypalex-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 38.1 kB

Release files / pypalex-1.0.3.tar.gz

Download URL pypalex-1.0.3.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
482740fba3d1dfc7b89549c9dcead1344ab2eca975584fc81d36c216e3a2c5de
BLAKE2b-256 checksum
How to use checksums
e430bb17c2eac8963dfaf0a35da05b19d78aa87765a465a4c6570d71e12962ef
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / pypalex-1.0.3-py3-none-any.whl

Download URL pypalex-1.0.3-py3-none-any.whl
Size 19.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72e964562f1982d0220d909a0b31398c5125052f4541bed347766cdff8d4dfab
BLAKE2b-256 checksum
How to use checksums
d4d39e573ad4b3ace51b5872097aedd704b33205f2f1e6798e516655f6ae875a
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.3.3

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

This release

1.0.3 This release

2 release files

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