Skip to content

Export Formats Overview

Palettize supports exporting colormaps to 9 different formats for GIS applications, web mapping, and data visualization.

IdentifierNameExtensionUse Case
gdalGDAL Color Relief.txtGDAL gdaldem color-relief
qgisQGIS Color Ramp XML.xmlQGIS styles and projects
sldOGC SLD XML.sldGeoServer, WMS services
titilerTiTiler Colormap URL.txtTiTiler tile server
mapglMapLibre GL JS.jsonMapLibre/Mapbox web maps
observableObservable Plot.jsonObservable notebooks
geeGoogle Earth Engine.jsGEE Code Editor
hexPlaintext Hex.txtGeneral purpose
rgbaPlaintext RGBA.txtCSS/web development
Terminal window
# Single format
palettize create viridis --format gdal --output viridis.txt --domain 0,255
# Multiple formats
palettize create viridis --format gdal,qgis,mapgl \
--output "{name}_{format}.{ext}" --domain 0,255
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}
)
  • GDAL: For raster processing with GDAL command-line tools
  • QGIS: For QGIS desktop GIS styling
  • SLD: For OGC-compliant web services (GeoServer, WMS)
  • TiTiler: For dynamic tile server colorization
  • MapLibre GL JS: For browser-based vector/raster maps
  • Observable Plot: For Observable notebooks and D3 visualizations
  • Google Earth Engine: For GEE Code Editor scripts
  • Hex: Simple hex color lists for any application
  • RGBA: CSS-compatible RGBA values

Most exporters support these common options:

OptionTypeDefaultDescription
num_colorsintvariesNumber of discrete color steps
precisionintvariesDecimal places for numbers
namestrColormap name in output metadata

Use the -O or --option flag:

Terminal window
# Global option (applies to all formats)
palettize create viridis -f gdal -O num_colors=256
# Format-specific option
palettize create viridis -f gdal,qgis -O gdal:num_colors=256 -O qgis:ramp_type=exact

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"
}
)
If you need to…Use
Apply colors to rasters with GDALgdal
Style layers in QGISqgis
Publish to GeoServer or WMSsld
Colorize COGs with TiTilertitiler
Style web maps with MapLibremapgl
Create D3/Observable visualizationsobservable
Analyze satellite data in GEEgee
Just need a list of colorshex or rgba