User's Guide

HIS

Translates RGB inputs into HIS outputs or vice versa.

Function:

Translates a three-band input image representing red, green, and blue values into hue, intensity, and saturation components. In addition, it also translates an image representing hue, intensity, and saturation into red, green, and blue values.

Parameters:

Subcommand -RGB2HIS:
Converts RGB to HIS. Translates a three-band input image representing red, green, and blue values into an image representing hue, intensity, and saturation components. This process is the reverse of the subcommand HIS2RGB, which translates the hue, intensity, and saturation components into red, green, and blue values.

IN
Input image. The input image must be BYTE and must contain three image bands containing the red, green, and blue components. Windowing and subbanding of input images is allowed.

OUT
Output image. The output image is a three-band image containing the hue, intensity, and saturation components. The output data type is INTEGER*2.
Subcommand -HIS2RGB:
Converts HIS to RGB. Translates a three-band input image representing hue, intensity, and saturation components into a three-band image representing red, green, and blue values. This process is the reverse of the subcommand RGB2HIS which translates red, green, and blue values into hue, intensity, and saturation components.

IN
Input image. The input image must be INTEGER*2 and must contain three image bands, containing the hue, intensity, and saturation components in that order.

OUT
Output image. The output image is a three-band image containing the red, green, and blue components. The output data type will be BYTE.

Example:

  1. LAS> his-rgb2his in=rgbimg out=hisimg

    RGB2HIS translates RGBIMG (containing the three images of RGB components) into HISIMG (consisting of HIS components).

  2. LAS> his-his2rgb in=hisimg out=rgbimg

    HIS2RGB translates HISIMG (containing the three HIS component images) into RGBIMG (consisting of RGB components).

Description/Algorithm:

A variety of techniques exist for displaying multi-spectral image data in color. One of these is chromaticity. HIS (hue, intensity, and saturation) is a chromatic representation. Hue refers to the actual color; intensity refers to the brightness or dullness of a color; saturation refers to the purity of the color. The algorithm used in this module was modeled after one presented in Fundamentals of Interactive Computer Graphics by J. D. Foley and A. VanDam.

This algorithm is specifically set up for RGB data to HIS data for the RGB2HIS subcommand and for HIS data to RGB data for the HIS2RGB subcommand.


     Reference:

     J. D. Foley and A. VanDam, Fundamentals of Interactive 
     Computer Graphics, Addison-Wesley Publishing Company, 
     Reading, Massachusetts, 1982, Chap. 17, Section 17.4.5, 
     "The HLS Color Model," p. 617.

Nonfatal Error Messages:

  1. [his-alloc] Error allocating dynamic memory

    Unable to allocate buffer memory.

  2. [his-warn] Nonfatal error encountered

    A nonfatal error was encountered during processing.

Fatal Error Messages:

  1. [his-open] Unable to open <XXXXX> image

    Unable to open input or the output image. Verify that the image exists.

  2. [his-bands] IN must contain exactly three bands

    Message indicates that image IN contains less than or more than three bands which are required. Error results because HIS tries to apply the HIS to RGB or RGB to HIS algorithm and fails if three bands are not present.

  3. [his-window] Input images do not have the same window sizes

    Message indicates that the size of the windows within images IN are not equal. To correct the error, use the window option to indicate the size to be used.

  4. [his-type] Invalid input data type--<XXXXX> only

    The subcommand RGB2HIS only allows BYTE data for input; subcommand HIS2RGB only allows INTEGER*2 data for input. Use COPY to convert the input image to BYTE or INTEGER*2 data for subcommands RGB2HIS or HIS2RGB, respectively.

  5. [his-fatal] Fatal error encountered

    A fatal error was encountered during processing. The output image file is either deleted or not depending upon the global $DELFLG, and processing is terminated. The message that is displayed immediately preceding this error message is the specific error that was encountered.

User Notes:

  1. The hue component is created with values ranging from -1 to 359 with the intensity and saturation values ranging from 0 to 255. The digital values representing the different hues are as follows:

                    No color =   -1	
    		Red   	 =    0
    		Yellow   =   60
    		Green    =  120
    		Cyan	 =  180
    		Blue	 =  240
    		Magenta  =  300