ColormapToRGB

サマリー

Converts a single-band raster with a color map to a three-band (red, green, and blue) raster.

説明

For more information about how this function works, see the Colormap To RGB raster function.

The referenced raster dataset for the raster object is temporary. To make it permanent, you can call the raster object's save method.

構文

ColormapToRGB (raster)
パラメーター説明データ タイプ
raster

The input color map raster.

Raster
戻り値
データ タイプ説明
Raster

The output raster.

コードのサンプル

ColormapToRGB example 1

This example converts the raster with a color map to an RGB 3bands raster.

from arcpy.ia import *
out_slope_with_colormap = ColormapToRGB("elevation_raster.tif")
out_slope_rgb_3bands.save("C:/arcpyExamples/outputs/elevtion_rgb_3bands.tif")
ColormapToRGB example 2

This example converts the raster with a color map to an RGB 3bands raster.

# Import system modules
import arcpy
from arcpy.ia import *

# Set the analysis environments
arcpy.env.workspace = "C:/arcpyExamples/data"

# Set the local variables
in_raster = "slope_raster.tif"

# convert the raster with colormap to a RGB 3bands raster
out_slope_rgb_3bands = ColormapToRGB(in_raster)

# save the output
out_slope_rgb_3bands.save("C:/arcpyExamples/outputs/slope_rgb_3bands.tif")