The STRETCH procedure stretches the image display color tables so the full range runs from one color index to another. The modified colortable is loaded, but the COLORS common block is not changed. The original colortable can be restored by calling STRETCH with no arguments. A colortable must be loaded before STRETCH can be called.
This routine is written in the IDL language. Its source code can be found in the file stretch.pro in the lib subdirectory of the IDL distribution.
Load the STD GAMMA-II color table by entering:
Create and display an image by entering:
Now adjust the color table with STRETCH. Make the entire color table fit in the range 0 to 70 by entering:
STRETCH, 0, 70
Notice that pixel values above 70 are now colored white. Restore the original color table by entering:
Note: The window-oriented procedures will not work without a window system.
STRETCH [, Low, High [, Gamma]] [, /CHOP]
The lowest pixel value to use. If this parameter is omitted, 0 is assumed. Appropriate values range from 0 to the number of available colors-1. If no parameters are supplied, the original color tables are restored.
The highest pixel value to use. If this parameter is omitted, the number of colors-1 is assumed. Appropriate values range from 0 to the number of available colors-1.
An optional Gamma correction factor. If this value is omitted, 1.0 is assumed. Gamma correction works by raising the color indices to the Gamma power, assuming they are scaled into the range 0 to 1.
Set this keyword to set color indices above the upper threshold to color index 0. Normally, values above the upper threshold are set to the maximum color index.