POV-Ray : Newsgroups : povray.binaries.images : I think warp is right ... 3.7 gamma : Re: I think warp is right ... 3.7 gamma Server Time
31 Jul 2024 14:32:36 EDT (-0400)
  Re: I think warp is right ... 3.7 gamma  
From: scott
Date: 2 Sep 2009 10:59:10
Message: <4a9e883e$1@news.povray.org>
> Isn't this counterintuitive?

Maybe, but I can see why POV was written the way it was.  If you specify rgb 
0.5 that means you want 50% physical brightness compared to rgb 1.0.  Note 
however, that if you are looking at an image in paint, RGB 128,128,128 is 
*not* 50% brightness on a normal monitor.

There have been several discussions here about adding a new keyword to POV 
so that you can specify gamma-corrected colours and images in SDL.

> In fact a gamma of 0.46 works well to "uncorrect" the gamma setting in
> the image, but this does cause a loss of color fidelity in the
> highlights, because the highlight area is being stretched over a larger
> range of colors, this could potentially cause posterization and banding
> in gradients.

That's totally the wrong thing to do.  You *must* set POV's output gamma 
correction to match your monitor (or just to 2.2 as it's a kind of standard 
nowadays anyway) to get anywhere near realistic scenes.  Then you need to 
make sure any colours or images you are giving to POV as *inputs* are in 
linear colour space (ie they have not already been gamma corrected).

> With the following scene, what would you expect the output color to be?
<snip>
>   pigment { color rgb .5 } // intuitively: 50% gray!
>   finish { ambient 1 }

With an output gamma correction of 2.2, I would expect the colour to be 
0.5^(1/2.2) * 255 = 186,186,186

> If your monitor is calibrated to a 2.2 gamma, this will be too bright,

No, I make it correct.  (186/255)^2.2 = 0.5, so on a monitor with 2.2 gamma, 
186 should be half as bright as 255.

The problem with *inputs* to POV is that a user sees a pixel of (255,186,0) 
on their desktop (ie 100% brightness red, 50% brightness green, and 0% 
brightness blue) and inputs this to POV:

pigment { color rgb <255,186,0>/255 }
finish{ ambient 1 }

Then renders and checks the pixel value in a paint program.  It gives 
<255,221,0> a totally different colour (and washed out).  The only way to 
get around this currently is to apply some inverse gamma to the colour you 
want out before you give it to POV.  Of course you need to do this for 
images too.


Post a reply to this message

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