English

How To: Clip a full color (RGB) or multiband image

Summary

You need to clip each band by first converting the image to a grid, clipping the individual grids, and the converting them back to an image.

The example below uses an RGB (red-gree-blue) image. For images with more than three bands, such as Landsat TM 7-band images, you can use the same method for all the bands.

Procedure

  1. Convert image to a grid:

    Code:
    Arc: IMAGEGRID img.tif img

    In this example, the img.tif file is converted to the img grid stack, which contains three grids: imgc1, imgc2, and imgc3.

  2. Clip the individual grids:

    Code:
    Arc: GRID
    Grid: GRIDCLIP imgc1 imgclipc1 COVER clipcov
    Grid: GRIDCLIP imgc2 imgclipc2 COVER clipcov
    Grid: GRIDCLIP imgc3 imgclipc3 COVER clipcov

    You can use any clipping procedure here, such as Arc GRIDCLIP, GRID SETMASK, or GRID CON expressions.

  3. Create a new stack of the cliped grids:

    Code:
    Grid: MAKESTACK imgclip LIST imgclipc1 imgclipc2 imgclipc3
    Grid: q

  4. Convert the new stack to an image:

    Code:
    Arc: GRIDIMAGE imgclip # imgclip.tif tiff

Related Information