Gamma correction question

  • Thread starter Thread starter Jack Frillman
  • Start date Start date
Wayne Fulton said:
I cant say much about Weber's Law,

But yet you have referred to it, many times, as the fact.
Weber's law is well accepted, it is what is taught, but it
covers much more than vision.

No, it covers (loosely) one particular viewing situation and that
viewing situation is not the one that the vision is in when we view
scenery or images on the CRT or on a print. Not even close.
It is about detecting "just noticeable differences", against a background
(the 1% delta is detectable).

That is correct, against the adapting background.

But when you view an image you can not adapt to the luminance level
that e.g. the level 26 outputs, you are adapted to the max luminance
that there is in the image.
For example, the stars are as bright in the day as at night, but the
background differs.

Right on the money, so now we just need to understand what that means.

1) During the night we can see the stars because we are adapted to a
very low lightness level.

2) During the day we do not see the stars, they would need to be much
more bright in order us to see them. Why, because the vision is
adapted to a much higher lightness level during the day than that
during the night.

Now, how does this relate to seeing scenery, or images on the CRT or
on a print? In case your images are like the case 1 above, black
frames with some tiny white spots in them, then you have a valid point
in using Weber's law to code your images.

In case your images are more like normal images (with full histogram)
then the above case 2 is in effect, the darker the image detail is the
larger luminance difference is needed there in order us to perceive
that detail. Adaptation of the vision is fixed. Weber's law does not
apply at all.
The way to test this with vision is to put one area of intensity inside
a larger intensity area, to see if the center value is distinguishable
against that background.

That is a way to test Weber's law and the overall adaptation
performance of the vision.

In order to test for the optimal codespace for digital imaging you
need to show two very small test patches side by side with a typical
photo as the background. Our images are not black frames with tiny
white spots in them.

Timo Autiokari http://www.aim-dtp.net/
 
SNIP
But when you view an image you can not adapt to the
luminance level that e.g. the level 26 outputs, you are
adapted to the max luminance that there is in the image.

Unfortunately that is too general a statement. The eye adapts to the
luminance within roughly 1 degree of vision. Overall luminance plays a
role but more as a broad limitation at the extreme ends when we scan
the image with our eyes.
Whithin the angle of adaptation, Weber's law (approx. 1% threshold)
roughly applies.

Bart
 
In a system of numbers that would be correct,but we are talking about
levels and the luminance difference between them.

Surely in a linear image the the luminance difference between levels
are the same,256 levels correspond to .4% per level(well within the 1%
margin), but we would see them in a perceptual space.
I
n a perceptual space which is what he I suppose was talking about, those
levels are raised to a power of.33.


I didnt follow everything Mike, but we dont ever look at those encoded values.
I think there is no concept of perceiving encoded values, when would that be
useful? We do encode the data, but the CRT does always decode it, which is
why we must do it, so we do always see decoded linear data. Ideally, if the
data pixel was originally intensity value 26, then the encoded/decoded 26
comes back out as the relative linear value 26 again. This is of course often
not exactly true of most values, but since what we can perceive is in
exponential steps of 1% anyway, the hope is that it comes back out as nearly
the same perceptually, close enough is good enough. This hope comes from the
similarity of the 1/2.2 and 1/3 power curve exponents for CRT and the
perceptual eye. Gamma is not done for that hope, gamma is done for the CRT,
but this hope is a major secondary advantage.

The data values like 25 or 26 are linear intensity values. Everything we can
see and touch is a linear intensity value. There is no concept of absolute
intensity in the RGB system, but still it is relative intensity, and it is
linear (meaning, not gamma encoded). Poynton says that Weber's eye can
differentiate 1% non-linear steps, but 25 to 26 is a linear 4% step to which
Poynton refers.

What we look at is linear intensity. What we perceive is not. We can measure
intensity externally with various instruments, but the only way we can measure
what the brain perceives is with methods like Webers background test. I cant
say about the precise numerical accuracy of 1%, I do think the 1% varies a
little, and to me, 2% seems better at the dark end. Even more sometimes,
which certainly to some extent could also be my imperfect monitor/settings. I
suspect Poynton simply picked one midpoint value for convenience. That's not
at all a critical issue for me. It is the concept that is beautiful, instead
of the precise numbers.

256 steps are more steps than Poyntons 100 steps, so 256 steps superficially
would seem adequate to hold that data. However the 8 bit RGB we see is 256
linear steps, whereas Poyntons perceptual values are the 1% steps, which are
logarithmic/exponential so to speak. Not at all the same concept.

We do see others making the serious mistake saying 256 is greater than 100,
but which is very conceptually wrong in this case. Timo's page he linked says
256 is almost 3 times greater than Poyntons 100 (immediately below his Q60
target image - he says 276, but JPG can only hold 256). But of course,
Poynton instead says these 100 1% perceptual steps require 9900 linear values
and 14 bits to contain them. Poynton says gamma encoding for the CRT reduces
these 9900 values and 14 bits of data into 463 values and 9 bits. He says
that 8 bits has adequate contrast/quality for broadcast standards, and
certainly 8 bits and 256 values is convenient for us.

One might think this non-linear gamma encoding method would be a reprehensible
way to treat linear data. This is lossy compression. We cannot reverse it and
recover the original data exactly. Many values are shifted slightly.

The issue is if the decoded linear values are shifted enough to be perceived
as shifted, meaning are the differences much more than 1% after decoding? The
human eye perception establishes an acceptable 1% error range, where errors
are not detectable. Gamma does create errors in this range, but the match is
pretty good. I think this is a major point, and is perhaps the concept you
are overlooking.

However, there are other major overriding factors:

1. The CRT requires gamma of 1/2.2 anyway. It is not a choice. We simply
must do it, regardless. It is a given, there are no options. We have always
done it for all images. We can imagine future options with 16 bit linear
displays, but that is still in the undetermined future.

2. The human eye does recognize intensity via these 1% perception levels,
which roughly compares to a gamma of 1/3, so this gamma 1/2.2 encoding which
is absolutely required for the CRT anyway, works out pretty well to hide the 8
bit losses. The human perception establishes an acceptable 1% error range, and
gamma requires a certain error range, especially so for 8 bit data. No one
says this is exactly correct, it is not designed to be correct that way. It is
not even designed, and gamma is not done for the eye. It just happened to
work out. But regardless, the 1/2.2 gamma is absolutely required anyway for
the CRT, and this does in fact work out quite well, good enough, to allow use
of 8 bit data, with results roughly near this 1% perceputal tolerance.

If it were somehow otherwise true that gamma 1/2.2 for the CRT was not
sufficient compression to allow 8 bit data to be used, then of course we
simply would never have standardized on using 8 bit data. We would have used
16 bit data, or whatever it took to work. But 8 bits is sufficient with
gamma, and we must do gamma anyway, so for this reason, we can and do use 8
bits. I'm just not of the opinion that 8 bit data is the "primary purpose of
gamma" <g>
 
Wayne said:
I didnt follow everything Mike, but we dont ever look at those encoded values.
I think there is no concept of perceiving encoded values, when would that be
useful? We do encode the data, but the CRT does always decode it, which is
why we must do it, so we do always see decoded linear data. Ideally, if the
data pixel was originally intensity value 26, then the encoded/decoded 26
comes back out as the relative linear value 26 again. This is of course often
not exactly true of most values, but since what we can perceive is in
exponential steps of 1% anyway, the hope is that it comes back out as nearly
the same perceptually, close enough is good enough. This hope comes from the
similarity of the 1/2.2 and 1/3 power curve exponents for CRT and the
perceptual eye. Gamma is not done for that hope, gamma is done for the CRT,
but this hope is a major secondary advantage.

The data values like 25 or 26 are linear intensity values. Everything we can
see and touch is a linear intensity value. There is no concept of absolute
intensity in the RGB system, but still it is relative intensity, and it is
linear (meaning, not gamma encoded). Poynton says that Weber's eye can
differentiate 1% non-linear steps, but 25 to 26 is a linear 4% step to which
Poynton refers.

What we look at is linear intensity. What we perceive is not. We can measure
intensity externally with various instruments, but the only way we can measure
what the brain perceives is with methods like Webers background test. I cant
say about the precise numerical accuracy of 1%, I do think the 1% varies a
little, and to me, 2% seems better at the dark end. Even more sometimes,
which certainly to some extent could also be my imperfect monitor/settings. I
suspect Poynton simply picked one midpoint value for convenience. That's not
at all a critical issue for me. It is the concept that is beautiful, instead
of the precise numbers.

256 steps are more steps than Poyntons 100 steps, so 256 steps superficially
would seem adequate to hold that data. However the 8 bit RGB we see is 256
linear steps, whereas Poyntons perceptual values are the 1% steps, which are
logarithmic/exponential so to speak. Not at all the same concept.

We do see others making the serious mistake saying 256 is greater than 100,
but which is very conceptually wrong in this case. Timo's page he linked says
256 is almost 3 times greater than Poyntons 100 (immediately below his Q60
target image - he says 276, but JPG can only hold 256). But of course,
Poynton instead says these 100 1% perceptual steps require 9900 linear values
and 14 bits to contain them. Poynton says gamma encoding for the CRT reduces
these 9900 values and 14 bits of data into 463 values and 9 bits. He says
that 8 bits has adequate contrast/quality for broadcast standards, and
certainly 8 bits and 256 values is convenient for us.

One might think this non-linear gamma encoding method would be a reprehensible
way to treat linear data. This is lossy compression. We cannot reverse it and
recover the original data exactly. Many values are shifted slightly.

The issue is if the decoded linear values are shifted enough to be perceived
as shifted, meaning are the differences much more than 1% after decoding? The
human eye perception establishes an acceptable 1% error range, where errors
are not detectable. Gamma does create errors in this range, but the match is
pretty good. I think this is a major point, and is perhaps the concept you
are overlooking.

However, there are other major overriding factors:

1. The CRT requires gamma of 1/2.2 anyway. It is not a choice. We simply
must do it, regardless. It is a given, there are no options. We have always
done it for all images. We can imagine future options with 16 bit linear
displays, but that is still in the undetermined future.

2. The human eye does recognize intensity via these 1% perception levels,
which roughly compares to a gamma of 1/3, so this gamma 1/2.2 encoding which
is absolutely required for the CRT anyway, works out pretty well to hide the 8
bit losses. The human perception establishes an acceptable 1% error range, and
gamma requires a certain error range, especially so for 8 bit data. No one
says this is exactly correct, it is not designed to be correct that way. It is
not even designed, and gamma is not done for the eye. It just happened to
work out. But regardless, the 1/2.2 gamma is absolutely required anyway for
the CRT, and this does in fact work out quite well, good enough, to allow use
of 8 bit data, with results roughly near this 1% perceputal tolerance.

If it were somehow otherwise true that gamma 1/2.2 for the CRT was not
sufficient compression to allow 8 bit data to be used, then of course we
simply would never have standardized on using 8 bit data. We would have used
16 bit data, or whatever it took to work. But 8 bits is sufficient with
gamma, and we must do gamma anyway, so for this reason, we can and do use 8
bits. I'm just not of the opinion that 8 bit data is the "primary purpose of
gamma" <g>


Hello Wayne

"The data values like 25 or 26 are linear intensity values. Everything
we can see and touch is a linear intensity value. There is no concept
of absolute intensity in the RGB system, but still it is relative
intensity, and it is linear (meaning, not gamma encoded). Poynton says
that Weber's eye can differentiate 1% non-linear steps, but 25 to 26 is
a linear 4% step to which Poynton refers."

Sorry to labour this.

Those are linear intensity values, but we can if we assume that our
vision corresponds to a gamma of .33, simulate what that would look
like. I have done the some calculations which show that codes 25 and 26
would have a luminosity ratio of the order of 1.01%.

http://www.btinternet.com/~mike.engles/mike/gamma33.jpg

I have made a graph of this with a linear scale which has gamma.33
applied. I am I think using Mr Poynton's logic, but find that I have a
problem with it.

In the end as you say, the way we work works.



Mike Engles
 
Timo - please stop misrepresenting the sRGB spec. and color science.
We know that you're lying.
We still don't know why you're lying and trying to destroy other
people's images - but you really should stop.

Chris
 
Timo said:
Wayne,

I agree with most that you wrote, however it looks that Mr. Poynton
has had another victim.

Timo -
We know that you're lying, and you know that you're lying.
Please, just go away.

Chris
 
Hello

So for a 16 bit linear sensor and a 8 bit linear display we still need
to gamma encode; what level of gamma or inverse gamma would we need to
apply?

Mike Engles

You need a gamma encoding near 2.0 (values from 1.4 to 2.5 have been
used well, 2.2 provides a good balance) to get the best use of the
bits.

Chris
 
Sorry to labour this.

Those are linear intensity values, but we can if we assume that our
vision corresponds to a gamma of .33, simulate what that would look
like. I have done the some calculations which show that codes 25 and 26
would have a luminosity ratio of the order of 1.01%.

http://www.btinternet.com/~mike.engles/mike/gamma33.jpg

I have made a graph of this with a linear scale which has gamma.33
applied. I am I think using Mr Poynton's logic, but find that I have a
problem with it.

In the end as you say, the way we work works.


That's a nice looking chart Mike. Is that Excel? I still have Excel 95, and
it doesnt look like that. <g> Your version is probably newer.

I dont dispute your computation at all, but I just am not sure what to do with
these numbers. Your previous explanation said "Mr Poynton says(page 5 of the
gamma PDF) that the luminance ratio between codes 25 and 26, presumably when
raised to a power of .33 is 4%".

But he doesnt allow that presumption at all. In his "Rehabilitation of gamma"
paper, his page 6 chart at the left there with the caption "Linear Light
Coding: The code 100 problem" marks the interval 25 to 26 as 4%. Right above
the same chart the title also says "Linear light coding". Says linear coding
twice on the same chart that explains the 4%, and I cannot get past that <g>

Is that where you mean? If not, you will have to help me zero in on this,
because Poynton clearly says he means linear. Actually he is complaining
about linear, and arguing for gamma.

His accompanying paragraph there says "Consider linear light coding", and
points out that this 4% gap between adjacent codes can cause banding in
smooth-shaded regions (because we can distinguish divisions even finer, and
gradients need smaller steps which we cannot distinguish so well).
Conversely, at the 200-201 code area, we have excessive codes that we cannot
even see (perceive as unique). This is his code 100 problem, 100 being the
boundary where the adjacent linear steps are either larger than 1% linear, or
less than 1% linear. Since he says the eye perceives the 1% steps, then we are
not using the available codes as wisely as is possible.

He gets this 1% step from Weber. Some agree, and others say 1.7 or 2 for Weber
and vision. That is not huge, and I think the 1% floats a little as a
constant. I also think the 1/3 power law (sometimes called Stephen's Law in
the general sense like Weber is very general too) is later theory and believed
more accurate for the eye, at least over a wider range. His paper mentions
(page 4) that the CIE has adapted the 1/3 power law for the eyes response.

It would be interesting to have corresponding numbers to his 9900 value/14 bit
results more exactly computed for the 1/3 power law. But my own assumption is
that over much of the range, there must not be appreciable difference, since
both are thought right enough, so I dont have trouble switching back and forth
as it helps my understanding.
 
Chris said:
You need a gamma encoding near 2.0 (values from 1.4 to 2.5 have been
used well, 2.2 provides a good balance) to get the best use of the
bits.

Chris

Hello

Would that not make the already linear display and linear image
impossibly bright,or do we now apply a gamma to the linear display to
emulate a CRT?

Mike Engles
 
Wayne said:
That's a nice looking chart Mike. Is that Excel? I still have Excel 95, and
it doesnt look like that. <g> Your version is probably newer.

I dont dispute your computation at all, but I just am not sure what to do with
these numbers. Your previous explanation said "Mr Poynton says(page 5 of the
gamma PDF) that the luminance ratio between codes 25 and 26, presumably when
raised to a power of .33 is 4%".

But he doesnt allow that presumption at all. In his "Rehabilitation of gamma"
paper, his page 6 chart at the left there with the caption "Linear Light
Coding: The code 100 problem" marks the interval 25 to 26 as 4%. Right above
the same chart the title also says "Linear light coding". Says linear coding
twice on the same chart that explains the 4%, and I cannot get past that <g>

Is that where you mean? If not, you will have to help me zero in on this,
because Poynton clearly says he means linear. Actually he is complaining
about linear, and arguing for gamma.

His accompanying paragraph there says "Consider linear light coding", and
points out that this 4% gap between adjacent codes can cause banding in
smooth-shaded regions (because we can distinguish divisions even finer, and
gradients need smaller steps which we cannot distinguish so well).
Conversely, at the 200-201 code area, we have excessive codes that we cannot
even see (perceive as unique). This is his code 100 problem, 100 being the
boundary where the adjacent linear steps are either larger than 1% linear, or
less than 1% linear. Since he says the eye perceives the 1% steps, then we are
not using the available codes as wisely as is possible.

He gets this 1% step from Weber. Some agree, and others say 1.7 or 2 for Weber
and vision. That is not huge, and I think the 1% floats a little as a
constant. I also think the 1/3 power law (sometimes called Stephen's Law in
the general sense like Weber is very general too) is later theory and believed
more accurate for the eye, at least over a wider range. His paper mentions
(page 4) that the CIE has adapted the 1/3 power law for the eyes response.

It would be interesting to have corresponding numbers to his 9900 value/14 bit
results more exactly computed for the 1/3 power law. But my own assumption is
that over much of the range, there must not be appreciable difference, since
both are thought right enough, so I dont have trouble switching back and forth
as it helps my understanding.

Hello

What I deduce from the graph is that 8 bits in a perceptual space is
already correct, if one goes by Mr Poynton's 1.01% rule.
He is arguing that we need gamma to make 8 bits efficient, because the
codes between 25 and 26 have a 4% spacing. Well if you add the gamma
applied by perception, that takes care of the 4% spacing, because those
codes are mapped by perception to the correct spacing.

Only codes below 20 have too large a spacing. Codes 5 and 6 have a 7%
spacing. He is talking about perception and its gamma but does not apply
it in simulation. My simulation if correct shows what the eye sees by
the curve, but in my diagram we are seeing it twice, because I have also
applied it to the linear scale.

Also using Mr Poynton's analogy in a linear image with 4096 levels,
codes 25 and 26 would still have a 4% spacing. It is still a linear
intensity scale. The eye with gamma.33 will map it to the curve I
produced. In order to get the lower codes to have the 1.01% spacing a
small addition gamma would be required. That would expand the lower
levels, but in a image with a full range of tones, I doubt that the 7%
spacing would even be noticable.


The image I made I drew in a drawing programme called XaraX,from
calculations I did, imported into Photoshop and applied the linear
gradient.

I have also used Excel to confirm my calculations and drawn curves.

As far as I can see the only real use of more than 8 bits is when we
actually start messing with the bits, which is when the 8 image starts
losing codes.

This is my take on it. It might all be wrong, but as far as I can see no
one has tried to actually simulate the total effect of what the gamma of
perception would be, on linear intensity scale.


Mike Engles
 
What I deduce from the graph is that 8 bits in a perceptual space is
already correct, if one goes by Mr Poynton's 1.01% rule.
He is arguing that we need gamma to make 8 bits efficient, because the
codes between 25 and 26 have a 4% spacing. Well if you add the gamma
applied by perception, that takes care of the 4% spacing, because those
codes are mapped by perception to the correct spacing.

Only codes below 20 have too large a spacing. Codes 5 and 6 have a 7%
spacing. He is talking about perception and its gamma but does not apply
it in simulation. My simulation if correct shows what the eye sees by
the curve, but in my diagram we are seeing it twice, because I have also
applied it to the linear scale.

Also using Mr Poynton's analogy in a linear image with 4096 levels,
codes 25 and 26 would still have a 4% spacing. It is still a linear
intensity scale. The eye with gamma.33 will map it to the curve I
produced. In order to get the lower codes to have the 1.01% spacing a
small addition gamma would be required. That would expand the lower
levels, but in a image with a full range of tones, I doubt that the 7%
spacing would even be noticable.


The image I made I drew in a drawing programme called XaraX,from
calculations I did, imported into Photoshop and applied the linear
gradient.

I have also used Excel to confirm my calculations and drawn curves.

As far as I can see the only real use of more than 8 bits is when we
actually start messing with the bits, which is when the 8 image starts
losing codes.

This is my take on it. It might all be wrong, but as far as I can see no
one has tried to actually simulate the total effect of what the gamma of
perception would be, on linear intensity scale.



I better understand your point now Mike, more words help me, thanks. And I
cant disagree with it. You are saying that when the 4% delta at adjacent
values 25 to 26 is seen by the eyes 0.33 perception, the brain sees a 1% delta
internally. I cannot fault that, I think it seems true.

But I really do think Poynton is saying something different, that we need a 1%
original step for the eye to view, to then be a just noticeable step, to
prevent banding. Isnt he saying that the original source step of 1% causes
perception of the just noticeable step? This is his 100 code threshold, at
1%. But I agree, it does not seem ever stated how the encoding actually
helps perception. The implication is that it is because the gamma encoding is
a similar curve as the 0.33% curve, however the next thing that happens is
that the data is decoded by the CRT. After that, then the eye sees it.

This stuff comes and goes with me, sometimes I feel I understand, then I lose
it. I do keep wondering if we encode it, and then decode it at the CRT to get
the original linear data back for viewing, then what have we done? We have
solved the CRT problem, sure, that's the point, but what have we done with
respect to perception if decoding simply gets the original values back to be
viewed? And if we dont get the original data values back, then we have an
accuracy problem. So the eye still sees the decoded 4% step in this case. How
did encoding help it perceptually?

I have done no testing, but this seems to be the same result as if we had just
kept the original 8 bit data without encoding it (and necessarily viewed it on
a linear display somehow). I suspect I'm missing something, but I dont see
it.

However (still arguing with self), when the CRT decodes it for viewing, it
doesnt get 8 bit data back. There is a encoded analog voltage creating an
analog intensity on the CRT face, which we say is now linear again. The 4%
step is still true then, presumably the intensity is 25/255 of full intensity.
And this seems as true if we could simply show the original 8 bit data without
encoding the data, assuming the display system did not have to decode it... It
isnt clear to me how gamma prevents banding of perceived steps, 8 bits or not.

It is likely there are other intermediate analog intensity values possible
between the 25 and 26, like say representing 25.236, possible to show even if
not present this time. A 16 bit video board and 16 bit data could ultilize
more such values at the low end, at least that would be the point of 16 bits.
The original 12 bit data probably did have values between the corresponding 25
and 26 values.
 
Wayne said:
I better understand your point now Mike, more words help me, thanks. And I
cant disagree with it. You are saying that when the 4% delta at adjacent
values 25 to 26 is seen by the eyes 0.33 perception, the brain sees a 1% delta
internally. I cannot fault that, I think it seems true.

But I really do think Poynton is saying something different, that we need a 1%
original step for the eye to view, to then be a just noticeable step, to
prevent banding. Isnt he saying that the original source step of 1% causes
perception of the just noticeable step? This is his 100 code threshold, at
1%. But I agree, it does not seem ever stated how the encoding actually
helps perception. The implication is that it is because the gamma encoding is
a similar curve as the 0.33% curve, however the next thing that happens is
that the data is decoded by the CRT. After that, then the eye sees it.

This stuff comes and goes with me, sometimes I feel I understand, then I lose
it. I do keep wondering if we encode it, and then decode it at the CRT to get
the original linear data back for viewing, then what have we done? We have
solved the CRT problem, sure, that's the point, but what have we done with
respect to perception if decoding simply gets the original values back to be
viewed? And if we dont get the original data values back, then we have an
accuracy problem. So the eye still sees the decoded 4% step in this case. How
did encoding help it perceptually?

I have done no testing, but this seems to be the same result as if we had just
kept the original 8 bit data without encoding it (and necessarily viewed it on
a linear display somehow). I suspect I'm missing something, but I dont see
it.

However (still arguing with self), when the CRT decodes it for viewing, it
doesnt get 8 bit data back. There is a encoded analog voltage creating an
analog intensity on the CRT face, which we say is now linear again. The 4%
step is still true then, presumably the intensity is 25/255 of full intensity.
And this seems as true if we could simply show the original 8 bit data without
encoding the data, assuming the display system did not have to decode it... It
isnt clear to me how gamma prevents banding of perceived steps, 8 bits or not.

It is likely there are other intermediate analog intensity values possible
between the 25 and 26, like say representing 25.236, possible to show even if
not present this time. A 16 bit video board and 16 bit data could ultilize
more such values at the low end, at least that would be the point of 16 bits.
The original 12 bit data probably did have values between the corresponding 25
and 26 values.


Hello Wayne

In a linear intensity scale the difference between the tones 25 and 26
is 4%. Our perception assuming it is gamma.33 maps that to 1.01,within
the perceptual ratio. That should be true for any adjacent codes in our
perceptual space. Total effective gamma is .33 for perception and 1.0
for the intensity scale=.33

Now we apply inverse gamma to the scale because our eyes see something
else on a CRT. We could apply it directly to the CRT.

A CRT has a gamma of 2.5. To linearise the CRT we can apply a inverse
gamma of.4. We should now have a measurable linearity with 25 and 26
having a spacing of 4%. Our perception now sees this measurable
linearity as perceptualy uniform as the code ration is again 1.01.
This does not apply to codes below 25. The total effective gamma is
(2.5x.4)x.33=.33
We could improve the situation, by applying a further small gamma to
make tones 19 and 20 within the perceptual ratio.
We would need a infinite gamma to make tone 1 perceptual.
If we added a further gamma of.8, then the new effective gamma would be
..33X.8=.264

What puzzles me is Chris Cox's claim that even with a linear intensity
and a linear display we would still need a gamma of .5(inverse of 2.0 I
assume) making the total effective gamma of.5x.33=.17.
This certainly opens up levels 10 and 11, but has a dreadful effect on
all the higher tones.

Our perception and its gamma plays the biggest part in all this, but
does not figure greatly in Mr Poynton's theory.
The concept of applying a gamma to aid perception is entertained, but
the fact that perception brings its own gamma to the party seems to be
ignored.

I have a new graph, which I think is self explanatory.
http://www.btinternet.com/~mike.engles/mike/Gammas.jpg

Mike Engles
 
In a linear intensity scale the difference between the tones 25 and 26
is 4%. Our perception assuming it is gamma.33 maps that to 1.01,within
the perceptual ratio. That should be true for any adjacent codes in our
perceptual space. Total effective gamma is .33 for perception and 1.0
for the intensity scale=.33

Now we apply inverse gamma to the scale because our eyes see something
else on a CRT. We could apply it directly to the CRT.

A CRT has a gamma of 2.5. To linearise the CRT we can apply a inverse
gamma of.4. We should now have a measurable linearity with 25 and 26
having a spacing of 4%. Our perception now sees this measurable
linearity as perceptualy uniform as the code ration is again 1.01.
This does not apply to codes below 25. The total effective gamma is
(2.5x.4)x.33=.33
We could improve the situation, by applying a further small gamma to
make tones 19 and 20 within the perceptual ratio.
We would need a infinite gamma to make tone 1 perceptual.
If we added a further gamma of.8, then the new effective gamma would be
.33X.8=.264

What puzzles me is Chris Cox's claim that even with a linear intensity
and a linear display we would still need a gamma of .5(inverse of 2.0 I
assume) making the total effective gamma of.5x.33=.17.
This certainly opens up levels 10 and 11, but has a dreadful effect on
all the higher tones.

Our perception and its gamma plays the biggest part in all this, but
does not figure greatly in Mr Poynton's theory.
The concept of applying a gamma to aid perception is entertained, but
the fact that perception brings its own gamma to the party seems to be
ignored.

I have a new graph, which I think is self explanatory.
http://www.btinternet.com/~mike.engles/mike/Gammas.jpg



Mike, the part that I disagree with is the importance of 1% steps AFTER the
eye's perceived .33 gamma computation.

Your previous graph computed the delta between linear 100 and 101 after 0.33
gamma to be a 0.3% step. Assuming a 1% threshold as defined your way, this
implies that our 1% threshold cannot detect that 100-101 delta, yet of course
we can detect it (barely, which is the idea), because it is 1% when linear.

Similarly we can detect linear 200 and 202 (1%, but also only 0.3% your way)
but not 200 and 201 because that's only 0.5%.

This part is trivial to test, we can see it or we cant, and that result makes
it very clear that Poynton and Weber are about this 1% perceivable threshold
as steps of 1% in the original target linear values.

The dark end is a different ballgame. Instead of a visual gap which is said
to be the problem, I cannot detect the difference in linear 25 and 26, in fact
it takes 25/29 for me to just detect it on my monitor setup (it's 2 or 3 years
old, but a pretty good old monitor, Nokia 19 inch). At the low end, this
perception problem seems to run the opposite direction. For example, 10 to 11
is 10%, and your 0.33 computation would say this step is more than 3%, but yet
no way it is detectable, at least not on my monitor.
 
SNIP
Mike, the part that I disagree with is the importance of 1% steps
AFTER the eye's perceived .33 gamma computation.

Your previous graph computed the delta between linear 100 and
101 after 0.33 gamma to be a 0.3% step. Assuming a 1%
threshold as defined your way, this implies that our 1% threshold
cannot detect that 100-101 delta, yet of course we can detect it
(barely, which is the idea), because it is 1% when linear.

That's the way I see it (pun intended) as well.
What matters is what the (adapted) eye can discern.

Weber's experiments indicate that approximately a 1% difference is the
discrimination threshold at certain ambient luminance levels, but the
relationship fails at e.g. extremely low luminance levels.

SNIP
The dark end is a different ballgame. Instead of a visual gap
which is said to be the problem, I cannot detect the difference
in linear 25 and 26, in fact it takes 25/29 for me to just detect
it on my monitor setup (it's 2 or 3 years old, but a pretty good
old monitor, Nokia 19 inch). At the low end, this perception
problem seems to run the opposite direction. For example,
10 to 11 is 10%, and your 0.33 computation would say this
step is more than 3%, but yet no way it is detectable, at least
not on my monitor.

The Weber-Fechner law (translation from other sources).
This law relates the physical intensity of a stimulus to the resulting
perception by our sensory organs. It states that to increase the
intensity of a sensation in arithmetical progression (i.e. additive),
it is necessary to increase the intensity of the stimulus in geometric
progression (i.e. multiplicative).
Later research has shown that this principle is not universally true,
in the case of human vision, it only applies to a small range of
luminances of approx. 250:1. The adaptation level of the eye, duration
of the stimulus, etc. also play a role.
If the contrast sensitivity of the eye is determined over a large
range of luminances and the findings are plotted with relative
sensation strength as a result of stimulation by light, the curve
looks like the characteristic curve of a photographic negative with a
deeply curved foot.
The implication for correct tonal reproduction, amongst others, is
that correct tonal reproduction depends on the brightness of the
viewing area being in relation to the brightness of the scene as it
was recorded.

This was later refined by a guy called Stevens (and others), but what
counts is the stimulation of our eyes within a limited range of
brightnesses at a given ambient luminance level (adaptation level).

Bart
 
This was later refined by a guy called Stevens (and others), but what
counts is the stimulation of our eyes within a limited range of
brightnesses at a given ambient luminance level (adaptation level).

Yes, the 1/3 power law for vision seems to have very wide acceptance,
seems to be fact today.

What's your take on gamma Bart? Gamma encoding is essential to correct
the CRT of course, but do you think gamma encoding also imparts magical
powers of human perception to 8 bit data too? I'm questioning how the
latter effect can be real, since it must be decoded back to linear
before we ever get a look at the data.

I know, any such compression notion is so it will fit in the 8 bit
container. This 8 bit container holding the gamma data is situated
between starting with say 12 bits, and ending with an analog CRT beam
intensity. All 8 bit data is gamma encoded. But I'm having trouble
reasoning out any perceptual difference in the "before gamma" and "after
gamma" linear values, the view we actually look at. Encode/Decode should
have no lasting effect on the linear data.

I do like Poyntons analogy at
http://www.poynton.com/notes/Timo/Physical_analogy.html
about losing "easily-perceptible differences among the dark shades,
while preserving imperceptible differences among the light shades",

which is of course exactly what happens due to the eyes response, so
this notion of enhancement of human perception seems great at first
glance. It is easy to comprehend, up until the time the data is decoded
for viewing by humans. What effect is left then? What am I missing?
 
Bart said:
SNIP

That's the way I see it (pun intended) as well.
What matters is what the (adapted) eye can discern.

Weber's experiments indicate that approximately a 1% difference is the
discrimination threshold at certain ambient luminance levels, but the
relationship fails at e.g. extremely low luminance levels.

SNIP

The Weber-Fechner law (translation from other sources).
This law relates the physical intensity of a stimulus to the resulting
perception by our sensory organs. It states that to increase the
intensity of a sensation in arithmetical progression (i.e. additive),
it is necessary to increase the intensity of the stimulus in geometric
progression (i.e. multiplicative).
Later research has shown that this principle is not universally true,
in the case of human vision, it only applies to a small range of
luminances of approx. 250:1. The adaptation level of the eye, duration
of the stimulus, etc. also play a role.
If the contrast sensitivity of the eye is determined over a large
range of luminances and the findings are plotted with relative
sensation strength as a result of stimulation by light, the curve
looks like the characteristic curve of a photographic negative with a
deeply curved foot.
The implication for correct tonal reproduction, amongst others, is
that correct tonal reproduction depends on the brightness of the
viewing area being in relation to the brightness of the scene as it
was recorded.

This was later refined by a guy called Stevens (and others), but what
counts is the stimulation of our eyes within a limited range of
brightnesses at a given ambient luminance level (adaptation level).

Bart


Hello

Curiously this sounds a lot like Timo Autiokari.

I was using Charles Poynton's theory in his GAQ on Gamma.
I have added a concept of Total Effective Gamma and the perception of
images on a CRT and a linear display. The asumption is that the eye has
a nonlinearity approximating to a gamma of .33. The CRT has a
nonlinearity of 2.5. The interaction of these non linearities and the
gamma we use to correct them are the main protagonists. The other
concept is the one of minimun perception ratio. This is supposed to be
1.01. I have made Excel graphs of these interactions to show their
individual and collective effects. I called this Total Effective Gamma.

I have been tracking how we perceive codes 15 and 26 in a linear scale,
when various gamma are applied. It is quite interesting.

I am quite convinced that in this limited case our perception is set for
daylight and what we try to depict on our screens are generally images
that are taken in daylight. Our perception has evolved such that
daylight adaptation is its main mode. We as a species don't like
wandering about in the dark;too dangerous.

I am also convinced that our perception, might have other modes, just
like our hearing. Our hearing is nonlinear, but that non linearity
depends on the prevailing sound level. That is why we have the concept
of equal loudness curves that Fletcher and Munson derived.

In your example of the ratio of codes, you are correct, they cannot be
seen unless you zoom into them. The perceptual ratio is not in their
favour even when mapped into the gamma of our perception. It takes a
extra gamma of about 2.0(effective gamma.17) to make this perceptable.
By that time all the levels from 80 on are pretty well white.
There in no point in trying to make those levels perceptually even, if
the cost is that there is no detail in any other part of the image.

If you are interested I can post information that will track these
changes, in a table. By the way Timo Autiokarai has some good
experiments about the perceptual ratio.



Mike Engles
 
I wasnt suggesting we dont use gamma. The CRT requires gamma, so it is
our standard to do it that way. No problem here with gamma.

But I'm not able to reason out any perceptual enhancement of 8 bit data
due to gamma. For example, gamma encoding boosts the linear midpoint
value 127 to 187. We can gamma encode it as 187 for the CRT, or we can
save it linear as 127. Let's assume both is done.

If assuming somehow that the second display device is linear and does not
need gamma correction, then what is the difference?

First way, the gamma CRT decodes 187 to 127 and shows 127 intensity on
the display.

Second way, the linear display simply shows 127 intensity on the display.

Either way, the human eye sees the same 127 intensity, meaning midpoint
of the monitors full brightness. The eye seems not a factor.

Both are 8 bit data. Where is the reported perceptual advantage?
 
Wayne said:
I wasnt suggesting we dont use gamma. The CRT requires gamma, so it is
our standard to do it that way. No problem here with gamma.

But I'm not able to reason out any perceptual enhancement of 8 bit data
due to gamma. For example, gamma encoding boosts the linear midpoint
value 127 to 187. We can gamma encode it as 187 for the CRT, or we can
save it linear as 127. Let's assume both is done.

If assuming somehow that the second display device is linear and does not
need gamma correction, then what is the difference?

First way, the gamma CRT decodes 187 to 127 and shows 127 intensity on
the display.

Second way, the linear display simply shows 127 intensity on the display.

Either way, the human eye sees the same 127 intensity, meaning midpoint
of the monitors full brightness. The eye seems not a factor.

Both are 8 bit data. Where is the reported perceptual advantage?


Hello

Linearity is the perceptual advantage.
When the image is measurably linear, it is perceptually uniform within
certain limits, so that the codes are close enough that we cannot notice
a jump in luminosity. My calculations suggest that it is around codes 25
and 26. It is possible that the perceptual ratio is greater than 1.01,
in which case lower codes become into the perceptually uniform range.


The gamma encoding is just what we need to add to correct a CRT: it
always was. It cannot do anything else. It aids perception of the image
by making it linear. At the moment we only add gamma 2.2(.45) to correct
for s CRT of gamma 2.5. There is a gamma deficit of 2.5X.45=1.125. The
total effective gamma taking our perception into account
is.33x1.125=.37, well short of the gammma necessary to make codes 25 and
26 perceptionally uniform. If we scanned with a gamma of .4
(inverse2.5), we would achieve measurable linearity and perceptual
uniformity, up to a limit. That limit will always be there. We can lower
it by added more gamma beyond that need for linearity, with the cost
that all the midtones and the highlights, become nearly white. To make
code 0 and 1 perceptually uniform we would need a infinite gamma.Their
ratio is infinite.

I have made a chart and another plot of curves to show this.


http://www.btinternet.com/~mike.engles/mike/5curves.jpg
http://www.btinternet.com/~mike.engles/mike/plot.jpg

Mike Engles
 
That's quite an explanation Mike. I dont follow your curves, but the
difference of 0.45/0.4 = 1.125 does darken the image somewhat, less boost,
less expansion of the dark values, which seems to hurt more than help (this
dark expansion being the reported goal, to space the dark points wider).
Then the CRT decode will make it even darker. Frankly this reduced effect
doesnt seem to aid perceiving dark data steps.

But yes, I must agree that it is a remaining effect, however which Poynton
explains differently, the dim room also being related to why movie/slide
film has exaggarated contrast. To me, this effect doesnt seem to be
presented as a player in the dark end 8 bit problem. It would also affect 16
bit data coded to 2.2, which doesnt need it.

Poynton addresses the 8 bit 1% situation as entirely being a dark end
problem (which he applies to Luminance, not to Lightness as you do).

The 8 bit solution is a good story, and reading it sounds real good, until I
realize that the data is decoded by the CRT before humans ever see it. So
I'm wondering what actually is the remaining effect of encoding and then
decoding the 8 bit data that helps the eye better perceive the dark end of
8 bit data? And of course, why doesnt it work on my old CRT? <g>
 
Bart van der Wolf said:
Unfortunately that is too general a statement. The eye
adapts to the luminance within roughly 1 degree of vision.

No it absolutely does not, when you look at such a 1 degree very dark
object do you preceive that everyting else in your field of vision is
overexposed?

Vision has many kind of adaptation properties, you are referring to
one of the spatial adaptations of the vision, they are far more weak
properties than the light(ness) adaptation. Lightness is the
prevailing illumination situation, that does not change when we view a
natural scene. This thread is about seeing the scence reflectances
under a fixed illumination level.
Whithin the angle of adaptation, Weber's law (approx. 1% threshold)
roughly applies.

It does not apply, not even rougly, for natural scence. Weber's law
only explain how we perceive lightness levels, or how our lightness
adaptation works.

Also, experiments of the contrast sensitivity (that is the subject
matter in this thread) will fail when large test patches are used,
even if you use a natural scene as the backgound for such patches,
since the vision is much more sensitive for such large noise free
pathces than it is for the image detail in photograps. Ricco's law
explains this, basically it says that detection threshold for a
stimulus follows the form I x A = C, where I is stimulus intensity, A
is stimulus area or size, and C is a constant. So when you use test
patches that are 2 by 2 pixels in size you will introduce a 4x error
to your experiment compared to the case how we see natural scene and
photographs.

Timo Autiokari
 
Back
Top