[comp.windows.news] NeWS Color Map

glc@c3po.UUCP (Greg Cockroft) (04/08/88)

	>In a recent note (Re:  Scanned images in NeWS), parallax!gergle!greg@Sun.COM
	>says,

	>"If you preprocessed your images using the NeWS color table, nothing 
	>would get touched by NeWS."

	>This implies that NeWS has a specific color table that it uses.  I can
	>imagine that this color table is either static (predefined at NeWS
	>headquarters and fixed for all sites and all time) or dynamic (defined
	>incrementally for a given server execution).

This seems to be a common topic, so I will give a little more detail on how color maps
are handled in NeWS.  The Sun color NeWS server uses a static color map. This allows
the server to make the best possible use out of the limited resource of 256 colors.

Lets just consider RGB for now.
PostScript allows you to define RGB seperately in the graphics context. When a new color
gets set in the graphics context the RGB triple is mapped into the closest color table
entry.

Now consider an 8 bit sun rasterfile with a different color table. The rasterfile
may specify a color which is not in the NeWS color table.  The NeWS server will index
a pixel from the rasterfile into its desired color table, this will produce an RGB triple.
This triple is then mapped into the closest NeWS color table entry.  If the rasterfile
color table matches the NeWS color table, this will end up being a 1 to 1 transformation.

If you have the NeWS source you can change this behavior.  One possible purpose, might
be increase the number of colors allocated to greyscale.

The Parallax 1280 NeWS port has the same colors as the native Sun port, but in a different 
order.  This is to support a seperate mapping for RGB triples into the 32 colors 
available for graphics over video.  

I think the static NeWS color table is an excellent solution for sharing the limited
resource of color on a 8 bit pseudo color display.  The only people I've seen complain
have been image processing folks.  The first time I displayed an 8 bit greyscale image, and
the color wheel did not change I was really suprised.  The greyscale image still looked 
great without changing the entire screen to match its color map.

	>In the static case, can someone provide a list of what colors are in
	>the NeWS color table?

How about this.

c3po% adb `which news_server`
red_map,80?x


	-greg.