Skip to content

Using Presets

Palettize includes hundreds of colormap presets via the cmap library, plus custom built-in presets.

See all available presets:

Terminal window
palettize list presets

Or in Python:

from palettize import list_available_presets
presets = list_available_presets()
print(f"Found {len(presets)} presets")
print(presets[:10]) # First 10
Terminal window
# Preview a preset
palettize show viridis
# Export a preset
palettize create viridis --format gdal --output viridis.txt --domain 0,255
from palettize import create_colormap
# From preset
cmap = create_colormap(preset="viridis")
# Get colors
print(cmap.get_color(0)) # Start color
print(cmap.get_color(0.5)) # Middle
print(cmap.get_color(1)) # End color

These colormaps are designed for accurate data representation:

PresetTypeUse Case
viridisSequentialGeneral purpose, colorblind-safe
magmaSequentialDark backgrounds
infernoSequentialHigh contrast
plasmaSequentialGood for heatmaps
cividisSequentialColorblind-optimized
Terminal window
palettize show viridis
palettize show magma
palettize show inferno

For data with a meaningful center point:

PresetUse Case
RdBuRed-Blue, good for temperature
RdYlBuRed-Yellow-Blue
BrBGBrown-Green, good for terrain
PiYGPink-Green
PRGnPurple-Green
Terminal window
palettize show RdBu
palettize show BrBG

For data with a natural ordering:

PresetCharacter
BluesLight to dark blue
GreensLight to dark green
RedsLight to dark red
YlOrRdYellow-Orange-Red
YlGnBuYellow-Green-Blue
Terminal window
palettize show Blues
palettize show YlOrRd

For discrete categories (use carefully with continuous data):

PresetColors
Set1Bold, distinct
Set2Muted, distinct
PairedPaired colors
tab10Tableau 10
Terminal window
palettize show Set1
palettize show tab10

Palettize includes some custom presets prefixed with custom/:

Terminal window
palettize show custom/grayscale
palettize show custom/simple_rgb

Use only part of a preset:

Terminal window
# Skip the dark ends of viridis
palettize show viridis --cut "0.1,0.9"
# Use only the first half
palettize show viridis --cut "0,0.5"

Override the interpolation:

Terminal window
# Use sRGB instead of default oklch
palettize show viridis --space srgb

Give a custom name:

Terminal window
palettize create viridis --format gdal --output elev.txt \
--name "Elevation" --domain 0,4000

Get raw preset data programmatically:

from palettize import load_preset_data
# Returns list of color stops
data = load_preset_data("viridis")
print(data[:3]) # First 3 stops
VisualizationRecommended Presets
Elevation/terrainterrain, BrBG, YlGnBu
TemperatureRdBu, coolwarm, RdYlBu
Heatmapsviridis, magma, inferno
Ocean depthBlues, deep, ocean
Vegetation/NDVIGreens, YlGn, BuGn
Population densityYlOrRd, Reds, OrRd
Categorical dataSet1, tab10, Paired
NeedPresets
Colorblind-safeviridis, cividis, magma
Print-friendlyviridis, gray, bone
Perceptually uniformviridis, magma, inferno, plasma
High contrastinferno, hot, jet
Dark backgroundmagma, inferno
Light backgroundviridis, plasma

Most presets come from the cmap library, which aggregates colormaps from:

  • Matplotlib
  • Bokeh
  • Plotly
  • Seaborn
  • Scientific journals
  • And more

Browse the full catalog in their documentation to discover more options.

If you frequently use the same colors, create them directly:

Terminal window
# Define custom colors
palettize show --colors "navy,white,darkred" --name "MyDiverging"
# Or in Python
from palettize import create_colormap
my_cmap = create_colormap(
colors=["#001f3f", "#ffffff", "#85144b"],
name="NavyWhiteMaroon"
)

For reusable custom presets, consider creating a custom exporter plugin or simply save your preferred color lists.