[comp.sys.sgi] Who needs 24 bit colors

Dan Karron@UCBVAX.BERKELEY.EDU (04/04/91)

If you are dithering about colors and bits, here is an interesting piece from
Photonics Spectra, April 1991, Page 119.

Essentialy, the author, Kendal Preston, Jr. argues that we don't need more than
8 bits of color info, and by doing histogram analysis of a medical photomicro-
graph of stained cells shows that most of the histogram bins are empty, and
that dynamic data compression is possible by using a color map with various
criteria to assign a color to a color values with a high frequency.

I don't agree that we should not consider >8 bit in color
workstation design, and we should consider that his scanner may not
have the dynamic range resolution to more evenly fill the color distribution
of his scanned images.

What do you think?

| karron@nyu.edu (e-mail alias )         Dan Karron, Research Associate      |
| Phone: 212 263 5210 Fax: 212 263 7190  New York University Medical Center  |
| 560 First Avenue                       Digital Pager <1> (212) 397 9330    |
| New York, New York 10016               <2> 10896   <3> <your-number-here>  |

tarolli@westcoast.esd.sgi.com (Gary Tarolli) (04/05/91)

In article <9104032223.AA03789@karron.med.nyu.edu>, Dan Karron@UCBVAX.BERKELEY.EDU writes:
> 
> If you are dithering about colors and bits, here is an interesting piece from
> Photonics Spectra, April 1991, Page 119.
> 
> Essentialy, the author, Kendal Preston, Jr. argues that we don't need more than
> 8 bits of color info, and by doing histogram analysis of a medical photomicro-
> graph of stained cells shows that most of the histogram bins are empty, and
> that dynamic data compression is possible by using a color map with various
> criteria to assign a color to a color values with a high frequency.
> 
> I don't agree that we should not consider >8 bit in color
> workstation design, and we should consider that his scanner may not
> have the dynamic range resolution to more evenly fill the color distribution
> of his scanned images.
> 
> What do you think?
> 

I agree that for his pictures 8 bits (256 arbitrary colors) is probably enough.
When you get to select the 256 colors you are going to dither with, you can
get very good results.  Even if you work from a fixed pallete you can get
decent results.

The problems are:
	1) not all pictures will have many empty bins, I have no proof of
		this or experience with this, but I have to believe there
		exists pictures (like colorwheels) that have few empty bins
	2) If you only have 1 256 entry color lookup table and you are in a
		windowed environment, how do you choose/vary the table as
		many different pictures (both scanned and geometric) are
		displayed.  If you chose a fixed palette you can get decent
		results, but it wont please everyone.
	3) there are always those people doing very precise color work who
		wont settle for anything less than 24 bits.

and I agree, if his scanner was flaky or inaccurate in the least, it could
invalidate all his results.


--------------------
	Gary Tarolli

prevost@eos.arc.nasa.gov (Michael Prevost) (04/05/91)

What about the case where someone is doing smooth shading? You can burn up a lot
of colors that are very close to the same but the eye is very sensitive to 
comparing two colors side by side. If you don't want color banding you had 
better have many bit planes.

mp..

Sterling Software 
NASA-Ames MS 239-9
Moffett Field CA
prevost@eos.arc.nasa.gov

dale@lamont.ldgo.columbia.edu (dale chayes) (04/05/91)

In article <9104032223.AA03789@karron.med.nyu.edu>, 
Dan Karron@UCBVAX.BERKELEY.EDU transcribed an article that appeared in:

> Photonics Spectra, April 1991, Page 119 by Kendal Preston, Jr. 

Who contends that for his application in some kind of
photomicrography, 8 bit color and clever use of dynamic compression
was sufficient.

Dan closed with:

> What do you think?


I don't know much about the dynamic range of photomicrographs, but if
that was his one and only test case before decreeing that there was no
need for displays with more dynamic range than that allowed by 8-bit
color, then it seems to me not only might his system for obtaining the
color images be of limited dynamic range, but perhaps his imagination
is suffering from a similar problem.

We can easily map the ocean floor to a resolution of a meter or two
(lets skip accuracy for the moment) over a range of 10km we need more
than eight bits if we want to color code never mind if we want to add
additional coding for lithology or backscatter function of the
seafloor, or muck around with 3D projections and lighting models.

For some applications, all we care about is the coding (by color in
this case) of the characteristics of one specific image. However, in
many others, we want to color code a whole universe and be able to
visualy compare one image to another in some kind of abosolute scale.
That (in my opinion is where we need the dynamic range.)


Dale
========
"Since we don't don't have much in the way of official policy here
other than the recent edict about dogs in the administration building,
we certainly can't have official opinion, so this must be my
fault...."



-- 
Dale Chayes Lamont-Doherty Geological Observatory of Columbia University
Route 9W, Palisades, N.Y.  10964	dale@lamont.ldgo.columbia.edu
voice:	(914) 359-2900 extension 434	fax: (914) 359-6817

kurt@cashew.asd.sgi.com (Kurt Akeley) (04/05/91)

perhaps the real point here is that 8 bit per component framebuffers
can be used to CREATE high quality images.  it is much more convenient
to do blending and shading arithmetic in a 3-component linear space than
it is in a dithered space.  this is attested to by the existance of
gamma correction, which simply allows calculations such as antialiasing
to operate with linear arithmetic.

-- kurt

shenkin@cunixf.cc.columbia.edu (Peter S. Shenkin) (04/05/91)

OK, here's a question.  How many bits of color resolution can the human
eye perceive?  I asked this question of a friend of mine who's a color
scientist, and (to my surprise) he didn't know.

I suppose I could make the question more operational by asking, "how many
segments would the color wheel need to have that even at high magnification
it would not be possible to see a boundary anywhere?"

	-P.
************************f*u*cn*rd*ths*u*cn*gt*a*gd*jb**************************
Peter S. Shenkin, Department of Chemistry, Barnard College, New York, NY  10027
(212)854-1418  shenkin@cunixf.cc.columbia.edu(Internet)  shenkin@cunixf(Bitnet)
***"In scenic New York... where the third world is only a subway ride away."***

tarolli@westcoast.esd.sgi.com (Gary Tarolli) (04/05/91)

In article <8009@eos.arc.nasa.gov>, prevost@eos.arc.nasa.gov (Michael Prevost) writes:
> What about the case where someone is doing smooth shading? You can burn up a lot
> of colors that are very close to the same but the eye is very sensitive to 
> comparing two colors side by side. If you don't want color banding you had 
> better have many bit planes.
> 

If you only have 4 or 8 bits of RGB then color banding is noticeable in some
cases (or many cases, depending on what kind of images you have).  When you
get up to 12-16 bits of RGB (total not per color channel), then I believe
the dithering hides most of the color banding.  In fact, in some cases (I
wont go as far as to say all) dithering can actually hide the color bands.

I haven't done enough comparisons to see if dithered 16 bits looks better
than 24 bits non-dithered.  I sort of doubt it.  Certainly 8 or 12 bits
dithered will not look as good as 24 bits, but then again it costs less.
But for sure, if you hold the number of bits
constant, dithering greatly improves the image.  The improvement is obviously
most apparent when there are few bitplanes.  Remarkably, dithering hides
most of the color bands even when there's only 8 bits.

Interestingly enough,  dithering is still usefull when you have 24 bits.
If you have a large polygon that is shaded with a very small color slope,
you will see Mach bands where the color changes.  As you pointed out,
the eye is very sensitive to comparing two colors side by side.  But if
you dither the 24 bit image, I believe the banding will disappear.

--------------------
	Gary Tarolli

uselton@nas.nasa.gov (Samuel P. Uselton) (04/06/91)

In article <95622@sgi.sgi.com> tarolli@westcoast.esd.sgi.com (Gary Tarolli) writes:
>In article <8009@eos.arc.nasa.gov>, prevost@eos.arc.nasa.gov (Michael Prevost) writes:
>> What about the case where someone is doing smooth shading? You can burn up a lot
>> of colors that are very close to the same but the eye is very sensitive to 
>> comparing two colors side by side. If you don't want color banding you had 
>> better have many bit planes.
>> 
>
>If you only have 4 or 8 bits of RGB then color banding is noticeable in some
>cases (or many cases, depending on what kind of images you have).  When you
>get up to 12-16 bits of RGB (total not per color channel), then I believe
>the dithering hides most of the color banding.  In fact, in some cases (I
>wont go as far as to say all) dithering can actually hide the color bands.
>
>I haven't done enough comparisons to see if dithered 16 bits looks better
>than 24 bits non-dithered.  I sort of doubt it.  Certainly 8 or 12 bits
>dithered will not look as good as 24 bits, but then again it costs less.
>But for sure, if you hold the number of bits
>constant, dithering greatly improves the image.  The improvement is obviously
>most apparent when there are few bitplanes.  Remarkably, dithering hides
>most of the color bands even when there's only 8 bits.
>
>Interestingly enough,  dithering is still usefull when you have 24 bits.
>If you have a large polygon that is shaded with a very small color slope,
>you will see Mach bands where the color changes.  As you pointed out,
>the eye is very sensitive to comparing two colors side by side.  But if
>you dither the 24 bit image, I believe the banding will disappear.
>
>--------------------
>	Gary Tarolli
>
>

But......
with dithering, you are giving up spatial resolution to get the colors
smoother.  If you need lots of spatial resolution AND smooth colors more bits
is better.

In one of my lives I do ray tracing, and building lighting functions for 
realistic images.  It is entirely possible to have 24 bits per pixel and
still detect the changes at neighboring pixels.

Didn't we have the other end of this discussion not to long ago (when is 
SGI going to start using wider DACs so we can get MORE bits per RGB 
component?) and a person doing vision research said he needed AT LEAST 
12 bits EACH for RGB?


Clearly you don't need more distinct shades than you have pixels on screen,
so I guess a look up table with ~1 Million entries is enough. Thats only 
20 bits per pixel.  But the OUTPUT from the table needs to be BIG!  ( :-) )

So I guess I see why skipping the table step and working in a fixed space
that is easy for interpolation, etc, is good.

Sam Uselton		uselton@nas.nasa.gov	
employed by CSC		working for NASA (Ames)		speaking for myself

tarolli@westcoast.esd.sgi.com (Gary Tarolli) (04/06/91)

> But......
> with dithering, you are giving up spatial resolution to get the colors
> smoother.  If you need lots of spatial resolution AND smooth colors more bits
> is better.
> 
agreed, but I still think you can make a pretty good argument for dithering.
Lets face it, 30 bit RGB with 10 bit DACs etc is not free (today).  Dithering
is just about free if done in hardware. and when done using 8 bits each of
red,green,blue, I don't think you really lose much spatial resolution.
Theoretically you do, but since the colors you are modulating between
are so close together, I don't think edges will look any less sharp or 
images any more grainy.

> In one of my lives I do ray tracing, and building lighting functions for 
> realistic images.  It is entirely possible to have 24 bits per pixel and
> still detect the changes at neighboring pixels.
> 
agreed, I assume you mean if you have a very smooth object with a gradual
change in color.  In this case, dithering should remove any bands.  
I am going to try this on an image, and will try to post the results.

--------------------
	Gary Tarolli

tarolli@westcoast.esd.sgi.com (Gary Tarolli) (04/06/91)

