IMG_TRUE8 Procedure
Generates a pseudo true-color image suitable for display on devices capable of displaying 256 simultaneous colors.
Usage
IMG_TRUE8, red_img, grn_img, blu_img, rgb_img, red, grn, blu
Input Parameters
red_imgA 2D image representing the red component of a true color image. red_img must be the same size as grn_img and blu_img.
grn_imgA 2D image representing the green component of a true color image.
blu_imgA 2D image representing the blue component of a true color image.
Output Parameters
rgb_imgA pseudo true-color 8-bit image that can be displayed using the TV procedure (see Discussion).
redThe red component of the color table.
grnThe green component.
bluThe blue component.
Keywords
None.
Discussion
The image generated by IMG_TRUE8 is suitable for display on devices with 8-bit planes of color. It is useful when you have Landsat type images that you want to merge into a true color system.
For correct appearance, rgb_img should be displayed in a graphics window with n colors allocated to it, where n is 256 under UNIX and 236 under Windows. For example:
WINDOW, 0, Colors = 256
Also, the proper color table needs to be loaded by using the command:
TVLCT, red, grn, blu, 0
where red, grn, and blu are the values obtained from IMG_TRUE8.
Then use the TV procedure to display the image:
TV, rgb_img
 
note
On some systems it may be necessary to click in the image window to see the proper colors.
Examples
This displays a pseudo true-color Landsat image on an 8-bit color system.
PRO img_demo1
   ; Specify the window size.
   winx = 477
   winy = 512
   ; Set up the color components for the true color image.
   red_img = BYTARR(winx, winy)
   grn_img = BYTARR(winx, winy)
   blu_img = BYTARR(winx, winy)
   OPENR, 1, !Data_Dir + 'boulder_red.img'
   READU, 1, red_img
   CLOSE, 1
   OPENR, 1, !Data_Dir + 'boulder_grn.img'
   READU, 1, grn_img
   CLOSE, 1
   OPENR, 1, !Data_Dir + 'boulder_blu.img'
   READU, 1, blu_img
   CLOSE, 1
   ; For Windows, use "Colors=236" in the following line.
   WINDOW, 0, Colors=256, XSize=winx, YSize=winy
   ; Create and display the true color image.
   IMG_TRUE8, red_img, grn_img, blu_img, rgb_img,red, grn, blu
   TVLCT, red, grn, blu, 0
   TV, rgb_img
END
 
note
To see an example using the same data, except displayed in true 24-bit color on a 24-bit X workstation, see the PV‑WAVE User’s Guide.
For a comparison of pseudo- and true-color images, see the PV‑WAVE User’s Guide.
See Also