palettize formats
The formats command lists the available export formats, and describes the options any one
of them accepts. Every option shown here can be passed to
palettize create with -O.
palettize formats # list every formatpalettize formats gdal # describe one format's optionsListing formats
Section titled “Listing formats”palettize formats Export formats┏━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━┓┃ Format ┃ Description ┃ Ext ┃┡━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━┩│ css │ CSS Custom Properties │ css ││ gdal │ GDAL Color Relief Text │ txt ││ gee │ Google Earth Engine Snippet │ js ││ gimp │ GIMP Palette │ gpl ││ ... │ │ │└────────────┴────────────────────────────────┴──────┘Formats contributed by plugins appear here alongside the built-in ones.
Describing a format
Section titled “Describing a format”palettize formats gdalgdal — GDAL Color Relief TextDefault extension: .txtPlaces colors at data values: both --domain and --scale change the output.
┏━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓┃ Option ┃ Type ┃ Default ┃ Description ┃┡━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩│ num_colors │ int │ 256 │ Number of colors to sample. ││ nodata │ bool │ true │ Emit a nodata line. ││ nodata_value │ str │ (unset) │ Nodata value. Defaults to 'nv'. ││ nodata_color │ custom │ 0, 0, 0, 0 │ Nodata RGBA color as 'r,g,b,a'. ││ precision │ int │ (unset) │ Decimal places for data values. ││ verbose │ bool │ false │ Include a descriptive comment header. ││ scale_type │ str │ unknown │ Scaler name recorded in the header. │└──────────────┴────────┴────────────┴───────────────────────────────────────┘The Type column tells you what values are accepted. Options with a fixed set of choices
show them inline, as one of: lines, json, csv.
Does this format use the data domain?
Section titled “Does this format use the data domain?”Below the format name, one of three notes appears:
- Places colors at data values — both
--domainand--scalechange the output. Applies togdal,qgis,sld, andmapgl. - Records
--domainin the output — the domain is written into the file, and--scalematters only under some options. Applies tojson,observable, andgee. - Emits a plain color list — the format has no data axis, so
--domainand--scaledo not apply. Applies tocss,gimp,svg,hex,rgba,hsl, andtitiler.
This is worth checking before assuming a non-linear --scale has taken effect.
Passing options
Section titled “Passing options”Options are passed to create with -O, either globally or scoped to one format:
# Applies to every format in this runpalettize create viridis -f hex,css -O num_colors=16
# Applies only to the gdal exporterpalettize create viridis -f gdal,qgis -O gdal:nodata=falseValues are always strings on the command line; Palettize coerces them to the declared type and reports a clear error if the value does not fit:
Error in 'hex' options: Option 'output_format' must be one of:lines, json, json_nohash, csv. Got: 'bogus'An option name that a format does not recognize produces a warning rather than being silently ignored.
See also
Section titled “See also”palettize create— using these formats- Export format reference — details of each output
- Custom exporters — adding your own