Combining colored and grayshade rasters with high fidelity

By Rajinder Nagi, Esri Cartographic Product Engineer

Africa thumb

Have you ever noticed when you display a colored raster, such as elevation tints, transparently over a grayscale raster, such as a hillshaded surface, that you lose the intensity of your colors and that it is harder to see the hillshade details? This is a problem common to all software in which colors and grayshades are combined.

In this blog entry, we explain how you can overlay colored rasters on graytone rasters without losing detail in the graytones or intensity in the   colors. The example here uses a colormap file and mosaic dataset functions. In a related blog entry, we demonstrate the same overlay method using color ramps and Image Analysis functions. No matter how you work with your rasters, this new overlay method will allow you to retain the detail and colors in the overlaid rasters.

In the example below (figure 1), a layer tint with colors that relate to elevation values is overlain on a gray hillshade of the land surface. The resulting map looks washed out and relatively flat.

Color and Grayshade - Figure 1A
Color and Grayshade - Figure 1B

Color and Grayshade - Figure 1C

Figure 1. The first map above is a layer tint that shows elevation in different colors. The second map is a hillshade of the land surface. When the layer tint is overlain on the hillshade with 50% transparency, the colors of the elevation are washed out and the details of the hillshade are obscured.

Now there is a way you can retain your original colors and still show the detailed hillshade (figure 2). The method described uses the new mosaic datasets that were introduced in ArcGIS 10. A subsequent blog post explains how to achieve this effect with color ramps and Image Anakysis tools.

Color and Grayshade - Figure 2

Figure 2. This map right shows how the layer tint and hillshade can be combined to retain the original colors in the layer tint and the detail of the hillshade.

Combining the layer tint and hillshade to create the desired result is a three-step process:

  1. Create a mosaic dataset.
  2. Add data to the mosaic dataset.
  3. Define the functions that allow the mosaic dataset to be displayed properly.

In this example, a digital elevation model (DEM) is used to create both the layer tint and the hillshade. The layer tint is rendered using a color map which is a text file that contains a color specification for each elevation value. When using a color map file in ArcGIS 10, all values must be positive – the methods we used to create the color map file and modify the DEM to satisfy this requirement are described in two related blog entries on Mapping Center: Using ETOPO1 data and Symbolizing ETOPO1 data.

Create the Mosaic Dataset

A mosaic dataset is a type of data stored in a geodatabase that allows you to manage and view collections of raster data. You can add raster data to a mosaic dataset and then modify the properties and functions used to view the data.

  1. Start ArcMap and open ArcCatalog.
  2. In ArcCatalog, create a new file geodatabase by right clicking the folder for the new geodatabase and selecting New > File Geodatabase.
  3. Rename the geodatabase.
  4. Right click the geodatabase and click New > Mosaic Dataset.
  5. Input a name for the mosaic dataset and set a coordinate system. In this example we used the Robinson projection for the world.
  6. Click OK.
  7. The mosaic dataset will appear under the file geodatabase in ArcCatalog and a new layer will appear in the table of contents (figure 3).
    Color and Grayshade - Figure 3
    Figure 3. The mosaic dataset in the table of contents.

Add Data to the Mosaic Dataset

  1. In ArcCatalog, right click the mosaic dataset and click Add Rasters.
  2. Keep the default Raster Type as Raster Dataset, then click the browse button to input the raster dataset, and navigate to select the raster data you want to add.
  3. Click OK.

