5

During the rendering process, the texture file has a gamma of 2.2. But the plain colors do not need this gamma correction, especially if the RGB values are from a spectral characterization.

So why do I have to use a gamma of 2.2 in my texture files? Why do we use a gamma of 2.2 in the CG world? Why don't we use a gamma of 1 for images with real colors?

2
  • 1
    What app are you referring to?
    – Scott
    Commented Feb 3, 2015 at 17:27
  • This is very convolved subject, i can count the times when i have successfully explained this info to a person who is not an engineer.
    – joojaa
    Commented Feb 3, 2015 at 19:07

2 Answers 2

6

TL;DR; Because your monitor does not display color linearily

Its a cultural problem

It would be wasteful to use a gamma of 1. The human eye is not linearly sensitive so the data is biased so that there is more data where your eye is more sensitive. More bang for the buck as to speak. So monitors and output devices have been setup with the assumption that colors are not linear in nature. Gamma 2.2 is what sRGB uses, as well as what Windows assumes. (apple often uses a different gamma setting).

However, if you want to calculate on top of the image you may want to use a linear space as it makes it easier to sum values together. Now if you assume the image is linear then your result is wrong when displayed on a monitor that assumes a gamma other than 1. So you need to compensate the image again. This means that systems that are more concerned of their computation engines might assume preprocessing to make the load smaller.

There is no reason why this could not be handled automatically

It just isnt commonly done in 3D graphics apps*. If you render 3D graphics your more concerned with the computation. Where the question whether the image actually was gamma corrected or not is often hard to know. There's no real way to read this info from the pictures metadata as they would erroneously report that the image is corrected even when a method was used that assumed linear application. This often happens with synthetic images like bump maps or other processed images. Because you need to go from corrected too linear and back you would end up with 2 times the error if you handled this wrong. Worse most asset creators would have no idea what I'm talking about even after repeated attempts to explain this. So better to handle manually.

2.2 isn't the end run of this gamma discussion but its the most common setting. You could also use profile translation to more accurate than gamma corrections. But it depends on how your system is set up.

Mathematical explanation

This is a simpler explanation. Your monitor has a display error of g(x) which is no problem if your data is conforming to g(x), however if you want to calculate

a+b+c+d

and a, b, c, d, conform to the error of g(x) you would actually need to calculate.

g(g-1(a)+g-1(b)+g-1(c)+g-1(d))

You would need to do this for each sub element over and over again. Therefore instead of running the transform each time you transform all once to linear and then once back. Problem: not all sources need to be covered some are inherently linear.

* this is slowly changing. But the problem remains that you dont know if the image needs to be compensated or not. Not all sources are created equal.

1
  • And if We want to use a bump map or a displacement map. I understand that the correct value to use must be 1. A pure grey level image do not need correction. Correct?
    – user38031
    Commented Feb 6, 2015 at 11:24
1

This is merely my understanding of the concept, so if you're an expert in the field, feel free to correct/amend the answer if needed.

A gamma of 1 is linear, in that every doubling of pixel values equals a doubling in brightness. This is how digital devices handle light. Humans, however, are much less sensitive to these brightness changes, especially in the lighter parts of a scene. From this excellent gamma tutorial from Cambridge In Color, "...gamma is what translates between our eye's light sensitivity and that of the [digital device]."

So a gamma of 2.2 is a much closer representation of our perception of light than a gamma of 1. And consistent use of a 2.2 gamma gives all elements an 'apples to apples' relationship.

3
  • Digital devices dont handle light. Gamma of one is used so that the computation is easier to understand. There's nothing that states they couldn't handle the gamma correction. Its just that its hard to know whether the input is gamma corrected or not. Users dont really tag the images based on how they derived them.
    – joojaa
    Commented Feb 3, 2015 at 18:55
  • A digital camera converts light into bits of data. Monitors convert bits of data into light. How can it be true that that digital devices don't handle light? Confused...
    – digijim
    Commented Feb 3, 2015 at 19:22
  • 1
    The computer does not know of light. It just knows of numbers. Hence he entire gamma problem. The computer does not know that the numbers do not represent a linear measurement. It has to be told so. And there's no problem if you only operate with a image editor and camera. Its the synthetic images that get affected.
    – joojaa
    Commented Feb 3, 2015 at 19:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.