In my last posting, when I was talking about dithering 24 bit colors,
I forgot to mention that what I was implying was that you iterate 
R,G,B using at least 12 bits (preferably a lot more) and then dither
down to 8 bits each.  I didn't mean taking a 24 bit image and then
dither it to 24 bits - this is a nop since the source picture has no
more info than the dest. picture.  Or you could take a 36 bit RGB image
and reduce it to 24 using dithering.  In either case you will lose a 
little spatial resolution, but like I said before, because of the number
of colors you have to choose from, its probably better to dither than
not dither.  Even if you had a full 36 bit video backend with 12 bit DACs
etc., you could iterate colors at 16 bits per component and then dither
them down to 12 bits.  I think the end result will be an improvement!

Unfortunately, I don't have the softare in place to simulate this, so
I won't be posting any pictures.  Maybe someone else can?

--------------------
	Gary Tarolli

Dan Karron@UCBVAX.BERKELEY.EDU (04/07/91)

Some pictures would dither a thousand postings!

dan.
| karron@nyu.edu (e-mail alias )         Dan Karron, Research Associate      |
| Phone: 212 263 5210 Fax: 212 263 7190  New York University Medical Center  |
| 560 First Avenue                       Digital Pager <1> (212) 397 9330    |
| New York, New York 10016               <2> 10896   <3> <your-number-here>  |

osmoviita@cc.helsinki.fi (04/07/91)

In article <1991Apr5.061410.22381@cunixf.cc.columbia.edu>, shenkin@cunixf.cc.columbia.edu (Peter S. Shenkin) writes:
> OK, here's a question.  How many bits of color resolution can the human
> eye perceive?  I asked this question of a friend of mine who's a color
> scientist, and (to my surprise) he didn't know.
> 
12 bit color depth cann still be clearly distinguished from 16 color depth
when suitable images are shown. 14-15 bits grayscale is often considered as
sufficient when studying human vision. Some company published recently 
1,5 GHz 14 bit DAC (ECL) which would be used to make display system matching 
about the human visual system. If scenes varying between bright sunlight and 
dark night are animated perhaps even more bits is needed but this can be done
for example by altering gain in some amplifier.

> I suppose I could make the question more operational by asking, "how many
> segments would the color wheel need to have that even at high magnification
> it would not be possible to see a boundary anywhere?"
> 
This will imply to use indexed colors not direct RGB colors and is
inconvenient and heavy to use because of nonlinearities. To answer it is
nearly impossible because there is not such graphics systems that you can
measure it under 100 years work (guess). So we need 16 bit color depth and 
4 (maybe more) color channels and displays with pure spectral colors 
(laser/led based?) to get a clear answer. IMHO.

> 	-P.
> ************************f*u*cn*rd*ths*u*cn*gt*a*gd*jb**************************
> Peter S. Shenkin, Department of Chemistry, Barnard College, New York, NY  10027
> (212)854-1418  shenkin@cunixf.cc.columbia.edu(Internet)  shenkin@cunixf(Bitnet)
> ***"In scenic New York... where the third world is only a subway ride away."***

Kari Osmoviita, Deparment of Physiology, University of Helsinki, Finland
osmoviita@cc.helsinki.fi

andru@electron.lcs.mit.edu (Andrew Myers) (04/09/91)

In article <95727@sgi.sgi.com> tarolli@westcoast.esd.sgi.com (Gary Tarolli) writes:
>agreed, but I still think you can make a pretty good argument for dithering.
>Lets face it, 30 bit RGB with 10 bit DACs etc is not free (today).  Dithering
>is just about free if done in hardware. and when done using 8 bits each of
>red,green,blue, I don't think you really lose much spatial resolution.
>Theoretically you do, but since the colors you are modulating between
>are so close together, I don't think edges will look any less sharp or 
>images any more grainy.

On the newer monitors, it becomes more obvious that dithering is losing you
spatial resolution. The older monitors from SGI blur adjacent pixels enough
that you have already lost that resolution; hence, dithering seems like a
total win.

Andrew