Define the Functions for the Mosaic Dataset

  1. In ArcCatalog, right click the mosaic dataset and click Properties.
  2. On the Functions tab, right click Mosaic Function > Properties.
  3. On the General tab of the Mosaic Dataset Properties dialog change the Output Pixel Type to 16 Bit Unsigned.
  4. Click OK.
  5. On the Functions tab, right click Mosaic Function > Insert > Colormap Function.
  6. Browse to the colormap file. (Note that you can download a colormap file for ETOPO1 and other elevation data from Mapping Center.)
  7. Right click Colormap Function > Insert > Colormap to RGB Function.
  8. On the General Tab, change the Output Pixel Type to 8 Bit Unsigned.
  9. On the Functions tab, right click Colormap to RGB Function > Insert > Pansharpen Function.
  10. For Panchromatic, select the hillshade, if you have one. If you do not, select the DEM.
  11. Change the Method as Simple Mean.
  12. Keep the rest of the defaults and click OK.
  13. If you do not select a hillshade in step 10, right click the DEM > Insert > HiIlshade. Keep the defaults and click OK. (If it is not projected, change the Z-factor according to the values in this entry: Setting the Z Factor Parameter Correctly.)
  14. Right click the Pansharpening Function > Insert > Stretch Function.
  15. Change the Type to Minimum-Maximum.
  16. Check the option to Use Gamma.
  17. Input 0.5 as the Gamma value for each of the three bands.
  18. Input 10 and 220 as the Min and Max Statistics values for each of the three bands. (After you have checked the results, feel free to experiment with these Gamma, Min, and Max values in the Stretch Function.)
  19. Click OK.
  20. To see the results in the ArcMap window, right click Footprint in the table of contents > Open Attribute Table, right click the MaxPS field, and click Field Calculator.
  21. For “MaxPS =”, input [MaxPS] * 10000 and click OK. (For more information about what scalar value to use in this equation, read the online help topic Cell size ranges in a mosaic dataset.)
  22. Close the attribute table.

The final function chain will look like figure 4.

Color and Grayshade - Figure 4

Figure 4. The final function chain.
The final result will look something like figure 5.
Color and Grayshade - Figure 5

Figure 5. The final results.

This method of displaying hillshade and layer tints produces a result that retains the fidelity of both the rasters. The same method can be applied to any colored raster combined with a grayscale raster.

Thanks to Aileen Buckley, Mapping Center Lead, for her help with this blog entry!

This entry was posted in Imagery, Mapping and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

13 Comments

  1. Dlight says:

    I cannot wait to try this!

  2. abuckley says:

    Hope you like the results as much as we do!

  3. abuckley says:

    I like to think of this as the “NAGI ovelay method”, where NAGI stands for “No Alteration of Grayscale or Intensity”. :-)

  4. ethoms says:

    Argh, ArcCatalog crashes after I add the Pansharpening function. Can I get around adding it?

  5. jdvarner says:

    This looks like a great technique, and I’m getting good initial results. Question: is it possible to point to the same underlying mosaic dataset DEM as the input to both the Colormap Function and the Hillshade function? In step 10 of your example, it looks like you point to a separate copy of the DEM for the Hillshade function. However, I’d like to use the mosaic dataset as the input for the hillshade step. In your figure 4, I’m imagining this would look like “Hillshade Function->Mosaic Function” instead of “Hillshade Function->DEM”.

    I’d like to apply this technique as a raster function on an Image Service, but I think it won’t work if I have to point to more than one raster in the function chain… do you have any ideas?

    • jdvarner says:

      I figured out how to point to the source mosaic dataset more than once, if you build your function chain in the right order.
      First, I added the Pansharpening function, and set the input to be “” for both the panchromatic and multispectral slots.
      This made the Mosaic appear twice, then I was able to build both the “Colormap->Colormap to RGB” and “Hillshade” branches.
      It’s working great, and I successfully deployed this as a raster function template on an image service.

      • jdvarner says:

        My above comment got formatted wrong, I think because I used HTML tag characters.
        The input to Pansharpening should initially be set to “Mosaic Function.OutputRaster” for both inputs.

  6. chocolatte says:

    I tried this technique with ArcGIS 10.0 sp5 and I end up with a blue tint over my raster. I’ve tried changing the stretch function and using different hillshade and DEM rasters but the most I get is a lighter or darker shade of blue. I used etopo1.clr for the colormap and my raster values are all positive. Am I missing something?
    Thanks, Charlotte

  7. fernandezgis says:

    I have follow the steps above, but my footprint layer doesn’t have any records to perform the field calculator. Any Suggestions?
    Thank you,
    Steven