Composite Bands (Data Management)

Summary

Creates a single raster dataset from multiple bands.

Illustration

Composite Bands illustration

Usage

  • This tool can also create a raster dataset containing subset of the original raster dataset bands. This is useful if you need to create a new raster dataset with a specific band combination and order.

  • The order that the bands are listed in the Multi-value Input control box will determine the order of the bands in the output raster dataset.

  • This tool can only output a square pixel size.

  • You can save the output to BIL, BIP, BMP, BSQ, DAT, Esri Grid, GIF, IMG, JPEG, JPEG 2000, PNG, TIFF, MRF, or CRF format, or any geodatabase raster dataset.

  • The output raster dataset takes the cell size from the first raster band in the list.

  • By default, the output raster dataset takes the extent and the spatial reference of the first raster band with a spatial reference in the list. You can change this by setting the output extent and output coordinate system in the Environment Settings.

  • The following are some examples of why you would want to combine single raster datasets into multiband raster datasets:

    • You may have received some satellite data where each band of data is contained in a single file—for example, band1.tif, band2.tif, and band3.tif. To render these raster datasets together to create a color composite, each band needs to be contained within a single raster dataset (for example, allbands.tif).
    • You may have several raster datasets of the same area captured at various times. By displaying these raster datasets as a color composite, you can detect change in the area, such as urban growth or cut forests. To create this color composite, each raster dataset needs to be contained as individual bands within a single raster dataset.
    • In some cases, the output of an analysis operation is a single-band raster dataset. To do further visual analysis, you may need to combine the outputs by rendering your data as a color composite.
    • Combining bands into one raster dataset can help you organize many related single-band rasters.

Parameters

LabelExplanationData Type
Input Rasters

The raster datasets that you want to use as the bands.

Mosaic Dataset ; Mosaic Layer ; Raster Dataset ; Raster Layer
Output Raster

The name, location and format for the raster dataset you are creating. Make sure that it can support the necessary bit-depth.

When storing the raster dataset in a file format, specify the file extension as follows:

  • .bilEsri BIL
  • .bipEsri BIP
  • .bmp—BMP
  • .bsqEsri BSQ
  • .dat—ENVI DAT
  • .gif—GIF
  • .img—ERDAS IMAGINE
  • .jpg—JPEG
  • .jp2—JPEG 2000
  • .png—PNG
  • .tif—TIFF
  • .mrf—MRF
  • .crf—CRF
  • No extension for Esri Grid

When storing a raster dataset in a geodatabase, do not add a file extension to the name of the raster dataset.

When storing a raster dataset to a JPEG format file, a JPEG 2000 format file, a TIFF format file, or a geodatabase, you can specify Compression Type and Compression Quality values in the geoprocessing environments.

Raster Dataset

arcpy.management.CompositeBands(in_rasters, out_raster)
NameExplanationData Type
in_rasters
[in_rasters,...]

The raster datasets that you want to use as the bands.

Mosaic Dataset ; Mosaic Layer ; Raster Dataset ; Raster Layer
out_raster

The name, location and format for the raster dataset you are creating. Make sure that it can support the necessary bit-depth.

When storing the raster dataset in a file format, specify the file extension as follows:

  • .bilEsri BIL
  • .bipEsri BIP
  • .bmp—BMP
  • .bsqEsri BSQ
  • .dat—ENVI DAT
  • .gif—GIF
  • .img—ERDAS IMAGINE
  • .jpg—JPEG
  • .jp2—JPEG 2000
  • .png—PNG
  • .tif—TIFF
  • .mrf—MRF
  • .crf—CRF
  • No extension for Esri Grid

When storing a raster dataset in a geodatabase, do not add a file extension to the name of the raster dataset.

When storing a raster dataset to a JPEG format file, a JPEG 2000 format file, a TIFF format file, or a geodatabase, you can specify Compression Type and Compression Quality values in the geoprocessing environments.

Raster Dataset

Code sample

CompositeBands example 1 (Python window)

This is a Python sample for the CompositeBands tool.

import arcpy
from arcpy import env
env.workspace = "c:/data"
arcpy.CompositeBands_management("band1.tif;band2.tif;band3.tif",
                                "compbands.tif")
CompositeBands example 2 (stand-alone script)

This is a Python script sample for the CompositeBands tool.

##====================================
##Composite Bands
##Usage: CompositeBands_management in_rasters;in_rasters... out_raster

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

##Compose multi types of single band raster datasets to a TIFF format raster dataset
arcpy.CompositeBands_management("band1.tif;comp.mdb/band2;comp.gdb/bands/Band_3","compbands.tif")

Licensing information

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

Related topics