POV-Ray : Newsgroups : povray.binaries.images : More Gamma Again Server Time
31 Jul 2024 04:22:51 EDT (-0400)
  More Gamma Again (Message 21 to 30 of 33)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 3 Messages >>>
From: clipka
Subject: Re: More Gamma Again
Date: 2 Dec 2010 04:26:50
Message: <4cf7665a$1@news.povray.org>
Am 02.12.2010 01:01, schrieb Jaap Frank:

> That's odd, because for me the 3.6 side is correct and the 3.7 side is
> far too bright.

Actually /that/ is odd.

> By the way, the challenge from clipka is for me a perfect gradient from
> 0,0 to 1,1 in the XY-plane. I suspect that this picture is made with
> 3.7, so that is odd again.

No, it's an image with a "visually linear" gradient created in Photoshop 
while working with the sRGB color profile, which I then converted to a 
custom color profile with a gamma of 1.0. The challenge is to open this 
image in Photoshop and - without converting it to a different color 
profile - draw a visually linear gradient over it. I don't know about 
newer versions, but in Photoshop 6.0 this will have you end up with a 
gradient similar to that created by POV-Ray 3.7.

> I'm reading the Gamma Stories for months now and all the same I'm confused.
> Maybe clipka can answer what is correct:
> Povray makes a calculation for a picture and the values of the first
> three pixels are 64,64,64 / 128,128,128 / 192,192,192.
> As I understand these are the values of PovRay's internal lineair color
> space.

No. POV-Ray internally works with floating point numbers.
But let's for now assume that POV-Ray happens to compute 0.25,0.25,0.25 
/ 0.5,0.5,0.5 / 0.75,0.75,0.75 for those pixels.

> My questions are:
> A. What values are send to the display system at the moment of rendering:
> 1. Gamma corrected values for a 2.2. display, so not the lineair values.

Yes. In the given case that would be 136,136,136 / 186,186,186 / 
224,224,224.

