Gamma is a topic that pervades almost all forms of image portrayal, including film, television and computers. Gamma has become a tradition, which means that its origins are not understood, and it is not questioned. Perhaps it is time that it was.
One thing that needs to be made clear from the outset is that the use of gamma is a classic case of swings and roundabouts. Certainly, it offers some advantages and it solves some problems, but it does so by introducing other problems that have to be accepted as part of the compromise. If we look back to the development of black and white television, just prior to WW II, it is possible to see compelling technical reasons why the compromise should have been accepted back then.
As will be seen, the black-and-white cathode ray tube and gamma went together like peaches and cream for final delivery to the viewer. It's just that when other applications, like color TV, computer rendering, production processes like chroma key and compression techniques such as MPEG came along, the cream curdled.
Gamma was adopted, rightly at the time, but the people who decided to adopt it are no longer with us, and their reasoning seems to have died with them, so that gamma seems to be something that we continue to do today because we have always done it. Compromises should be re-examined periodically to see if the balance between the swings and the roundabouts still holds or if instead we have created a sacred cow.
Perhaps new conditions justify the continuation of the compromise; perhaps they render it obsolete, as eventually happened with interlace. The original reasons to adopt interlace were valid, but when HDTV was being considered, enough was known about the drawbacks of interlace for it to be ruled out on technical grounds. As is well known, technical grounds are never enough to compete with inertia, politics and vested interests.
In the eight or so decades since practical television emerged, technology has advanced more than somewhat. Both film and the cathode ray tube essentially vanished from the mainstream meaning that gamma is no longer inherent in the physics of image sensors or displays. Information technology has become dominant and complex digital manipulations have become inexpensive, offering alternative solutions to the use of gamma.
Perhaps when color television was being considered, the appropriateness of gamma to the calculations needed to create color difference signals should have been questioned. Digital techniques allow practically any desired dynamic range to be conveyed, and when they were adopted for television production, the use of gamma correction in video signals should have been questioned, but it seems that it wasn't.
Perhaps when efficient compression algorithms such as JPEG and MPEG were under development the effect of concatenating these codecs with gamma, which is another compression codec, should have been questioned, but again it seems that it wasn't. The problems of gamma in color television were known to be worst on saturated colors, so when proposals were made further to increase the color gamut perhaps the continued use of gamma should have been questioned then.
Finally, we had the development of high dynamic range television and a fight broke out between various different kinds of gamma. Frankly it is irrelevant which of these is preferable if there is another solution that is better still, but that question has not been asked and that solution has not been sought. One of the goals of this series is to do just that.
Fig.1 - The subjects that need to be considered to understand gamma form a long list. See text for details.
In order to be scientific, it is important to retain a modicum of doubt regarding our understanding. In the absence of such doubt, there will be no need for debate and no need for experiment to back up or destroy our theories, so there can be no progress. All that is necessary for mediocrity to prevail is for good men to ask no questions.
There has to be an impartial assessment of what gamma actually is and what it does well along with what it doesn't do well, so that there is some basis for comparison with other solutions. The extent of the pervasion of gamma is such that it is difficult to know where to start, except by looking at the areas where gamma plays a part. Fig.1 shows what they are.
Given that imaging technologies are usually directed at a human viewer, the use of gamma cannot be understood without considering the relevant aspects of the Human Visual System (HVS).
The first imaging technology was, of course, photography and it was in connection with film that non-linearities were studied, and it was from photography that the term gamma itself originated before there was television.
The cathode ray tube was at one time practically the only television display device and its peculiar characteristics have to be explored to see how it influenced the direction analog television would take. Film, the CRT and the black and white TV are obsolete today, but they form part of the history of gamma. It is almost superfluous to say that had history been different we might not be where we are today.
To a mathematician, gamma refers only to a power function, whereas in video gamma is a broad-brush term for any old non-linear functions, be that a power function, a logarithmic function or some combination of both. No treatment of gamma can be complete without looking at the mathematics of non-linearity and the consequences it predicts.
As it capitalizes on the characteristics of the HVS to reduce the dynamic range of the transmitted signal, gamma has to be classified as a perceptual compression system, which also has interesting consequences.
Gamma also has some of the attributes of a modulation scheme and actually broadens the spectrum of any signal subjected to it. It's a bit like FM radio, in that by broadening the spectrum the effects of noise in the channel can be reduced on demodulation. The effect of gamma on the spectrum has been blissfully neglected for many decades now and that neglect will be put right in due course.
When we calculate area by taking the square of the length, we are raising the length to the power of two, and, unsurprisingly the units are square feet. When we extract a square root of some number, we are raising it to the power of one half.
If we square any number and then take the square root, we get right back again. What we have done is to use two complementary processes, in which the gamma of the first one, 2, is the reciprocal of the gamma in the second one, namely one half. So for any power of gamma applied to a number, such as a sample of a video waveform, there is a reciprocal value that undoes it again.
Actually, that is not absolutely true, and as will be seen, there are cases in television where the non-linearity is not properly reversed.
No one would confuse a foot with a square foot, yet for years we clung to the misguided view that gamma corrected luminance was somehow still luminance when actually it wasn't. Charles Poynton rightly argued that the signal used in television should be known as luma in order to distinguish it from true luminance and that terminology should be followed, but frequently isn't.
Television also adopted the symbol Y from the CIE documents to represent what should now be called luma. This is also incorrect and luma should use the symbol Y' to signify that it is something that was once Y but no longer is. Again the prime is frequently omitted.
But the problem is not that we used the wrong name for non-linear signals, as the signals don't know what we call them. The real problem is that we treated such signals as if they were linear.
Fig.2a) shows a graph of a power function in which gamma is 2.2. It will be seen that the slope of the graph increases with the input, so that the output rises disproportionately. Integer values of gamma such as two or three are easy to deal with as they correspond to squaring or cubing, but how do we compute a gamma of 2.2? One solution is to use logarithms. In Fig.2a) the inverse function is also shown, which requires gamma to be 0.45, approximately the reciprocal of 2.2.
Fig.2 - A power function in which gamma has a value of 2.2 is shown at a) to have a steadily increasing slope. The reciprocal of 2.2 is about 0.45, and a curve with gamma of 0.45 is also shown. These two transfer functions in series cancel one another out to give y = x. An exponent function is shown in b). This too is non-linear and can be reversed by a logarithmic function as shown.
A power function is of the form Xγ, which means X raised to the power of gamma. X is the variable, such as a luminance sample, that is raised to a fixed power. This should not be confused with the exponent function such as 10X, in which 10 (decimal) is a constant that is raised to the power of X. Fig.2b) shows an exponential function base 2. Note that the function always passes through one on the y axis because any number raised to the power zero is one. This function can also be reversed using a logarithmic function to the same base. The logarithmic function base 2 is also shown in Fig.2b). This function passes through one on the x axis.
No mathematician would confuse a power function with a logarithmic function, but now we see non-linear transfer functions used in video that really are logarithmic, but still described as gamma. Gamma is in danger of progressing from having meaning to very few to having no meaning at all.
You might also like...
There are a number of reasons why people like old lenses, and they’re all very valid. Cameras and lenses so good they’re invisible are a recent development. Most of the best films ever made, by default, predate today’s spo…
Planning the cinematography of a production which is quite literally about darkness is a challenge. Shooting a documentary with a skeleton crew in a place where power cuts are every day is an even bigger challenge. Director of photography Miguel…
The image of a director crouching to line up a shot with an optical viewfinder is one that’s been pushed aside somewhat by the less romantic modern image of a director squinting at an LCD monitor. The monitors have a…
In mid-May of this year, as countries such as Germany, England, and Spain considered easing COVID-19 restrictions to allow professional sports to resume, various professional sports leagues began discussions with broadcasters and production companies on the best way to televise…
Here we look at some of the origins of gamma in imaging and move on to introduce the peculiar characteristics of the cathode ray tube.