A Python CLI tool for creating and exporting colormaps for data visualization and mapping applications.
Project description
Palettize
🎨 A Python utility and CLI tool for generating, previewing, and exporting color maps.
Palettize helps you create and manage colormaps for data visualization, GIS, and web mapping. It provides a simple, powerful command-line interface to:
- Generate colormaps from a list of colors or from built-in presets.
- Instantly preview colormaps directly in your terminal.
- Export colormaps to various formats suitable for different applications.
- Customize interpolation color space, data scaling, and slicing.
Installation
This project uses uv for dependency management. To install from source:
git clone https://github.com/your-username/palettize.git # Replace with actual repo URL
cd palettize
uv pip install .
For development, install with the dev dependencies:
uv pip install -e .[dev]
Usage
Palettize is built on a simple verb-noun philosophy. You use a command like show or create and tell it what to operate on—either a preset name or a list of custom --colors.
palettize --help
Key Commands
palettize show: Render a colormap preview in your terminal.palettize create: Export a colormap to one or more file formats.palettize list: List availablepresetsorexporters.
Examples
-
Show a built-in preset colormap:
palettize show viridis
-
Show a custom gradient made of three colors:
palettize show --colors "midnightblue,orange,gold"
-
Export the 'spectral' preset to a GDAL color ramp file: The
--domainflag maps the colormap to your data's range.palettize create spectral --format gdal --output spectral_gdal.txt --domain 0,255
-
Create a custom colormap and export it to multiple formats: Use
--stepsto define the number of discrete colors in the output.palettize create -c "blue,white,red" --format qgis,mapgl \ --output "output/rwb_{format}.{ext}" --steps 11 --name "RedWhiteBlue"
This creates
output/rwb_qgis.xmlandoutput/rwb_mapgl.json. -
List all available built-in presets:
palettize list presets
-
Pass format-specific options during export: Use the
-Oor--optionflag to pass key-value pairs to an exporter.# Tell the 'observable' exporter to create a diverging scale with a pivot palettize create RdBu -f observable -o plot.json \ -O type=diverging -O pivot=0
Features
- Flexible Colormap Creation: Generate colormaps from lists of colors (hex, RGB, named) or use built-in presets.
- Advanced Interpolation: Supports various color spaces for interpolation via the ColorAide library (e.g., Oklch, sRGB, LAB).
- Terminal Preview: Instantly visualize any colormap in your terminal.
- Multiple Export Formats: Supports common formats for GIS (GDAL, QGIS, SLD, Titiler) and web (MapLibre GL, Observable Plot).
- Customizable Scaling: Apply linear, power, sqrt, or log scaling to map your data domain to the colormap.
- Plugin System for Exporters: Easily extendable with new export formats.
- CLI with Rich Output: User-friendly command-line interface with clear help messages and rich formatting.
Available Presets
The incredibly useful cmap library is a core dependency used for presets. To see a list of colormap presets, run:
palettize list presets
Available Export Formats
To see a list of all currently registered and available export formats, run:
palettize list exporters
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 palettize-0.0.1a1.tar.gz.
File metadata
- Download URL: palettize-0.0.1a1.tar.gz
- Upload date:
- Size: 34.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
235c1a180560a6cf065443cf2464de0587a1cb496cbc01877a19615286e59fef
|
|
| MD5 |
2334f61ff97e055ba3524ec5a450529c
|
|
| BLAKE2b-256 |
07b77c8bd5d67287e0f7d41b20cd4e0f4581597728d4f524cc424778ae6bba08
|
Provenance
The following attestation bundles were made for palettize-0.0.1a1.tar.gz:
Publisher:
release.yml on kovaca/palettize
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
palettize-0.0.1a1.tar.gz -
Subject digest:
235c1a180560a6cf065443cf2464de0587a1cb496cbc01877a19615286e59fef - Sigstore transparency entry: 264985019
- Sigstore integration time:
-
Permalink:
kovaca/palettize@960a6cb9b68a012fa49fb6f91a676a991e63a9d2 -
Branch / Tag:
refs/tags/v0.0.1a1 - Owner: https://github.com/kovaca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@960a6cb9b68a012fa49fb6f91a676a991e63a9d2 -
Trigger Event:
push
-
Statement type:
File details
Details for the file palettize-0.0.1a1-py3-none-any.whl.
File metadata
- Download URL: palettize-0.0.1a1-py3-none-any.whl
- Upload date:
- Size: 40.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a58021be5892731ed558ab70e7c4cd45fb36dcd897043410f969465e07dcd3f1
|
|
| MD5 |
6994a56ac9f4ec38ee1543d0412cc0c1
|
|
| BLAKE2b-256 |
b1b70e8ab9a4a877e156ca973374883e92d27797c1fbbd65693c0f8d998d62fc
|
Provenance
The following attestation bundles were made for palettize-0.0.1a1-py3-none-any.whl:
Publisher:
release.yml on kovaca/palettize
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
palettize-0.0.1a1-py3-none-any.whl -
Subject digest:
a58021be5892731ed558ab70e7c4cd45fb36dcd897043410f969465e07dcd3f1 - Sigstore transparency entry: 264985020
- Sigstore integration time:
-
Permalink:
kovaca/palettize@960a6cb9b68a012fa49fb6f91a676a991e63a9d2 -
Branch / Tag:
refs/tags/v0.0.1a1 - Owner: https://github.com/kovaca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@960a6cb9b68a012fa49fb6f91a676a991e63a9d2 -
Trigger Event:
push
-
Statement type: