HOW TO

Display a grid stack without linear contrast stretch

Last Published: April 25, 2020

Summary

When grid stacks display with IMAGE, a linear contrast stretch applies. Instructions provided describe how to display a grid stack without linear contrast stretch.

Procedure



  • Option 1: Use GRIDCOMPOSITE RGB with the IDENTITY keyword to display the stack without linear contrast stretch. For example, if the grid stack is 'stk', the components are 'stkc1', 'stkc2', 'stk3'. The syntax is:

    Code:
    Grid: GRIDCOMPOSITE RGB stkc1 stkc2 stkc3 IDENTITY

  • Option 2: Use ARC Macro Language (AML) to display a stack without the linear contrast stretch. Numbers are used to identify the red, green, and blue bands, as in the IMAGE command.

    /* imagestk.aml 1.0 Jan 12 2000 12:10 pm
    /*********************************************************************/
    /* NAME: imagestk.aml
    /* MODULE: GRID
    /* PURPOSE: Draws an RGB gridstack without an enhancement stretch
    /* being applied.
    /* The order of bands will default to: 1 2 3.
    /*
    /* Usage: IMAGESTK In_Stack Red_band Green_band Blue_band
    /*
    /* Installation: Save this AML to a text file called
    /* imagestk.aml located in $ARCHOME/atool/grid.
    /*
    /* This AML is not supported by ESRI in any way, nor is ESRI liable
    /* for any damages from its use.
    /*********************************************************************/

    &args in_stk r_band g_band b_band

    /* check if command issued correctly
    &if [null %in_stk%] &then &goto usage

    /* check that input stack exists
    &if not [exists %in_stk% -stack] &then &do
    &type ' ' Stack %in_stk% does not exist
    &return
    &end

    /* set default values for start_val and end_val
    &if [null %r_band%] &then &do
    &sv r_band = 1
    &end
    &if [null %g_band%] &then &do
    &sv g_band = 2
    &end
    &if [null %b_band%] &then &do
    &sv b_band = 3
    &end

    /* get gridname for bands
    &messages &off
    arc tables
    select %in_stk%.stk
    nselect
    &sv r_gc = [show record %r_band% grid]
    &sv g_gc = [show record %g_band% grid]
    &sv b_gc = [show record %b_band% grid]
    q
    &messages &on

    /* draw stack
    gridcomposite rgb %r_gc% %g_gc% %b_gc%

Article ID:000002025

Software:
  • ArcMap 8 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic