English

How To: Create a pseudocolor image from a multiband RGB grid dataset

Summary

The color of a particular cell in a multiband RGB grid stack is determined by the combination of values of that cell in the component layers. You can generate a single band pseudo-color image with a colormap file by combining the component grids so there is a different value for each unique combination of red, green and blue values. The number of combinations must be less than 256.

Procedure

Assume there are three grids that represent the three RGB bands, and are named 'red', 'green', and 'blue'.

  1. Combine the red, green and blue bands.

    Code:
    Grid: comb1 = COMBINE (red, green, blue)


    This operation will process the three grids and assign a different value to each unique combination of red, green and blue cell values.

  2. Go into tables and select the info file.

    Code:
    Arc: TABLES
    Tables: SELECT comb1.vat

  3. Unload the contents of the vat into an ASCII file. You should not use the item for the count field.

    Code:
    Tables: UNLOAD cmap.clr value red green blue COLUMNAR format.txt

  4. You can delete the format.txt file, as it is not really needed.

    Code:
    Tables: &SYS DEL format.txt

  5. You can convert the grid generated by the COMBINE operation to an image with a colormap:

    Code:
    Arc: GRIDIMAGE comb1 cmap.clr img_pseudo.tif tiff

    Note:
    The .clr file serves as a standard colormap file.


    Note:
    This procedure can be used with RGB images by first converting them to a gridstacks with the IMAGEGRID command.