Creates a palette from an attribute, and adds this palette to all selected bands on a raster.

Jump to Configuration

Typical Uses

  • Adding palettes to rasters to meet format or processing requirements.

How does it work?

The RasterPaletteAdder receives raster features, and adds a palette to all selected bands.

The palette must be provided as an attribute, and the band(s) must have an interpretation type of UINT8, UINT16, or UINT32.

Palette keys will be discarded if they do not fit within the interpretation of a selected band. For example, when adding a palette to a UINT8 band, all keys greater than 255 will be dropped.

This transformer supports raster band selection. The RasterSelector can be used to modify selection.


Palettes can be acquired and assigned to an attribute in a number of ways, including:

Format of Palette Attributes

The general format of a palette attribute is as follows:


RGB Example

String Example

<value interpretation> [<string length>]
<key 0> <value 0>
<key 1> <value 1>
<key n> <value n>

0 0,49,190
1 50,255,50
2 172,0,255
3 255,0,0

0 Water
1 Forest
2 Commercial
3 Urban

The first line of the palette must contain the value interpretation. Valid values for the value interpretation are:

  • RGB24
  • RGBA32
  • RGB48
  • RGBA64
  • GRAY8
  • GRAY16

RGBA and RGB palette values consist of comma-delimited strings of integers between 0 and the maximum value of the data type. For example, a valid RGBA32 value would be 64,128,255,255, and a valid RGB48 value would be 16384,32768,65535.

When an interpretation of STRING is specified, the first line may optionally specify the maximum string length of the palette values. This value must be a positive integer. If no string length is explicitly specified, a default of 32 will be assumed.

STRING palette values may consist of any arbitrary text, except for the newline character.

GRAY palette values consist of a single integer between 0 and the maximum value of the data type.

All lines after the first are key-value pairs. Palette keys must be organized in ascending order, but they are not required to be contiguous - that is, not all numbers in the series must be present. All absent palette keys look up to 0 or an equivalent value, such as 0,0,0 for RGB or an empty string for string palettes.


Usage Notes

Choosing a Raster Transformer

FME has an extensive selection of transformers for working with raster data. They can be generally categorized as working with whole rasters, bands, cells or palettes, and those designed for workflow control or combining raster with vector data.

For information on raster geometry and properties, see Rasters (IFMERaster).


Input Ports

Output Ports


Editing Transformer Parameters

Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, click beside the applicable parameter. For more information, see Transformer Parameter Menu Options.

Defining Values

There are several ways to define a value for use in a Transformer. The simplest is to simply type in a value or string, which can include functions of various types such as attribute references, math and string functions, and workspace parameters. There are a number of tools and shortcuts that can assist in constructing values, generally available from the drop-down context menu adjacent to the value field.

Dialog Options - Tables

Transformers with table-style parameters have additional tools for populating and manipulating values.


Processing Behavior


Feature Holding


Dependencies None

FME Community

The FME Community is the place for demos, how-tos, articles, FAQs, and more. Get answers to your questions, learn from other users, and suggest, vote, and comment on new features.

Search for all results about the RasterPaletteAdder on the FME Community.


Examples may contain information licensed under the Open Government Licence – Vancouver and/or the Open Government Licence – Canada.