Python color-science workbench for HDR tone mapping, appearance models, Delta E, spectral, ICC, and LUT workflows
Project description
Quanta Color
Quanta Color is a Python color-science workbench for people who need more than hex conversion. It covers perceptual spaces, HDR tone mapping, color appearance models, Delta E metrics, chromatic adaptation, spectral utilities, ICC profile generation, and an optional GUI.
Quick Start
pip install ".[all]"
quanta-color
Launch the GUI, or use the CLI:
quanta-color info ff6030
quanta-color convert ff6030 --to oklab
quanta-color difference ff0000 00ff00 --metric all
quanta-color harmony ff6030 --scheme triadic
quanta-color spectrum --temp 6500
quanta-color icc --gamma 2.2 --output display.icc
Features
Color Spaces (15+)
sRGB, Linear RGB, XYZ, xyY, CIELAB, LCH, Oklab, Oklch, JzAzBz, JzCzhz, ICtCp, HSV, Display P3, BT.2020, Adobe RGB, ACEScg
Tone Mapping (12 operators)
ACES (Narkowicz + Hill), AgX (neutral/punchy/golden), Reinhard (simple + extended), Hable/Uncharted 2, Lottes, Uchimura/Gran Turismo, PBR Neutral (Khronos glTF), BT.2390 EETF, BT.2446 Method A, custom knee function
HDR Processing
PQ (ST.2084) encode/decode, HLG (BT.2100) encode/decode, BT.2390 EETF tone mapping, BT.2446 HDR-to-SDR
Color Appearance Models
CIECAM02 forward/inverse (machine-epsilon roundtrip), CAM16, CAM16-UCS uniform color space, hue quadrature
Color Difference (7 metrics)
CIE76, CIE94 (graphics/textiles), CIEDE2000, CMC(l:c), JzAzBz Delta E, Oklab Delta E, HyAB
Chromatic Adaptation (9 methods)
Bradford, CAT16, CAT02, Sharp, Von Kries, CMCCAT2000, Fairchild, Bianco-Schettini, XYZ Scaling
Additional
- Spectral rendering - Planck blackbody, CIE 1931 CMFs, daylight illuminants, SPD-to-XYZ integration
- ICC profiles - Generate ICC v4 display profiles from primaries + gamma
- CVD simulation - Protanopia, deuteranopia, tritanopia, achromatopsia (Brettel et al.)
- Gamut mapping - Clip, soft compression, Oklab chroma reduction
- Color harmony - Complementary, triadic, tetradic, analogous, split complementary, monochromatic
GUI
Interactive workbench with 5 tools:
- Color Inspector - Pick a color, see it in every space with luminance, wavelength, contrast
- Palette Generator - Generate harmonious palettes, copy as CSS
- Color Difference - Compare two colors across all metrics with visual grades
- Tone Mapping - Preview all 12 operators with curve visualization
- CVD Simulator - See how colors appear to color-blind viewers
quanta-color gui
CLI Commands
| Command | Description |
|---|---|
quanta-color |
Launch GUI (default) |
quanta-color info <color> |
Show color in all spaces + metadata |
quanta-color convert <color> --to <space> |
Convert between color spaces |
quanta-color difference <c1> <c2> |
Compute color difference |
quanta-color harmony <color> --scheme <type> |
Generate palette |
quanta-color adapt <xyz> --from D65 --to D50 |
Chromatic adaptation |
quanta-color spectrum --temp <K> |
Blackbody spectral data |
quanta-color icc --gamma 2.2 |
Create ICC profile |
quanta-color gui |
Launch GUI workbench |
Installation
pip install ".[all]" # Everything (numpy + scipy + PyQt6)
pip install . # Core only (numpy)
Python API
import numpy as np
from quanta_color.spaces import srgb_to_oklab, oklab_to_srgb
from quanta_color.tonemap import aces_filmic, pq_eotf
from quanta_color.difference import delta_e_2000
from quanta_color.adaptation import adapt, ILLUMINANTS
from quanta_color.appearance import ciecam02_forward, ViewingConditions
# Color space conversion
oklab = srgb_to_oklab(np.array([0.8, 0.2, 0.1]))
# Tone mapping
hdr = np.array([0.0, 0.18, 1.0, 4.0, 10.0])
sdr = aces_filmic(hdr)
# Color difference
lab1 = np.array([50.0, 25.0, -10.0])
lab2 = np.array([60.0, 20.0, -5.0])
de = delta_e_2000(lab1, lab2)
# Chromatic adaptation
d65 = ILLUMINANTS["D65"]
d50 = ILLUMINANTS["D50"]
adapted = adapt(xyz, d65, d50, method="cat16")
# CIECAM02
vc = ViewingConditions(white_point=d65)
appearance = ciecam02_forward(xyz, vc)
print(f"J={appearance.J:.1f}, C={appearance.C:.1f}, h={appearance.h:.0f}")
Architecture
quanta_color/
spaces.py 15+ color space conversions
tonemap.py 12 tone mapping operators + PQ/HLG
appearance.py CIECAM02, CAM16, CAM16-UCS
difference.py 7 color difference metrics
adaptation.py 9 chromatic adaptation methods
spectral.py Planck, CIE CMFs, daylight
icc.py ICC v4 profile generation
blindness.py CVD simulation (4 types)
gamut.py Gamut mapping
harmony.py 6 color harmony schemes
cli.py Command-line interface (8 commands)
gui.py PyQt6 interactive workbench
License
Copyright (c) 2022-2026 Zain Dana Harper. All rights reserved. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file quanta_color-1.0.1.tar.gz.
File metadata
- Download URL: quanta_color-1.0.1.tar.gz
- Upload date:
- Size: 86.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32133e358d5562907c134f6178501f8f9c6336e01ba90c19a2b5702ed0627c3d
|
|
| MD5 |
490aada41767f54e0a4ec44b7a32980f
|
|
| BLAKE2b-256 |
1fb53223c814a89de205573bc0c27ea200bade9f61a60a17145e37848f3aa9e0
|
Provenance
The following attestation bundles were made for quanta_color-1.0.1.tar.gz:
Publisher:
publish-pypi.yml on HarperZ9/quanta-color
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quanta_color-1.0.1.tar.gz -
Subject digest:
32133e358d5562907c134f6178501f8f9c6336e01ba90c19a2b5702ed0627c3d - Sigstore transparency entry: 1818464223
- Sigstore integration time:
-
Permalink:
HarperZ9/quanta-color@2864f3e33823b3d762cfe41245519c2419581f6b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/HarperZ9
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2864f3e33823b3d762cfe41245519c2419581f6b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file quanta_color-1.0.1-py3-none-any.whl.
File metadata
- Download URL: quanta_color-1.0.1-py3-none-any.whl
- Upload date:
- Size: 79.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39543792674ee0f8839e8d0c8f01c521644bce15d7d7742acda8ed19c77861df
|
|
| MD5 |
2c7c81a73bb94612bf90fd07d6401392
|
|
| BLAKE2b-256 |
d188eeac344b7995cf69c12e3748ae3cbefef0b47acc8e10c3e3e096d6317e3e
|
Provenance
The following attestation bundles were made for quanta_color-1.0.1-py3-none-any.whl:
Publisher:
publish-pypi.yml on HarperZ9/quanta-color
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
quanta_color-1.0.1-py3-none-any.whl -
Subject digest:
39543792674ee0f8839e8d0c8f01c521644bce15d7d7742acda8ed19c77861df - Sigstore transparency entry: 1818464230
- Sigstore integration time:
-
Permalink:
HarperZ9/quanta-color@2864f3e33823b3d762cfe41245519c2419581f6b -
Branch / Tag:
refs/heads/main - Owner: https://github.com/HarperZ9
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@2864f3e33823b3d762cfe41245519c2419581f6b -
Trigger Event:
workflow_dispatch
-
Statement type: