Results 1 to 15 of 15

Thread: Clarification: Understanding Gamma Correction

  1. #1

    Clarification: Understanding Gamma Correction

    Great tutorial for understanding gamma correction, but there's 1 thing that I'm finding hard to get my head around: a gamma encoded 8 bit image has the same tonal continuity as an 11 bit linearly encoded image. This is because our eyes do not perceive the extra data in the highlights, but requires more information in the shadows.

    Our eyes capture light logarithmically, but camera sensors captures light and the camera ADC quantizes the light linearly. So before you apply gamma correction, the data for shadows, highlights and mid-tones have already been captured linearly by the camera. Therefore, applying digital gamma correction is not going to introduce more information in the shadows because the total amount of information has already been captured, it's just going to reshuffle the information to make the image look more realistic and pleasing, i.e. we're mimicking logarithmic capture. So the 12 bit digitally corrected gamma image is still only has the same tonal continuity as the original 12 bit linearly encoded image not a 15 bit linearly encoded image.

    So that statement is only correct if the 8 bit gamma encoded image came from the eye or a linear encoding camera that had 11 or more bits. So digital gamma correction helps when you want to lower the bit depth but still want to retain as much data as possible.

    Is there a camera with some sort of analog gamma correction so that when the ADC outputs bits, the gamma correction has already been applied and thus we're actually increasing the bit depth beyond what is capable of the camera?

  2. #2
    HaseebM's Avatar
    Join Date
    Jun 2013
    Location
    Chennai India
    Posts
    627
    Real Name
    Haseeb Modi

    Re: Clarification: Understanding Gamma Correction

    I don't know about that but I sure do not like to use Gamma anywhere on my images but for some reason, find it very useful for Planets and the Moon. For eg.,

    Saturn
    Clarification: Understanding Gamma Correction

    Crater Plato
    Clarification: Understanding Gamma Correction
    Last edited by HaseebM; 17th November 2014 at 03:00 PM.

  3. #3

    Join Date
    Aug 2010
    Location
    Stockholm, Sweden (and sometimes Santiago de Cuba)
    Posts
    1,088
    Real Name
    Urban Domeij

    Re: Clarification: Understanding Gamma Correction

    There is no presentation medium that can show an 11 bit or more linearly encoded image. Some monitors may present about seven bits and printed images many fewer. And even if the monitor would show 11 bits, if the image has much highlight area and little shadow area, the contrast would not permit much detail to actually be seen in the shadows, just as in real life, when you look at the scene with your eyes.

    There is a workaround to this problem, called increasing local contrast or "tone mapping", where local contrast may be enhanced in shadow as well as highlight areas of an image, and when this process is done in a reasonable way, pleasing image results may be obtained. The process is part of HDR imaging (High Dynamic Range).

    It is a perceptual manipulation of the image, please do not believe that the number of digital bits has much to do with your perception. It is largely irrelevant to the end product, although it may be relevant to the dynamic range captured by the camera. The best sensors of today can capture a dynamic range of about 14 f-stops, but this may not be reflected in the number of bits registering the image.

    So the "simple" way of coping with high dynamic range of a scene is to retain global contrast in the image, while at the same time enhancing local contrast, i.e. tone mapping. The process is not standardised, and there are many programs available to do it digitally, all of them different in the ways they work, and many parameters can be altered in the process. There are also manual ways of enhancing local contrast, including layers in pp software and mimicking "dodge and burn" techniques.

    So gamma correction is not the way to enhance shadow or highlight detail, just a way to get the image into the more narrow gap of the presentation, while underway losing rendition of shadow detail as well as highlight detail. There are however other ways to cope with high dynamic range, and they can be applied also to a single image captured with a device that can capture a larger range than can be faithfully reproduced.

  4. #4

    Join Date
    Feb 2012
    Location
    Texas
    Posts
    6,956
    Real Name
    Ted

    Re: Clarification: Understanding Gamma Correction

    Quote Originally Posted by Daniel Hon View Post
    < . . . >
    Is there a camera with some sort of analog gamma correction so that when the ADC outputs bits, the gamma correction has already been applied and thus we're actually increasing the bit depth beyond what is capable of the camera?
    Welcome, here's my two cents . . .

    Without getting into noise and dynamic range, I believe that the intent of your post is served by existing cameras. The reason being that raw files are indeed linear and that, for example, 14-bit ADC's would serve in that the tonal resolution at low exposure levels is good enough for our purposes. Of course, 16-bit would be even better, ho ho, assuming that such a camera exists.

    Meanwhile, the humble 12-bit ADCs on my Sigma cameras show up their abundance of low-level noise extremely well without no real need for extra resolution.

    Oops, noise has been mentioned - let the obfuscation begin . .
    Last edited by xpatUSA; 17th November 2014 at 04:15 PM.

  5. #5
    ajohnw's Avatar
    Join Date
    Aug 2012
    Location
    S, B'ham UK
    Posts
    3,337
    Real Name
    John

    Re: Clarification: Understanding Gamma Correction

    Quote Originally Posted by Daniel Hon View Post
    Great tutorial for understanding gamma correction, but there's 1 thing that I'm finding hard to get my head around: a gamma encoded 8 bit image has the same tonal continuity as an 11 bit linearly encoded image. This is because our eyes do not perceive the extra data in the highlights, but requires more information in the shadows.

    Our eyes capture light logarithmically, but camera sensors captures light and the camera ADC quantizes the light linearly. So before you apply gamma correction, the data for shadows, highlights and mid-tones have already been captured linearly by the camera. Therefore, applying digital gamma correction is not going to introduce more information in the shadows because the total amount of information has already been captured, it's just going to reshuffle the information to make the image look more realistic and pleasing, i.e. we're mimicking logarithmic capture. So the 12 bit digitally corrected gamma image is still only has the same tonal continuity as the original 12 bit linearly encoded image not a 15 bit linearly encoded image.

    So that statement is only correct if the 8 bit gamma encoded image came from the eye or a linear encoding camera that had 11 or more bits. So digital gamma correction helps when you want to lower the bit depth but still want to retain as much data as possible.

    Is there a camera with some sort of analog gamma correction so that when the ADC outputs bits, the gamma correction has already been applied and thus we're actually increasing the bit depth beyond what is capable of the camera?
    Compacts generally use 10 bit A/D's which might part answer your question.

    Your looking at the reason the wrong way round. The camera captures light levels in a linear fashion where as we see in stops and fractions of said stope ( after a fashion in case some one wants to be pedantic ). So say 10bit A/D and the last stop was 512 to 1023 we are incapable of seeing gradations that fine so they can be compressed allowing the darker end to take up more bit's - can't explain better than that bit this should give you the idea.

    A drawing at the top of this page and it's content should help further

    https://en.wikipedia.org/wiki/Gamma_correction

    John
    -

  6. #6

    Join Date
    May 2014
    Location
    amsterdam, netherlands
    Posts
    3,182
    Real Name
    George

    Re: Clarification: Understanding Gamma Correction

    I don't see what the tonal depth has to do with gamma.
    George

  7. #7

    Join Date
    Feb 2012
    Location
    Texas
    Posts
    6,956
    Real Name
    Ted

    Re: Clarification: Understanding Gamma Correction

    Quote Originally Posted by george013 View Post
    I don't see what the tonal depth has to do with gamma.
    Couldn't find "tonal depth" in this thread.

  8. #8

    Join Date
    May 2014
    Location
    amsterdam, netherlands
    Posts
    3,182
    Real Name
    George

    Re: Clarification: Understanding Gamma Correction

    Quote Originally Posted by xpatUSA View Post
    Couldn't find "tonal depth" in this thread.
    Sometime it's called bitdepth.

    George

  9. #9
    ajohnw's Avatar
    Join Date
    Aug 2012
    Location
    S, B'ham UK
    Posts
    3,337
    Real Name
    John

    Re: Clarification: Understanding Gamma Correction

    The other aspect to the topic has also cropped up - displays showing 7 stops. It's not correct just as some cameras having 14.

    What gamma correction does is provide something visually akin to more than 7 stops. How many is debatable but it all comes down to how sensitive our eyes are to steps in light levels and that at the brighter end linear systems have far too many gradations than we can effectively make use of. This even applies to the 7 bit based argument that crops up in relationship to displays. Gospel to some but not in real terms correct but then neither are the stops in either case really.

    Sorry about all of the typo's in the other. I never should have spent 2-3 years using a cherry compact keyboard and refuse to look while typing.

    John
    _

  10. #10
    dje's Avatar
    Join Date
    May 2011
    Location
    Brisbane Australia
    Posts
    4,636
    Real Name
    Dave Ellis

    Re: Clarification: Understanding Gamma Correction

    Quote Originally Posted by Daniel Hon View Post
    Great tutorial for understanding gamma correction, but there's 1 thing that I'm finding hard to get my head around: a gamma encoded 8 bit image has the same tonal continuity as an 11 bit linearly encoded image. This is because our eyes do not perceive the extra data in the highlights, but requires more information in the shadows.

    Our eyes capture light logarithmically, but camera sensors captures light and the camera ADC quantizes the light linearly. So before you apply gamma correction, the data for shadows, highlights and mid-tones have already been captured linearly by the camera. Therefore, applying digital gamma correction is not going to introduce more information in the shadows because the total amount of information has already been captured, it's just going to reshuffle the information to make the image look more realistic and pleasing, i.e. we're mimicking logarithmic capture. So the 12 bit digitally corrected gamma image is still only has the same tonal continuity as the original 12 bit linearly encoded image not a 15 bit linearly encoded image.

    So that statement is only correct if the 8 bit gamma encoded image came from the eye or a linear encoding camera that had 11 or more bits. So digital gamma correction helps when you want to lower the bit depth but still want to retain as much data as possible.

    Is there a camera with some sort of analog gamma correction so that when the ADC outputs bits, the gamma correction has already been applied and thus we're actually increasing the bit depth beyond what is capable of the camera?
    Hi Daniel and welcome.

    I think you make a good point here. I've also struggled with this concept of distribution of levels of luminance samples. If a gamma curve were applied in the analogue part of the circuit, ie before the A/D converter, then I can see that there would be more samples taken by the A/D converter at the lower luminance levels but, to my knowledge, camera sensors don't work this way and produce a linear digital output with equi-spaced luminance values. I can't see how applying a gamma curve digitally to this linear digital signal and then applying an opposite curve in the display system can change the distribution of luminance level samples.

    As I understand it, the gamma concept was introduced with analogue television broadcasting for two purposes

    • Correct the non-linear response of cathode ray tubes in television receivers
    • Improve the S/N performance of the broadcast


    When digital image files came into being, computer monitors still used cathode ray tubes and for this reason, gamma was used here too. With the advent of LCD monitors, gamma correction wasn't really necessary for display purposes but had to be maintained to ensure compatability with crt devices.

    Dave
    Last edited by dje; 19th November 2014 at 08:44 AM.

  11. #11

    Join Date
    May 2014
    Location
    amsterdam, netherlands
    Posts
    3,182
    Real Name
    George

    Re: Clarification: Understanding Gamma Correction

    Quote Originally Posted by ajohnw View Post
    The other aspect to the topic has also cropped up - displays showing 7 stops. It's not correct just as some cameras having 14.

    What gamma correction does is provide something visually akin to more than 7 stops. How many is debatable but it all comes down to how sensitive our eyes are to steps in light levels and that at the brighter end linear systems have far too many gradations than we can effectively make use of. This even applies to the 7 bit based argument that crops up in relationship to displays. Gospel to some but not in real terms correct but then neither are the stops in either case really.

    Sorry about all of the typo's in the other. I never should have spent 2-3 years using a cherry compact keyboard and refuse to look while typing.

    John
    _
    John,
    Forget the stops and bitdepth. Take a look at the link you gave yourself. Or at the tutorial here.
    George

  12. #12
    ajohnw's Avatar
    Join Date
    Aug 2012
    Location
    S, B'ham UK
    Posts
    3,337
    Real Name
    John

    Re: Clarification: Understanding Gamma Correction

    Quote Originally Posted by george013 View Post
    John,
    Forget the stops and bitdepth. Take a look at the link you gave yourself. Or at the tutorial here.
    George
    I don't need to George.

    I have a pretty clear idea where it came from a why.

    John
    -
    Last edited by ajohnw; 17th November 2014 at 11:14 PM.

  13. #13

    Re: Clarification: Understanding Gamma Correction

    Gamma correction and aperture correction were introduced in the early days of Plan Position Indicator radar crt displays to reduce saturation and clean up sloppy pulses. Gamma correction and aperture correction were naturally used in television for those reasons and to linearize the luminance transfer function to suit the eye response to the crt. Taking the square root was close enough and could be done with a diode.

  14. #14

    Join Date
    May 2014
    Location
    amsterdam, netherlands
    Posts
    3,182
    Real Name
    George

    Re: Clarification: Understanding Gamma Correction

    Quote Originally Posted by Richard Lundberg View Post
    Gamma correction and aperture correction were introduced in the early days of Plan Position Indicator radar crt displays to reduce saturation and clean up sloppy pulses. Gamma correction and aperture correction were naturally used in television for those reasons and to linearize the luminance transfer function to suit the eye response to the crt. Taking the square root was close enough and could be done with a diode.
    Is it true that there are 2 gamma corrections. One for the showing device, the monitor, and one for the capturing device, the sensor? And that they are independent of each other.
    I don't know what aperture correction means.

    George

  15. #15
    ajohnw's Avatar
    Join Date
    Aug 2012
    Location
    S, B'ham UK
    Posts
    3,337
    Real Name
    John

    Re: Clarification: Understanding Gamma Correction

    There may have been gamma correction on video tubes George also called vidicon tubes used for instance in TV cameras. These are where the sizes of sensors come from so the diagonal is roughly 2/3 of the size stated as the active area on these is roughly 2/3 of the diameter. At this end of things it's more related to correcting the response of the set up to light and improving the image visually.

    Digital sensors are more or less linear. Ideally exactly linear. A big problem really because we see light levels in a logarithmic fashion. This is why we can look round a scene and see no shadows where as the camera will show plenty even "enhancing" them.

    One way of looking at the effects of gamma in a loose fashion is the levels adjustment many PP packages have and moving the centre slider about - mid range contrast levels are being changed. Another way where it is available is to directly adjust a gamma curve. What is happening then is that the rate of change of tone levels - contrast - is being adjusted at and around the point much the same as it is when curves are used on an image.

    One point on the wiki - IT ISN'T ALWAYS CORRECT - it can actually spread misunderstandings. Another link

    http://www.scantips.com/lights/gamma2.html

    Which is correct - neither really after a fashion as it does help make the image look better which is why it was introduced so perhaps the wiki is more correct. This link explains the mechanism more clearly but doesn't mention why the dark end needs to be boosted. It's boosted for the reasons I mentioned - our eyes - earlier. The fact that it initially related to CRT tubes is irrelevant really. The data is manipulated to make the same thing happen what ever the display device is.

    John
    -

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •