#I was trying to display an elevation map in color with a shadow
#releif map in grey tone. I have tried 'd.his' using elevation
#as hue and shadow relief as intensity. It looks OK only if I stay
#far enough; the display is somehow noisy with many pixels of
#different colors scattering arround.
This is probably the best that GRASS (and your display monitor) can do.
I suspect that the scattering of different colors would be corrected if
you put the monitor into "fixed" mode. (d.colormode fixed) If the
scattering you talk about is on the subtle side - colors just slightly off,
then your colormode is "fixed" and the d.his program is dithering the
available colors to get the best representation it can out of a 6x6x6
color table (RxGxB). Basically you (and GRASS) are asking too much of
8 bit planes of graphics - you are experiencing the lure of 24 bit plane
#I've checked the manual and it seems to me that 'd.rgb' will not
#display the values from the individual R, G, B files; rather,
#it will take averages of them, therefore the RGB values displayed
#by 'd.rgb'are different from the original RGB values defined
#in the color table of elevation.
Correct. d.rgb was created to display three "grey-scale" sets of data.
It forces a grey-scale by averaging the RGB values.
#So, how can I display a map using its RGB values?
#Does any netter have similar experience on these problem?
#Any advice on 'd.rgb', 'd.his', and map overlay will
You have done what you can with your 8-plane graphics device and GRASS.
We have experimented with approaches to capturing d.his output into
24-bit map files and then reducing this result to 8 bits by finding
the most common colors. There are several known approaches to this
process which have been played with through other packages. We've never
had a strong enough need (nor has anyone contracted) for this capability.
Users are encouraged to stick with "colormode fixed" which is the default
anyhow because it allows the simultaneous rendering of many maps.
Processing a 24-bit map into an 8-bit map with a color table that is
ONLY useful through "colormode float" can also be problematic with
If you are a programmer, you might want to consider the following approach:
1) Modify d.rgb to generate 24-bit output maps
2) Write a new program that converts the 24-bit map to an 8-bit map. A
translation and color table is generated by the following flow:
1) Split the 256x256x256 (RGB) color space into 8 quadrants.
2) Divide all the pixels into the different quadrants by assigning each
pixel to the geometrically closest quadrant.
3) Count the total in each quadrant.
4) If there are < 256 quadrants, create a color map and translate the
24 bit map into an 8 bit map. Quit
5) Split the quadrant with the most colors into 8 smaller quadrants.
6) Go to 2
3) Such code has been written for other systems and may be available
Alternately, buy a 24-bit device and upgrade all of GRASS to utilize the
full 24 bits :-)
> Date: Tue, 14 Apr 1992 16:57:17 -0500
> From: Jim Westervelt <[hidden email]>
> Message-Id: <[hidden email]>
> Sender: [hidden email] > Reply-To: [hidden email] > Precedence: Bulk
> To: [hidden email] > Subject: d.rgb d.his
> Jinn-Guey Lay questions:
> #I was trying to display an elevation map in color with a shadow
> #releif map in grey tone. I have tried 'd.his' using elevation
> #as hue and shadow relief as intensity. It looks OK only if I stay
> #far enough; the display is somehow noisy with many pixels of
> #different colors scattering arround.
> This is probably the best that GRASS (and your display monitor) can do.
> I suspect that the scattering of different colors would be corrected if
> you put the monitor into "fixed" mode. (d.colormode fixed) If the
> scattering you talk about is on the subtle side - colors just slightly off,
> then your colormode is "fixed" and the d.his program is dithering the
> available colors to get the best representation it can out of a 6x6x6
> color table (RxGxB). Basically you (and GRASS) are asking too much of
> 8 bit planes of graphics - you are experiencing the lure of 24 bit plane
blend.sh elevation.file aspect.file 70
to create 3 band files (R,G,B)
(or I passed out a copy of intens.sh on this newsgroup a while back. It
will do an even better job)
Then if you have a Silicon Graphics workstation you can use the
Dtrue program to display the resultant composit in true 24 bit color.
If not, use i.median to combine the 3 files into one 8 bit color file.
i.median creates a file with a colortable of 256 colors. This can be
displayed on any GRASS display, but it usually will look much better if
you can display it in float mode on a display which will support 256 colors.
You can acheive this in SUNVIEW by setting an environment variable before
starting the monitor.
I am not sure whether Xdriver supports this or not.
This should be part of the FAQ.
Oh, we don't have a FAQ.
US Army Construction Engineering Research Lab
Spatial Analysis & Systems Team
[hidden email] (217) 352-6511 x591