[comp.graphics] GIF images lack gamma info too:

graeme@labtam.oz (Graeme Gill) (07/23/90)

	While extensions to GIF are being discussed, this may be a good
opportunity to also discuss the inclusion of a field to indicate the gamma of
the display the image has been adjusted for, so that properly written GIF
viewers can compensate for the actual display being used automatically. One
image format which does this already (in a semi-standard way) is the UTAH RLE
format.
	Because most GIF image viewing programs do not compensate the images
for the gamma characteristic of the monitor being used, distributed images
seem to include a variety of gamma compensation levels. I find this variation
second only to aspect ratio in its annoyance factor.
Those images with no compensation (ie. linear images, display gamma = 1.0)
are the ones that appear particularly dark when viewed on most systems.
Systems that compensate for the display gamma will display these dark
images correctly, but the majority of images will appear too light. 
	With an agreed extension, a suitably modified viewer and a utility to
add aspect ratio and gamma information to existing images, then the GIF format
would be much more useful as a system independent format.

				Graeme Gill

				graeme@labtam.oz.au

efwjr@bam-bam.paradyne.com (Ellsworth Warmouth x2882) (07/23/90)

In <5031@labtam.oz> graeme@labtam.oz (Graeme Gill) writes:

> text deleted <

>	Because most GIF image viewing programs do not compensate the images
>for the gamma characteristic of the monitor being used, distributed images
>seem to include a variety of gamma compensation levels. I find this variation
>second only to aspect ratio in its annoyance factor.
>Those images with no compensation (ie. linear images, display gamma = 1.0)
>are the ones that appear particularly dark when viewed on most systems.
>Systems that compensate for the display gamma will display these dark
>images correctly, but the majority of images will appear too light. 

> text deleted <

>				Graeme Gill

>				graeme@labtam.oz.au

I have always wondered why my images looked different on a Macintosh and a
Sun.  Does anyone have any idea how to change the display gamma?  Does it
just involve converting the colormap of a gif that displays correctly on a
Mac using some scale factor, to get the image to display properly on a Sun?
What are typical compensation factors involved with a conversion?  Does it
matter what type of monitor you have, or is it the monitor driver card that
determines the gamma compensation level.

Thanks Ellsworth
----
Ellsworth Warmouth  AT&T Paradyne Corp. Largo FL  813-530-2882
UUCP 	efwjr@pdn.paradyne.com	Amateur Call	KB4SH 
Opinions expressed are mine alone and not necessarily those of AT&T Paradyne.

spencer@eecs.umich.edu (Spencer W. Thomas) (07/24/90)

Briefly -- to adjust the gamma of an image, you want to do this
(without loss of generality, assume pix is in range 0-255):
	new_pix = (int)(0.5 + 255 * pow( (pix / 255.0), 1/disp_gam );

The assumptions in the above equation are:
*	The original image is uncompensated (i.e., has a gamma of 1).
*	disp_gam is the gamma of your display (typically 2 - 3, the
	NTSC standard is 2.2, according to Roy Hall's book).

For more information, see (among other sources, I am sure)
	Roy Hall, _Illumination and Color in Computer Generated
		Imagery_, Springer-Verlag, 1989, pp120-125.

--
=Spencer W. Thomas 		EECS Dept, U of Michigan, Ann Arbor, MI 48109
spencer@eecs.umich.edu		313-936-2616 (8-6 E[SD]T M-F)

fsfacca@ZoSo.lerc.nasa.gov (Tony Facca) (07/24/90)

In article <1990Jul23.154140.20291@pdn.paradyne.com> efwjr@bam-bam.paradyne.com (Ellsworth Warmouth x2882) writes:
>
>I have always wondered why my images looked different on a Macintosh and a
>Sun.  Does anyone have any idea how to change the display gamma?  Does it
>just involve converting the colormap of a gif that displays correctly on a
>Mac using some scale factor, to get the image to display properly on a Sun?
>What are typical compensation factors involved with a conversion?  Does it
>matter what type of monitor you have, or is it the monitor driver card that
>determines the gamma compensation level.
>

There is a non-linear relationship between the voltage to the display and the
brightness of the display surface.  This has something to do with the acceler-
ation voltage of the display's electron beam which I can't pretend to fully
understand.  The net result is that one must compensate for the non-linearity
by raising the input voltage to some power to generate the brightness value.

This value is call the "gamma" of a monitor and is said to be between 1.4 and 
3.0 depending on the type of monitor.  I am not sure what the original poster
had in mind when he suggested adding a "gamma" value to the GIF description.
For example if I told you that some image I am sending you was displayed on
a monitor with a gamma of 2.4, you could use this value to "gamma correct" the
display of your image, assuming you knew the gamma of your particular monitor.
I believe Foley and Van Dam discuss gamma correction in the "old" book.

I have never done much with gamma correction, other than use the handy "gamma"
command courtesy of Paul Haeberli on the Iris's.  I think this command gamma
corrects the entire screen, it would be an interesting modification to allow
gamma correction on individual windows.  How would this work?  Hmmm...


--
-----------------------------------------------------------------------------
Tony Facca                     |     phone: 216-433-8318
NASA Lewis Research Center     |    
Cleveland, Ohio  44135         |     email: fsfacca@avelon.lerc.nasa.gov 
-----------------------------------------------------------------------------

graeme@labtam.oz (Graeme Gill) (07/25/90)

In article <1990Jul24.124203.10040@eagle.lerc.nasa.gov>, fsfacca@ZoSo.lerc.nasa.gov (Tony Facca) writes:
> 
> This value is call the "gamma" of a monitor and is said to be between 1.4 and 
> 3.0 depending on the type of monitor.  I am not sure what the original poster
> had in mind when he suggested adding a "gamma" value to the GIF description.
> 

	What I was pointing out was that there is a similar problem with image
brightness as there is with pixel aspect ratio. ie - in trying to display
a GIF images from some other system, you run it through your favorite
GIF display program and look at the image - and find that, Hmmm - the aspect
doesn't  look right, and uh - it looks very dark (or bright).
	The solution is for these characteristics (pixel aspect ratio and
intended display gamma) to be documented in the image, so that the display
program can correct for the assumptions without trial and error fiddling
at display time  - and you can then be sure of viewing the image the way
its creator intended.

			Graeme Gill

			graeme@labtam.oz.au