Skip to main content

Colorization

Colorization methods are palette, colormap and range colorization. These methods are applied for single band images (including bandmath, grayscale, classified image etc.).

  • Palette is used for precise colorization of specified pixel values with defined colors, while unaffected pixels remain transparent. It is convenient way to visualize classification image or to pick out desired fetures. Also palette can be used for colorizing bits of Landsat 8 BQA band.

  • Colormap API is used for colorizing whole image without leaving transparent areas. Many default colormaps have monotonically increasing lightness through them and equal steps in data are perceived as equal steps in the color space, so colorized by such colormap image is better interpreted by the viewer. User can also create its own colormap by specifying colors and their positions.

  • Range colorization is used for precise colorization of pixels by specifying thresholds and fill colors between these thresholds. There is no need to specify single pixel values, unlike in Palette colorization, and there will be only user-specified colors, unlike Colormap colorization.

    Colorization priority is following:

  1. Palette;
  2. Colormap;
  3. Range colorization (Colors + Thresholds);

Palette

Palette is the set of dictionary type pairs of the following form: {“pixel value”:”color code”}. Palette’s colorization feature is strict conformity with set values. Pixels without set color codes are transparent. Palette is used only for integer datasets.

Single band usage

Bandmath pixel values specified as keys by PALETTE dictionary, colors (in form of RGB or hex) that correspond these pixel values are specified as values. If bandmath pixel values don’t have a color tied to them in the PALETTE, pixels are made transparent.

Bit numbers (BQA) usage

PALETTE is a dictionary with bit numbers (1 bit number or 2 as a tuple) as keys and colors (in form of RGB or hex) as values. If in any given pixel some bits have value 1, it’s set to corresponding color from the PALETTE. If bits don’t have a color tied to them in the PALETTE, pixels are made transparent. Without this parameter BQA is colorized with default palette.

Palette usage examples

PALETTE is used as query parameter.

Examples for bandmath usage:

https://api-connect.eos.com/api/render/NAIP/ne/2016/60cm/rgbir/40100/m_4010039_sw_14_h_20160918/R+1/15/7264/12357?PALETTE=%7B%22150%22%3A%22ff0000%22%2C%22160%22%3A%2200ff00%22%2C%22170%22%3A%220000ff%22%2C%22180%22%3A%22000000%22%7D&api_key=XXX

Palette