Lots of colours under XDRIVER

JWO%LEICESTER.AC.UK at VTVM2.CC.VT.EDU JWO%LEICESTER.AC.UK at VTVM2.CC.VT.EDU
Mon Jan 6 05:13:20 EST 1992


In response to Duane Wessels' question and Michael Shapiro's answer:

>The GRASS graphics drivers use color lookup tables (reserving about 15
>colors for vector "overlays"). This means that images with more than
>240 colors for a 256 color display can't fit all its colors into the
>hardware lookup table. In order to display the image a 6x6x6 color cube
>is loaded into the hardware color registers (ie fixed mode) and the
>nearest color is used instead of the "true" color. If you have an image
>with a grey scale color map, and that image has more than 240 colors
>(eg 1-255), then you get 6 levels of grey. The only solution is to
>rescale the image data into the range 1-240 and set a grey scale for
>the rescaled image.

I too use GRASS on a Sun (SunOS4.1.1,OpenWindows) but have found the fixed/
floating cut off point to be at 220. More importantly, if I try to rescale
an image using r.mapcalc to anything with more than 220 categories, I get
an error when I try to display the image.

eg. suppose I have a raster map with range 0-444, and I type the following

GRASS 4.0 > d.colormode float
GRASS 4.0 > r.mapcalc
mapcalc> newmap = oldmap/2
				[range 0-222]
GRASS4.0 > d.rast newmap

GRASS will then display this as a floating colour image with the exception of
any cell values of 221 or 222, and give the message:

reset_color: can't set color 256
reset_color: can't set color 257

This error is repeated for the number of categories over 220.

Has anyone else experienced a similar problem, or know how to solve it ?

------------------------------------------------------------------------
Jo Wood
Project ASSIST                  	email:	JWO at UK.AC.LEICESTER
Midlands Regional Research Laboratory	tel:	0533 523625
University of Leicester          	fax:    0533 522200
LEICESTER LE1 7RH
UK
------------------------------------------------------------------------



More information about the grass-dev mailing list