ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Add Colormap

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Adds a new colormap or replaces an existing colormap on a raster dataset.

Usage

  • The color map applied to the input raster dataset can originate from a raster dataset that already has a color map, a .clr file, or an .act file.

  • This tool will not work when the color map is internally stored in the attribute table of an IMG or TIFF dataset. If the attribute table contains the fields Red, Green, and Blue, that means this tool cannot be used.

  • The input raster dataset must be a single band raster dataset with integer values. Color maps can only be created for single-band raster datasets with a pixel depth of 16-bit unsigned or fewer. Certain formats cannot have a color map associated with them; please consult the Supported raster dataset file formats.

Syntax

AddColormap_management (in_raster, {in_template_raster}, {input_CLR_file})
ParameterExplanationData Type
in_raster

The raster dataset to add or replace a color map.

Raster Layer
in_template_raster
(Optional)

A raster dataset that has a colormap that you want to apply to the input raster dataset. If this is entered the input_CLR_file parameter cannot be specified.

Raster Layer
input_CLR_file
(Optional)

Specify a .clr or .act file to use as the colormap.

File

Code sample

AddColormap example (Python window)

This is a Python sample for AddColormap.

import arcpy
arcpy.AddColormap_management("c:/data/nocolormap.img", "#",
                             "colormap_file.clr")
AddColormap example 2 (stand-alone script)

This is a Python script sample for AddColormap.

##====================================
##Add Colormap
##Usage: AddColormap_management in_raster {in_template_raster} {input_CLR_file}

import arcpy
arcpy.env.workspace = r"C:/Workspace"

##Assign colormap using template image
arcpy.AddColormap_management("nocolormap.img", "colormap.tif", "#")

##Assign colormap using clr file
arcpy.AddColormap_management("nocolormap.img", "#", "colormap_file.clr")

Environments

  • Current Workspace

Licensing information

  • ArcGIS for Desktop Basic: Yes
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • An overview of the Raster toolset
  • Environment settings for raster data
  • Key concepts of raster dataset color maps
  • Options when mosaicking with colormaps
  • Creating a color map (.clr) file

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal