Mobile app version of vmapp.org
Login or Join
Vandalay110

: Why do I have to use a gamma of 2.2 when using a JPEG picture? During the rendering process, the texture file has a gamma of 2.2. But the plain colors do not need this gamma correction,

@Vandalay110

Posted in: #Color #Gamut

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?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Vandalay110

2 Comments

Sorted by latest first Latest Oldest Best

 

@Vandalay110

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.

10% popularity Vote Up Vote Down


 

@Ogunnowo857

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme