[comp.windows.news] Dithering

russ%yummy@GATEWAY.MITRE.ORG (11/02/88)

	Automatic dithering in NeWS is a great feature, BUT,
	I want to turn it OFF sometimes so I can display
	images that reflect the actual data.

	How can I turn off the dithering when rendering
	a canvas in a window?

	Thanks, Russ


ARPA: russ%yummy@gateway.mitre.org

Russell Leighton
M.S. Z406
MITRE Signal Processing Lab
7525 Colshire Dr.
McLean, Va. 22102
USA

greg@gergle.UUCP (11/03/88)

>	Automatic dithering in NeWS is a great feature, BUT,
>	I want to turn it OFF sometimes so I can display
>	images that reflect the actual data.
>
>	How can I turn off the dithering when rendering
>	a canvas in a window?

This has been a popular question. NeWS has a static color table.
When you bring in a foreign 8 bit color image, it simply picks
close colors. 24 bit files are dithered into the static color table.

I don't believe there is any dither taking place for 8 bit images.

The only solution would be to somehow change the color lookup table
on the display, without the help of NeWS. Of course everything else
on the display will look like junk.

	-greg.

russ%yummy@GATEWAY.MITRE.ORG (11/05/88)

>>	Automatic dithering in NeWS is a great feature, BUT,
>>	I want to turn it OFF sometimes so I can display
>>	images that reflect the actual data.

>	I don't believe there is any dither taking place for 8 bit images.

It's more the "smoothing" between pixels that is disastering our stuff.  If you create 
a canvas of (basically) random color pixels, when you render a magnified version 
you get odd star bursts of colors and other odd things !?!  Sometimes we need
to just have pixel replication so we get squares of color.  Right now we have
to draw individual squares which tends to be deathly slow.  

Is there anyway to turn off the interpolating feature (?) so we can quickly render
what the computer is taking as random arrays of colors?

greg@gergle.UUCP (11/06/88)

>It's more the "smoothing" between pixels that is disastering our stuff.  If you create 
>a canvas of (basically) random color pixels, when you render a magnified version 
>you get odd star bursts of colors and other odd things !?!  Sometimes we need
>to just have pixel replication so we get squares of color.  Right now we have
>to draw individual squares which tends to be deathly slow.  
>
>Is there anyway to turn off the interpolating feature (?) so we can quickly render
>what the computer is taking as random arrays of colors?

If you use the NeWS static color table your colors will not be touched.
There are 2 ways to get this table, either use adb and grab 256 chars after
red_map, blue_map, green_map, or dump a color image file with writecanvas
and grab its colortable.

If you blow the image up with writecanvas, limit the scale factor to 
whole integer multiples of the original width and height. Since the Sun
implementation simply grabs more pixel as you scale, you will get the affect
of enlarged pixels. Note: this has the bad point of making your code specific
to a particular NeWS implementation. The correct way would be to enlarge 
the bitmaps on the client size and send over the images with a 1to1 
transformation to screen pixels. 


	-greg.