How To: Create a pseudocolor image from a multiband RGB grid dataset
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.
Assume there are three grids that represent the three RGB bands, and are named 'red', 'green', and 'blue'.
- Combine the red, green and blue bands.
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.
- Go into tables and select the info file.
Tables: SELECT comb1.vat
- Unload the contents of the vat into an ASCII file. You should not use the item for the count field.
Tables: UNLOAD cmap.clr value red green blue COLUMNAR format.txt
- You can delete the format.txt file, as it is not really needed.
Tables: &SYS DEL format.txt
- You can convert the grid generated by the COMBINE operation to an image with a colormap:
Arc: GRIDIMAGE comb1 cmap.clr img_pseudo.tif tiff
The .clr file serves as a standard colormap file.
This procedure can be used with RGB images by first converting them to a gridstacks with the IMAGEGRID command.