Create Color Composite (Image Analyst)

Summary

Creates a three-band raster dataset from a multiband raster dataset.

Usage

  • When defining the band arithmetic algorithm, you can enter a single-line algebraic formula for each expression to create a multiband output. The supported operators are unary, plus (+), minus (-), times (*), and divide (/).

  • When using a band ID in an expression, identify the band by prefixing the letter B or b to the band number.

  • A common band combination used for synthetic aperture radar (SAR) in linear units is VV for red, VH for green, and VV/VH for blue. If the input data is in decibels, the band combination should be VV for red, VH for green, and VV-VH for blue.

Parameters

LabelExplanationData Type
Input Raster

The input multiband raster data.

Raster Dataset; Raster Layer
Output Raster

The output three-band composite raster.

Raster Dataset
Method

Specifies the method that will be used to extract bands.

  • Band namesThe band name representing the wavelength interval on the electromagnetic spectrum (such as Red, Near Infrared, or Thermal Infrared) or the polarization (such as VH, VV, HH, or HV) will be used. This is the default.
  • Band IDs The band number (such as B1, B2, or B3) will be used.
String
Red Expression

The calculation assigned to the first band.

A band name, band ID, or an algebraic expression using the bands.

The supported operators are unary: plus (+), minus (-), times (*), and divide (/).

String
Green Expression

The calculation assigned to the second band.

A band name, band ID, or an algebraic expression using the bands.

The supported operators are unary: plus (+), minus (-), times (*), and divide (/).

String
Blue Expression

The calculation assigned to the third band.

A band name, band ID, or an algebraic expression using the bands.

The supported operators are unary: plus (+), minus (-), times (*), and divide (/).

String

CreateColorComposite(in_raster, out_raster, method, red_expression, green_expression, blue_expression)
NameExplanationData Type
in_raster

The input multiband raster data.

Raster Dataset; Raster Layer
out_raster

The output three-band composite raster.

Raster Dataset
method

Specifies the method that will be used to extract bands.

  • BAND_NAMESThe band name representing the wavelength interval on the electromagnetic spectrum (such as Red, Near Infrared, or Thermal Infrared) or the polarization (such as VH, VV, HH, or HV) will be used. This is the default.
  • BAND_IDS The band number (such as B1, B2, or B3) will be used.
String
red_expression

The calculation assigned to the first band.

A band name, band ID, or an algebraic expression using the bands.

The supported operators are unary: plus (+), minus (-), times (*), and divide (/).

String
green_expression

The calculation assigned to the second band.

A band name, band ID, or an algebraic expression using the bands.

The supported operators are unary: plus (+), minus (-), times (*), and divide (/).

String
blue_expression

The calculation assigned to the third band.

A band name, band ID, or an algebraic expression using the bands.

The supported operators are unary: plus (+), minus (-), times (*), and divide (/).

String

Code sample

CreateColorComposite example 1 (Python window)

This example creates a color composite using the band names VV, VH, and VV/VH.

import arcpy
arcpy.env.workspace = "D:\Data\SAR\S1\20181014"
out_raster = arcpy.ia.CreateColorComposite(
   "IW_manifest_TNR_CalB0_Dspk_RTFG0_GTC.crf", "BAND_NAMES", "VV", "VH", "VV/VH")
out_raster.save = ("IW_manifest_TNR_CalB0_Dspk_RTFG0_GTC_RGB.crf")
CreateColorComposite example 2 (stand-alone script)

This example creates a color composite using the band names VV, VH, and VV-VH.

# Import system modules 
import arcpy 

# Define input parameters 
in_raster = "D:\Data\SAR\S1\20181014\IW_manifest_TNR_CalB0_Dspk_RTFG0_GTC_dB.crf"
out_raster = "D:\Data\SAR\S1\20181014\IW_manifest_TNR_CalB0_Dspk_RTFG0_GTC_dB_RGB.crf"
method = "BAND_NAMES"
redExp = "VV"
greenExp = "VH"
blueExp = "VV-VH" 

out = arcpy.ia.CreateColorComposite(in_raster, method, redExp, greenExp, blueExp)
out.save(out_raster)
CreateColorComposite example 3 (Python window)

This example creates a color composite using the band IDs the B1, B2, and B1/B2.

import arcpy
arcpy.env.workspace = "D:\Data\SAR\S1\20181014"
out_raster = arcpy.ia.CreateColorComposite(
   "IW_manifest_TNR_CalB0_Dspk_RTFG0_GTC.crf", "BAND_NAMES", "VV", "VH", "VV/VH")
out_raster.save = ("IW_manifest_TNR_CalB0_Dspk_RTFG0_GTC_RGB.crf")

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics