Skip to main content

A modular ML-powered palette toolkit for artists and designers

Project description

artutils

A modular Python library for extracting, generating, and visualizing color palettes directly from images. Created for digital artists, illustrators, designers, and anyone who wants to use image-driven color workflows with perceptual intelligence and ML-assisted tools.


What Is It?

artutils helps you:

  • Extract clean, meaningful color palettes from real images
  • Generate full-spectrum gradients and complementary color schemes
  • Visualize your color designs as swatches or wheels
  • Create smooth blended palettes using Gaussian Mixture Models

What's Inside (And Why It Matters)

Palette Extraction (palette_tools.py)

Why: Picking random pixels creates duplicates and noise. This tool:

  • Uses color frequency
  • Converts to perceptual LAB space
  • Deduplicates based on Delta E (color difference)

Use it for:

  • Building consistent palettes from reference art or moodboards
  • Feeding a painting layer or UI theme system

Clustering with KMeans / GMM (clustering.py)

Why: Hard clustering (KMeans) finds dominant color regions, while GMM captures soft overlaps.

Use it for:

  • Logo and brand palette design
  • Color structure discovery from photo datasets
  • Creating refined palettes from photography

Soft GMM Gradient (gmm_soft_gradient)

Why: Real-world transitions are fuzzy. This tool:

  • Assigns pixels soft probabilities across color centers
  • Blends colors based on those weights
  • Produces smooth, loopable color wheels

Use it for:

  • Background gradient generation
  • Data viz color transitions
  • Mood palette exploration for art

Color Utilities (color_utils.py)

Includes:

  • hex ↔ RGB ↔ LAB converters
  • HSL gradient interpolation
  • Opposite color generator

Use it for:

  • Theme toggling
  • Exploring lightness/saturation transitions
  • Creating color harmonies and contrasts

Visualization (visualization.py)

  • Swatch row plots
  • Circular polar color wheels
  • Optional export to .png

Use it for:

  • Portfolio graphics
  • Color reviews with clients or teammates
  • Visual debugging of generated palettes

Project Structure

artutils/
├── __init__.py
├── io_utils.py
├── color_utils.py
├── clustering.py
├── palette_tools.py
├── visualization.py
└── examples/
    ├── clustering_example.py
    ├── palette_example.py
    ├── gmm_gradient_example.py
    └── visualization_example.py

Coming Sometime in the Future: Soft Brush Texture Tools

I was actively prototyping a system to extract high-resolution brush textures from source images using:

  • Local contrast enhancement (e.g., CLAHE)
  • Texture descriptors like LBP + entropy
  • Deduplication of visually similar tiles
  • KMeans clustering to create grouped brush packs

Goal: help digital artists generate reusable brush alphas from skin, fabric, watercolor, etc.
This feature is paused for now but is planned for v2.


Recommended: Use a virtual environment

To avoid dependency conflicts, we recommend using a virtual environment:

python -m venv venv_
source venv/bin/activate  # or .\venv\Scripts\activate on Windows

pip install artutils

Getting Started

Clone and install the library:

git clone https://github.com/aki-au/artutils.git
cd artutils
pip install -e .

If you’d like to collaborate or feature this project somewhere, feel free to reach out!

PyPi Modular Package

https://pypi.org/project/artutils/1.0.0/ --> This is where you can download it through PyPi!

Medium Article (with Pictures and Stuff)

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

artutils-0.0.3.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

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

artutils-0.0.3-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file artutils-0.0.3.tar.gz.

File metadata

  • Download URL: artutils-0.0.3.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for artutils-0.0.3.tar.gz
Algorithm Hash digest
SHA256 3465fe7396decf55458fb56c8843f3503bc078e185db2715834c83c9068e7b87
MD5 7fb97e396a91130f616b6d53c89ebf8c
BLAKE2b-256 aa4220bf2530d67e045231e3ceb021e3cd30ed3c94a8bd5daa78b2116bca22c9

See more details on using hashes here.

File details

Details for the file artutils-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: artutils-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for artutils-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 71e61e03927a5e1591434c4c1fb4c23b03d32e7867f4dec092fac53cfd0e94c4
MD5 f80a868fcfe2ca5753192b6770ec1ec9
BLAKE2b-256 a601b5ad75b19157fe8deeda418646b0558b4f907a543daf0fe1aaf80634f6a3

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