Export Formats Overview
Palettize supports exporting colormaps to 9 different formats for GIS applications, web mapping, and data visualization.
Available Formats
Section titled “Available Formats”| Identifier | Name | Extension | Use Case |
|---|---|---|---|
gdal | GDAL Color Relief | .txt | GDAL gdaldem color-relief |
qgis | QGIS Color Ramp XML | .xml | QGIS styles and projects |
sld | OGC SLD XML | .sld | GeoServer, WMS services |
titiler | TiTiler Colormap URL | .txt | TiTiler tile server |
mapgl | MapLibre GL JS | .json | MapLibre/Mapbox web maps |
observable | Observable Plot | .json | Observable notebooks |
gee | Google Earth Engine | .js | GEE Code Editor |
hex | Plaintext Hex | .txt | General purpose |
rgba | Plaintext RGBA | .txt | CSS/web development |
Quick Usage
Section titled “Quick Usage”# Single formatpalettize create viridis --format gdal --output viridis.txt --domain 0,255
# Multiple formatspalettize create viridis --format gdal,qgis,mapgl \ --output "{name}_{format}.{ext}" --domain 0,255Python
Section titled “Python”from palettize import create_colormap, get_scaler_by_name, get_exporter
cmap = create_colormap(preset="viridis")scaler = get_scaler_by_name("linear", domain_min=0, domain_max=255)exporter = get_exporter("gdal")
output = exporter.export( colormap=cmap, scaler=scaler, domain_min=0, domain_max=255, options={"num_colors": 256})Format Categories
Section titled “Format Categories”GIS Formats
Section titled “GIS Formats”- GDAL: For raster processing with GDAL command-line tools
- QGIS: For QGIS desktop GIS styling
- SLD: For OGC-compliant web services (GeoServer, WMS)
Web Mapping Formats
Section titled “Web Mapping Formats”- TiTiler: For dynamic tile server colorization
- MapLibre GL JS: For browser-based vector/raster maps
- Observable Plot: For Observable notebooks and D3 visualizations
Satellite/Remote Sensing
Section titled “Satellite/Remote Sensing”- Google Earth Engine: For GEE Code Editor scripts
Generic Formats
Section titled “Generic Formats”- Hex: Simple hex color lists for any application
- RGBA: CSS-compatible RGBA values
Common Options
Section titled “Common Options”Most exporters support these common options:
| Option | Type | Default | Description |
|---|---|---|---|
num_colors | int | varies | Number of discrete color steps |
precision | int | varies | Decimal places for numbers |
name | str | Colormap name in output metadata |
Passing Options via CLI
Section titled “Passing Options via CLI”Use the -O or --option flag:
# Global option (applies to all formats)palettize create viridis -f gdal -O num_colors=256
# Format-specific optionpalettize create viridis -f gdal,qgis -O gdal:num_colors=256 -O qgis:ramp_type=exactPassing Options via Python
Section titled “Passing Options via Python”Pass a dictionary to the options parameter:
output = exporter.export( colormap=cmap, scaler=scaler, domain_min=0, domain_max=255, options={ "num_colors": 256, "name": "My Colormap" })Choosing a Format
Section titled “Choosing a Format”| If you need to… | Use |
|---|---|
| Apply colors to rasters with GDAL | gdal |
| Style layers in QGIS | qgis |
| Publish to GeoServer or WMS | sld |
| Colorize COGs with TiTiler | titiler |
| Style web maps with MapLibre | mapgl |
| Create D3/Observable visualizations | observable |
| Analyze satellite data in GEE | gee |
| Just need a list of colors | hex or rgba |