Colormap

URL:
https://<imageservice-url>/colormap
Methods:
GET
Required Capability:
Image
Version Introduced:
10.1

Description

The colormap resource returns RGB color representation of pixel values. This resource is supported if the hasColormap property of the service is true and the colormapToRGB property is false .

Support for the renderingRule parameter was added at 10.6. This is used to retrieve a color map defined through the server-side raster function template associated with image services. Image services always support this operation regardless of the hasColormap property setting of the service, but it requires the colormapToRGB property to be false.

Request parameters

ParameterDetails

renderingRule

(Optional)

Specifies the rendering rule for how the requested image should be rendered. Refer to the raster function JSON objects for examples and syntax.

variable

This parameter was added at 10.8.1 and it is available if the image service uses ArcObjects11 or ArcObjectsRasterRendering as the service provider.

This parameter can be used to request a colormap for each variable for an image service that has multidimensional information. It will return a colormap for the whole image service if not specified. Eligible variable names can be queried from the Multidimensional Info image service resource.

f

The response format. The default response format is html .

Values: html | json

Example usage

Below is a sample request URL that demonstrates how this request can be used to return the colormap of an image service:

1
https://machine.domain.com/webadaptor/rest/services/LandCover/ImageServer/colormap?f=json

Below is a sample request URL that demonstrates how to return the color map defined in a raster function template of an image service:

1
https://machine.domain.com/webadaptor/rest/services/LandCover/ImageServer/colormap?f=json&renderingrule={"rasterFunction":"myRFTthatHasColormapFunctionAtTheEnd"}

JSON Response syntax

1
2
3
4
5
6
{
  "Colormap": [
    [<value1>, <red1>, <green1>, <blue1>], //[int, int, int, int]
    [<value2>, <red2>, <green2>, <blue2>]
  ]
}

JSON Response example

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
  "colormap": [
    [
      11,
      102,
      140,
      190
    ],
    [
      12,
      255,
      255,
      255
    ]
  ]
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close