POV-Ray : Newsgroups : povray.beta-test : Struggling with gamma... Server Time
4 Jul 2024 12:42:28 EDT (-0400)
  Struggling with gamma... (Message 4 to 13 of 33)  
<<< Previous 3 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: clipka
Subject: Re: Struggling with gamma...
Date: 26 Jun 2010 06:22:05
Message: <4c25d4cd$1@news.povray.org>
Am 26.06.2010 10:12, schrieb Gyscos:
> Hello there !
> I tried, I tried, I really tried to understand how gamma works...
> How could I switch it off ?... So this scene would give a perfectly mid-gray
> image :
>
> camera {
>    location -z
>    look_at 0
> }
>
> box {
>    -0.5
>    0.5
>    pigment { rgb 0.5 }
>    finish { ambient 1 }
> }

This scene actually /does/ give a perfectly mid-gray image... as long as 
we're talking about physical light intensity, rather than perceptual 
brightness ;-)

To really get the scene to look the way you want it to, use:

    pigment { rgb pow(0.5, 2.2) }

Future betas will also provide an extended color syntax for this purpose:

    pigment { rgb 0.5 gamma 2.2 }

> I tried File_Gamma=1 Display_Gamma=1, and it seemed to work fine in gimp and in
> the window image viewer, but then I try to see the image in firefox and it is
> way to bright - so firefox can't handle gamma data ?

Let me guess - you used PNG file output? In that case it is a sign that 
/Firefox/ is getting it right, while gimp and the image viewer are not. 
The File_Gamma setting does not affect PNG output very much (provided 
that your image processing software is handling gamma right), except for 
banding artifacts.


Post a reply to this message

From: Stephen
Subject: Re: Struggling with gamma...
Date: 26 Jun 2010 06:25:51
Message: <4c25d5af@news.povray.org>
On 26/06/2010 10:59 AM, Gyscos wrote:
> If I understood correctly, the 'over-bright impression' is actually the correct
> way images should be, right ?
>
> But then, the default ambient light is waaaay to high, isn't it ?
>
>

high. That means the box does not need a light source to be fully 
illuminated. If you are using radiosity set the ambient to zero. If not 
try an ambient between 0.1 and 0.2.

There have been a few discussions on this newsgroup about the changes in 
the way Pov 3.7 beta handles gamma so you could search here. Also the 
Wiki has a topic.
http://wiki.povray.org/content/HowTo:Fix_old_scenes_to_work_with_the_new_gamma_system


-- 

Best Regards,
	Stephen


Post a reply to this message

From: clipka
Subject: Re: Struggling with gamma...
Date: 26 Jun 2010 06:33:53
Message: <4c25d791$1@news.povray.org>
Am 26.06.2010 11:59, schrieb Gyscos:
> If I understood correctly, the 'over-bright impression' is actually the correct
> way images should be, right ?

Um... yes and no.

Yes: That's the right math.

No: If your scene looks overly bright, your parameters are wrong.


> But then, the default ambient light is waaaay to high, isn't it ?

If you're talking about the default global { ambient_light 1.0 }: No, 
that has nothing to do with gamma.

If you're talking about the default finish { ambient 0.1 }, and/or the 
ambient values in all those standard material .inc files coming with 
POV-Ray, then no, no and maybe.

No: Ambient light is pretty dependent on the actual scene, and actually 
the only way to /really/ do it right is using radiosity instead.

No: The effect of ambient light also depends on the object's pigment, 
which is waaaay too high in the default colors as well, as they were 
designed at times when gamma wasn't done right.

Maybe: The ambient light defaults, too, were chosen at a time when gamma 
wasn't done right, so they should be subject to re-evaluation.


Post a reply to this message

From: clipka
Subject: Re: Struggling with gamma...
Date: 26 Jun 2010 06:41:09
Message: <4c25d945$1@news.povray.org>
Am 26.06.2010 11:03, schrieb Gyscos:
> I just saw the gamma tutorial on the wiki, so I'll be reading it... Hopefully
> I'll finally get to what I want ! :)

Not sure which one you're talking about right now, but I'd like to take 
the opportunity to advertise my gamma tutorial WIP once again: 
<http://wiki.povray.org/content/User:Clipka/Gamma>

(Feedback appreciated, as usual.)


Post a reply to this message

From: Gyscos
Subject: Re: Struggling with gamma...
Date: 26 Jun 2010 07:25:01
Message: <web.4c25e2a065b49d46e3006550@news.povray.org>
Yup, that's the one I was reading. :)

About the ambient light, I meant that in a simple scene, with just a plane and a
box for instance, the ambient light was indeed designed to work with the old
settings ; and now, with the new gamma stuff, it might need some re-adjusting.

I don't want to adapt old scenes, I'm just trying to make new ones with what I
knew from before.

But I'm trying to make some nice scattering, and it is really harder now... I
used to use type 2, but now I can't get enough contrast between the high-angle
and the low-angle zone... So I use type 3, wich gives more or less the same
result as type 2 before, but... It doesn't seem right to change type for that.
:(


Post a reply to this message

From: Gyscos
Subject: Re: Struggling with gamma...
Date: 26 Jun 2010 07:25:01
Message: <web.4c25e37465b49d46e3006550@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
[...]
> Let me guess - you used PNG file output? In that case it is a sign that
> /Firefox/ is getting it right, while gimp and the image viewer are not.
> The File_Gamma setting does not affect PNG output very much (provided
> that your image processing software is handling gamma right), except for
> banding artifacts.

But the POV-Ray preview was identical to what I get in Gimp or window viewer...
Is that normal ?
Display_gamma and File_Gamma being identical doesn't mean the preview and the
output image - when correctly decoded - are the same ?


Post a reply to this message

From: clipka
Subject: Re: Struggling with gamma...
Date: 26 Jun 2010 10:10:10
Message: <4c260a42$1@news.povray.org>
Am 26.06.2010 13:24, schrieb Gyscos:
> clipka<ano### [at] anonymousorg>  wrote:
> [...]
>> Let me guess - you used PNG file output? In that case it is a sign that
>> /Firefox/ is getting it right, while gimp and the image viewer are not.
>> The File_Gamma setting does not affect PNG output very much (provided
>> that your image processing software is handling gamma right), except for
>> banding artifacts.
>
> But the POV-Ray preview was identical to what I get in Gimp or window viewer...
> Is that normal ?

If you set Display_Gamma=1.0, then yes - you'll typically get a wrong 
preview...

> Display_gamma and File_Gamma being identical doesn't mean the preview and the
> output image - when correctly decoded - are the same ?

That depends.

Display_Gamma always specifies the gamma pre-correction to apply in 
order to show a correct preview.

File_Gamma strictly speaking doesn't specify gamma pre-correction, but 
gamma encoding (or, even more strictly speaking, the inverse of the 
encoding gamma). For some older file formats, like BMP or JPEG, where 
gamma encoding double-features as gamma pre-correction, this happens to 
be the same; PNG, on the other hand, includes information about the 
encoding gamma used in the file header, so that it can be left all up to 
the viewing software to perform both gamma decoding and gamma 
pre-correction for display. And for HDR and OpenEXR file formats, 
File_Gamma has no effect whatsoever because those file formats always 
use linear encoding.


Post a reply to this message

From: Gyscos
Subject: Re: Struggling with gamma...
Date: 26 Jun 2010 11:35:01
Message: <web.4c261d0665b49d46e3006550@news.povray.org>
When I don't specify any gamma settings, I get a bright image. POV-Ray preview
window shows it bright, window explorer show it bright, gimp and firefox too. So
I guess the file is easy to read and everyone get it right.

Now, I put the two gamma options I said earlier : File_Gamma=1 and
Display_Gamma=1.
POV-Ray preview show a darker image, like one I would get with #version 3.6;
Windows explorer and the Gimp also show the darker image.
Firefox shows a bright image.

This makes think firefox is the one to do it the wrong way... Am I wrong ?

Also, I still don't understand when and why identical values to File_Gamma and
Display_Gamma could lead to differences between the POV-Ray preview and the
resulting file...


Post a reply to this message

From: Alain
Subject: Re: Struggling with gamma...
Date: 26 Jun 2010 13:05:04
Message: <4c263340$1@news.povray.org>

> On 26/06/2010 10:59 AM, Gyscos wrote:
>> If I understood correctly, the 'over-bright impression' is actually
>> the correct
>> way images should be, right ?
>>
>> But then, the default ambient light is waaaay to high, isn't it ?
>>
>>

> high. That means the box does not need a light source to be fully
> illuminated. If you are using radiosity set the ambient to zero. If not
> try an ambient between 0.1 and 0.2.
>
> There have been a few discussions on this newsgroup about the changes in
> the way Pov 3.7 beta handles gamma so you could search here. Also the
> Wiki has a topic.
>
http://wiki.povray.org/content/HowTo:Fix_old_scenes_to_work_with_the_new_gamma_system
>
>
>

ambient 1 is to high ONLY IF you also have a light source and some 
diffuse value larger than 1


Alain


Post a reply to this message

From: clipka
Subject: Re: Struggling with gamma...
Date: 26 Jun 2010 15:56:36
Message: <4c265b74$1@news.povray.org>
Am 26.06.2010 17:30, schrieb Gyscos:
> When I don't specify any gamma settings, I get a bright image. POV-Ray preview
> window shows it bright, window explorer show it bright, gimp and firefox too. So
> I guess the file is easy to read and everyone get it right.

Yup. That's how it should be. If you leave it at that, you should 
normally be happy - as soon as you get used to the fact that 50% linear 
brightness isn't percieved by the human eye as medium grey.

> Now, I put the two gamma options I said earlier : File_Gamma=1 and
> Display_Gamma=1.
> POV-Ray preview show a darker image, like one I would get with #version 3.6;
> Windows explorer and the Gimp also show the darker image.
> Firefox shows a bright image.
>
> This makes think firefox is the one to do it the wrong way... Am I wrong ?

Yes, you are:

- Display_Gamma=1 causes the preview window to lie to you about what 
POV-Ray computes.

- PNG file output /always/ gives you a PNG file containing exactly what 
POV-Ray computes, regardless of File_Gamma, because although the 
parameter affects how the binary values in the file are to be 
interpreted in terms of physical light intensities, the file header 
stores this information in an unambiguous manner.

- Any viewer displaying the PNG file properly must therefore display it 
differently than the lie you see in the preview window.


> Also, I still don't understand when and why identical values to File_Gamma and
> Display_Gamma could lead to differences between the POV-Ray preview and the
> resulting file...

This happens with each and every file format that has clearly defined 
rules how the stored binary values relate to physical light intensities: 
HDR, OpenEXR (both of which always store straightforward linear light 
intensities) and PNG (which stores exact information about how the 
linear light intensities were mapped to binary values, and therefore how 
to reconstruct the linear light intensities from the binary values).


Post a reply to this message

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

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