To be precise, the gamma may be the one specified by the Display_Gamma 
INI file option, defaulting to 2.2. You can also set 
"Display_Gamma=sRGB", in which case you'll get the roughly similar 
adjustment specified in the sRGB color space specification ("sRGB 
transfer function").

> 2. Lineair values and PovRay tells the display system to convert them to
> 2.2 display values:

No.

> B. What values are written in the png file and what is put in the gAMA
> chunk.
> 1. Same as A.1. and the gAMA chunk tells the values are gamma corrected
> for 2.2.

By default, yes. Again, you can specify the gamma using the File_Gamma 
INI file option, and once again 2.2 is the default and "sRGB" is a valid 
value also.

> 2. Same as A.2. and the gAMA chunk tells that the correct values should
> be 2.2 corrected values (sounds not correct, but you never can tell).

That would be the case if you set File_Gamma=1.0. But to be precise, 
POV-Ray would not tell in the gAMA chunk that the values still need to 
be gamma-corrected for 2.2, but rather just tell that the values are 
linear, leaving it up to the image viewer to decide for which gamma to 
pre-correct the data before sending them to the display.

> To complete the story:
> C.1. PovRay expects the file for a image-texture on a object to be gamma
> corrected (default 2.2) and counter corrects the values for it's lineair
> color space.

That would be the case for most low dynamic range file formats that do 
not carry gamma information (or none that POV-Ray can currently 
understand; e.g. BMP or JPEG).

> 2.Same, but the correction depends on the gAMA blok. With no gAMA a 2.2
> correction is used.

That would be the case for PNG images, except that an sRGB chunk would 
take precedence over a gAMA chunk, and the default would be the sRGB 
transfer function, which is close to (but not quite the same as) a gamma 
of 2.2.


> I think that the answers are A.1 and B.1, but sometimes I begin to doubt
> that, as I read these gamma stories.

It's still true nonetheless. The original cause of confusion is 
typically the impression that normally pixel values (such as displayed 
by Photoshop, or by most color pickers) would be linear. They're not.

> As far as I've understood C.1 is 3.6 and C.2 is 3.7 policy.

Yes and no. In general you're right, but for PNG 3.6 already used gamma 
correction if a gAMA chunk was present (it ignored sRGB chunks though, 
IIRC).


Post a reply to this message

From: Stephen Klebs
Subject: Re: More Gamma Again
Date: 2 Dec 2010 08:10:01
Message: <web.4cf79a7ba2356450fc413f510@news.povray.org>
> Okay, so the problems with Steve Gower's scene are obviously unrelated
> to the gamma changes in POV-Ray 3.7.

I don't know. I don't know the inner workings of all the changes that have been
made or how they interrelate. Can anyone? POV's turned into a pretty complex
organism. I just couldn't get it to work. And if that doesn't work I'm assuming
there's a lot of other scenes that won't work. They don't have to, of course.
But it worked fine in 3.6 (as #version 3.0). How stuff made in 3.6 will come out
in 3.7 (as #version 3.6) we'll see.


Post a reply to this message

From: Stephen Klebs
Subject: Re: More Gamma Again
Date: 2 Dec 2010 17:15:01
Message: <web.4cf81a3da2356450fc413f510@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

> On most displays, image "gammachecker_3.6.png" will show a chrome sphere
> on a checkered plane, but there's something wrong here: The checkering
> shouldn't be there - the plain grey tiles have a brightness of 0.5,
> while the striped tiles have alternating lines of 0.0 black and 1.0
> white, so should appear just as bright as the grey if you squint your
> eyes; and in indeed both tiles appear to have the same brightness in the
> reflection, where anti-aliasing computes the correct result.

Your gammachecker_3.6 is fascinating. Is the scene file floating around
somewhere. I assume from the title it's done in 3.6 -- if that makes any
difference.

I don't really understand how this tests gamma, though, which in practical
terms, for how I use it, has to do with the relative relation of highlight and
midtones and shade and shadow, or in Photoshop terms, "curves."


Post a reply to this message

From: Warp
Subject: Re: More Gamma Again
Date: 3 Dec 2010 06:07:15
Message: <4cf8cf63@news.povray.org>
On 12/02/2010 11:26 AM, clipka wrote:
> Am 02.12.2010 01:01, schrieb Jaap Frank:
> 
>> That's odd, because for me the 3.6 side is correct and the 3.7 side is
>> far too bright.
> 
> Actually /that/ is odd.

  However, regardless of what the reason might be for RGB mapping to
physically linear brightness on his monitor (while in most other cases
the mapping is exponential), this is still the beauty of gamma
correction (when applied properly): He can still set up his assumed and
display gammas in POV-Ray so that rgb 0.5 looks on his display as
physically 50% bright, design his scene that way, distribute the
resulting PNG, and the what-is-supposed-to-be-50%-gray will look like
that on someone else's display as well.

  Without any gamma information what looks on his monitor as perfectly
50% gray will look significantly darker on someone else's monitor. The
whole purpose for gamma information is to make the image look the same
in all systems.

  So while it might be odd (regardless of what the reason for it might
be), it shouldn't be a problem.


Post a reply to this message

From: Stephen Klebs
Subject: Re: More Gamma Again
Date: 3 Dec 2010 06:55:01
Message: <web.4cf8d9aaa2356450fc413f510@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> On 12/02/2010 11:26 AM, clipka wrote:
> > Am 02.12.2010 01:01, schrieb Jaap Frank:
> >
> >> That's odd, because for me the 3.6 side is correct and the 3.7 side is
> >> far too bright.
> >
> > Actually /that/ is odd.
>
>   However, regardless of what the reason might be for RGB mapping to
> physically linear brightness on his monitor (while in most other cases
> the mapping is exponential), this is still the beauty of gamma
> correction (when applied properly): He can still set up his assumed and
> display gammas in POV-Ray so that rgb 0.5 looks on his display as
> physically 50% bright, design his scene that way, distribute the
> resulting PNG, and the what-is-supposed-to-be-50%-gray will look like
> that on someone else's display as well.
>
>   Without any gamma information what looks on his monitor as perfectly
> 50% gray will look significantly darker on someone else's monitor. The
> whole purpose for gamma information is to make the image look the same
> in all systems.
>
>   So while it might be odd (regardless of what the reason for it might
> be), it shouldn't be a problem.

There seems some confusion here about two ways of approaching gamma. Gamma in
the sense of how a monitor must be calibrated to match absolute physical
brightness levels on a display, paper, inks etc, and gamma in the sense of the
*relative* distribution of tonal values from highlights to midtones to shade to
shadow to black, what Photoshop calls "curves" or what POV has called
"assumed_gamma". It seems, too, from my preliminary tests, that POV is
sacrificing one for the other. It's been almost impossible so far, working
within the defaults of 3.7, to get pictures that don't seem washed out and flat,
as the gradient example suggests they would since the fine gradations in the
darker range seem lost. I'm curious to see how the sample scenes will turn out.
It is perfectly possible and even essential in image processing to adjust the
*relative* distribution of tones. usually to add depth to a picture, and still
set gamma correction according to the color profile so that it can be seen
equally well in another medium or display. It doesn't seem to be possible though
to have gamma correction without color profiles.


Post a reply to this message

From: Mike Raiford
Subject: Re: More Gamma Again
Date: 3 Dec 2010 10:42:59
Message: <4cf91003$1@news.povray.org>
On 12/1/2010 2:45 PM, Warp wrote:

>    With my monitor the photoshop/pov36 part (at the left) has the same
> brightness somewhere between the second-to-last and third-to-last square,
> while the pov37 part (at the right) as the same brightness somewhere in
> the middle, as it should.
>
>

Oddly, I get the exact opposite result ... The left half of the image 
matches brightness around the middle. The right half matches in the 
second or third from the top.

-- 
~Mike


Post a reply to this message

From: clipka
Subject: Re: More Gamma Again
Date: 3 Dec 2010 11:57:08
Message: <4cf92164@news.povray.org>
Am 02.12.2010 23:14, schrieb Stephen Klebs:
> clipka<ano### [at] anonymousorg>  wrote:
>
>> On most displays, image "gammachecker_3.6.png" will show a chrome sphere
>> on a checkered plane, but there's something wrong here: The checkering
>> shouldn't be there - the plain grey tiles have a brightness of 0.5,
>> while the striped tiles have alternating lines of 0.0 black and 1.0
>> white, so should appear just as bright as the grey if you squint your
>> eyes; and in indeed both tiles appear to have the same brightness in the
>> reflection, where anti-aliasing computes the correct result.
>
> Your gammachecker_3.6 is fascinating. Is the scene file floating around
> somewhere. I assume from the title it's done in 3.6 -- if that makes any
> difference.

It's not floating around yet, but maybe it's worth adding it to the 
sample scenes, if only for demonstration purposes.

> I don't really understand how this tests gamma, though, which in practical
> terms, for how I use it, has to do with the relative relation of highlight and
> midtones and shade and shadow, or in Photoshop terms, "curves."

It doesn't test the "curves" ("tone mapping"?) "gamma" thing - what it 
does check is whether the purely technical thing called "gamma 
correction" is set up correctly (in which case you shouldn't see any 
checkered plane anywhere); however, I originally designed it as a 
demonstrator for why you should do proper gamma handling; as for the 
name, I just couldn't resist the pun.


Post a reply to this message

From: Jaap Frank
Subject: Re: More Gamma Again
Date: 3 Dec 2010 12:03:07
Message: <4cf922cb$1@news.povray.org>
____________________________________________________
"Warp"  schreef in bericht news:4cf762ae@news.povray.org...

On 12/02/2010 02:01 AM, Jaap Frank wrote:
> That's odd, because for me the 3.6 side is correct and the 3.7 side is
> far too bright.
> I've a rather new HD LCD TFT monitor (about 6 months) and adjusted it
> conform the windows 7 system with brightness and contrast followed by
> color shade correction.
> Further the monitor of my laptop (Acer Aspire, 1 year old, crystal clear
> display) shows exactly the same picture. Both are driven by the NVidia
> card inside the laptop, so they should be the same and for /me/ they
> are. The pictures are displayed by Windows Live Mail.

  Note that at least with some LCD displays (especially on some laptops)
the angle from which you look at the screen affects the brightness. For
example, if I look at the image I posted in a MacBook laptop, I can
"tune" the "gamma correction" of the display by tilting the screen back
or forth (thus changing the vertical angle from which I look at the
screen). At some angles it looks like the brightness of the sides
correspond to the center of the 3.6 gradient (and thus the 3.7 gradient
is too bright), while at other angles it looks like they correspond to
the center of the 3.7 gradient (and thus the 3.6 gradient looks too
dark). (And everything in-between, of course.) This tells me that the
screen on this laptop is an *extremely* poor tool to determine which one
is correct (if either), because I can change it by simply looking at it
from a higher or a lower angle.

  I do understand, however, that many of the more modern and expensive
LCD displays don't suffer from this problem (at least not as badly).

  If I had a working camera I could take photos to corroborate these
findings, but unfortunately I don't.
_____________________________________________________________-

So I did some physical training. I tilted my display screens in any 
direction you can imagine, even held them up side down and on their sides, 
but while the light impression change with extreem angles, the result is 
always the same, 3.6 halfway the gradient and 3.7 somewhere around the 
second and third from the dark side. So the problem couldn't be the tilting 
angle.

Yve wrote somewhere in this thread that you can choose the color space. I 
found it and choose another possibility, but it didn't change much. It's now 
a tiny fraction in favor of the 3.7 side. For those who want to experiment 
with it:
Windows 7 (and probably Vista):  Control Panel > Appearances & 
Personalisation > Screen Resolution > Advanced Settings > Color Management 
(> Advanced > Calibrate Display).
Win XP: Search your Screen Resolution in Display, the rest is identical.
In 7 there are different Color spaces, but I think that the ICC profiles 
(these are for displays) are the only ones you can use. Maybe Yve can 
comment on that. In 7 there are two of theme and in XP there is one choice.
If you want to calibrate your screen then use the last part between the 
braces (7 only).

So, somewhat wiser, but not further. The next thing I tried was the color 
gamma of the video card. NVidia gives the possibility to change the gamma 
per color. Because I haven't a picture for the colors I first open't Paint 
Shop Pro 6 and in Files > Preferences > Monitor gamma there are three color 
bars and a B&W-bar, so you can adjust the gamma's. These values I used in 
the NVideo program and check it with PSP6 again. In PSP these are now all 
around one value, so my monitors are correctly calibrated.

Back to the picture of Warp: No change at all. Still 3.6 is correct and 3.7 
is not correct.

My conclusion is that the problem lies somewhere else and is NOT a problem 
of the monitors. In another computer with a rather expensive BenQ monitor 
(LCD) the results are exactly the same (Win XP and another NVidia card).

Can anyone check my results and answer here?

Jaap Frank


Post a reply to this message

From: Jaap Frank
Subject: Re: More Gamma Again
Date: 3 Dec 2010 12:14:08
Message: <4cf92560$1@news.povray.org>
_________________________________________________
"Ive"  schreef in bericht news:4cf6fed2$1@news.povray.org...

On 02.12.2010 01:01, Jaap Frank wrote:
> ....

Trust me, Warp is correct and if you see it different there is something
screwed up with your display system. One cannot *perfectly* calibrate a
display without usage of some external hardware but for, let's say
hobbyist usage, there are quite a lot tools (and web-pages) around that
allow for visual adjustment but all of them boil down to something
similar Warp has shown.
_________________________________________________

Thanks for the fast reaction. Please read my reaction on the comment of 
Warp too.

_______________________________________________________
> I'm wondering if the default 3.7 approach is correcting the values for a
> 2.2 gamma display in the file, while the display system thinks it gets
.....

A.1. but the actual value can be adjusted by the display_gamma setting
with the recommended default of 2.2 (unless you know what you are doing ;)
B.1. but the actual value can be adjusted by the file_gamma setting with
the recommended default of 2.2 (unless you know what you are doing ;-P)
and the exception of high dynamic range formats being always encoded
linear (as they should be by definition).

C.2. is true for POV-Ray 3.7 AND 3.6 and PNG input format except when no
gamma chunk was present when POV-Ray 3.6 did apply no correction at all
(see below).

C.1. is true for POV-Ray 3.7 and any other format than PNG
BUT POV-Ray 3.6 did use the gamma encoded values internally directly
without converting them to linear color space and this was plain wrong!
________________________________________________________

Then I did understand it right. Now I'm sure about it, thank you.

_______________________________________________
-Ive (and sorry for sending the mail - this happens to me all the time,
I really should learn how to use Thunderbird)
__________________________________________________

Don't bother about that personal email, it has happened to me too.

Jaap Frank


Post a reply to this message

From: Jaap Frank
Subject: Re: More Gamma Again
Date: 3 Dec 2010 12:21:53
Message: <4cf92731$1@news.povray.org>
_______________________________________________
"clipka"  schreef in bericht news:4cf7665a$1@news.povray.org...

Am 02.12.2010 01:01, schrieb Jaap Frank:

> That's odd, because for me the 3.6 side is correct and the 3.7 side is
> far too bright.

Actually /that/ is odd.
_____________________________________________

Please read my reaction on the comment of Warp about the monitors.

_____________________________________________
> By the way, the challenge from clipka is for me a perfect gradient from
> 0,0 to 1,1 in the XY-plane. I suspect that this picture is made with
> 3.7, so that is odd again.

No, it's an image with a "visually linear" gradient created in Photoshop
while working with the sRGB color profile, which I then converted to a
custom color profile with a gamma of 1.0. The challenge is to open this
image in Photoshop and - without converting it to a different color
profile - draw a visually linear gradient over it. I don't know about
newer versions, but in Photoshop 6.0 this will have you end up with a
gradient similar to that created by POV-Ray 3.7.
___________________________________________________
How do you do that: ...draw a visually linear gradient over it. Is there a 
choice for this in PSP somewhere?

______________________________________________________
> I'm reading the Gamma Stories for months now and all the same I'm 
> confused.
......
_____________________________________________________

Thank you for you thorough explanation. Now I'm sure about the different 
gamma settings.

Jaap Frank


Post a reply to this message

<<< Previous 10 Messages Goto Latest 10 Messages Next 3 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.