POV-Ray : Newsgroups : povray.beta-test : Gamma of interpolated colors in color maps Server Time
26 Jun 2024 12:50:43 EDT (-0400)
  Gamma of interpolated colors in color maps (Message 11 to 20 of 36)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: scott
Subject: Re: Gamma of interpolated colors in color maps
Date: 21 Dec 2010 04:48:20
Message: <4d1077e4$1@news.povray.org>
>    As said, I don't really know *why* this is so. As I have mentioned,
> with my CRT a 'rgb 0.5' as produced by pov3.7 by default looks about
> 50% gray when compared to a test pattern, so *in theory* a linear
> gradient produced by pov3.7 should look linear.

No it shouldn't - your eye/brain does not see light in a linear fashion. 
  50% actual brightness from something (as measured in cd/m^2 or 
whatever) will *not* look half as bright as 100%.  It's no different to 
a real scene, light bulbs, or an image on your monitor.  It's just the 
way your eye/brain works.

An analogy is hearing, a sound with twice the physical power (in Watts) 
does not sound twice as loud to a human.


Post a reply to this message

From: Warp
Subject: Re: Gamma of interpolated colors in color maps
Date: 21 Dec 2010 05:46:04
Message: <4d10856c@news.povray.org>
scott <sco### [at] scottcom> wrote:
> >    As said, I don't really know *why* this is so. As I have mentioned,
> > with my CRT a 'rgb 0.5' as produced by pov3.7 by default looks about
> > 50% gray when compared to a test pattern, so *in theory* a linear
> > gradient produced by pov3.7 should look linear.

> No it shouldn't - your eye/brain does not see light in a linear fashion. 
>   50% actual brightness from something (as measured in cd/m^2 or 
> whatever) will *not* look half as bright as 100%.  It's no different to 
> a real scene, light bulbs, or an image on your monitor.  It's just the 
> way your eye/brain works.

> An analogy is hearing, a sound with twice the physical power (in Watts) 
> does not sound twice as loud to a human.

  I suppose the fundamental question would then be: "If I say to povray
to produce a linear gradient, should it produce a gradient which is
linear according to light intensity, or according to the perceived
linearity as seen by people?"

  What I'm getting at is that when people specify a linear gradient,
they expect to get a gradient that *looks* linear (rather than a gradient
that might be linear as measured by some device that measures light
intensity).

  As for whether eg. surface shading looks more realistic with the new
gamma handling or the old one, it would be interesting to see some
actual comparisons with photographs. (Note that I'm *not* saying here
that in my opinion pov3.6 is producing the more closer-to-reality
result while pov3.7 is producing something which is way off. I'm
completely honestly interested in actual comparisons with real-life
photographs, to see which one gets closer, if that would be possible.)

-- 
                                                          - Warp


Post a reply to this message

From: scott
Subject: Re: Gamma of interpolated colors in color maps
Date: 21 Dec 2010 06:00:12
Message: <4d1088bc$1@news.povray.org>
>    I suppose the fundamental question would then be: "If I say to povray
> to produce a linear gradient, should it produce a gradient which is
> linear according to light intensity, or according to the perceived
> linearity as seen by people?"

Agreed, as I wrote already it might be a good idea for an additional 
keyword (to be used in colour maps) that specifies whether you want 
physical linear interpolation (which will "look" non-linear) or some 
other interpolation type suited to the human visual system.  This would 
be totally separate to any gamma settings, as it has nothing to do with 
gamma.

For grey-scales you can already simply use something like "poly_wave 3" 
to get a more natural gradient, but once colours are involved it's going 
to look wrong without some more sophisticated interpolation algorithm.

>    As for whether eg. surface shading looks more realistic with the new
> gamma handling or the old one, it would be interesting to see some
> actual comparisons with photographs.

The problem with that kind of test is that you are also testing the 
surface lighting equations used in POV (which are a simplification of 
real surfaces).  I wasn't aware there was any doubt as to whether the 
new gamma was more accurate (you can simply test it with a black/white 
checkerboard next to 50% grey).


Post a reply to this message

From: clipka
Subject: Re: Gamma of interpolated colors in color maps
Date: 21 Dec 2010 07:26:16
Message: <4d109ce8$1@news.povray.org>
Am 21.12.2010 12:00, schrieb scott:

> Agreed, as I wrote already it might be a good idea for an additional
> keyword (to be used in colour maps) that specifies whether you want
> physical linear interpolation (which will "look" non-linear) or some
> other interpolation type suited to the human visual system. This would
> be totally separate to any gamma settings, as it has nothing to do with
> gamma.

Not sure whether I mentioned it here or not, but such a mechanism has 
already been on my agenda for a while (it will not make it into 3.7.0 
proper though); the syntax would be something along the lines of

   pigment {
     gradient y
     color_map {
       perceptual
       [0.0 rgb 0]
       [0.5 rgb 1]
       [1.0 rgb 0.5]
     }
   }

(The example also showcases the problem with the poly_wave workaround 
you mention, which only works for gradients running from [0.0 rgb 0] to 
[1.0 Some_Color].)

Pigment maps will need the same mechanism, btw. I also thought about 
whether it would make sense in texture maps, but I guess that's too 
complicated to implement, for too little gain.

>> As for whether eg. surface shading looks more realistic with the new
>> gamma handling or the old one, it would be interesting to see some
>> actual comparisons with photographs.
>
> The problem with that kind of test is that you are also testing the
> surface lighting equations used in POV (which are a simplification of
> real surfaces). I wasn't aware there was any doubt as to whether the new
> gamma was more accurate (you can simply test it with a black/white
> checkerboard next to 50% grey).

There's also the problem that photographs may be non-linear as well; 
digital cameras aren't typically calibrated, and photographic paper has 
non-linearities, too.

A typical reference image would be the Cornell Box (see 
http://www.graphics.cornell.edu/online/box/).


Post a reply to this message

From: scott
Subject: Re: Gamma of interpolated colors in color maps
Date: 21 Dec 2010 08:45:29
Message: <4d10af79$1@news.povray.org>
> Not sure whether I mentioned it here or not, but such a mechanism has
> already been on my agenda for a while (it will not make it into 3.7.0
> proper though);

OOC did you decide already which algorithm to use for this?  Will it 
give more linear looking gradients between different colours too?

 > the syntax would be something along the lines of
>
> pigment {
> gradient y
> color_map {
> perceptual
> [0.0 rgb 0]
> [0.5 rgb 1]
> [1.0 rgb 0.5]
> }
> }

That's exactly the sort of thing I was thinking of.  Maybe Warp will 
argue that the default should be "perceptual" though, and we need a 
"linear" keyword to revert to the existing behaviour.

> There's also the problem that photographs may be non-linear as well;
> digital cameras aren't typically calibrated, and photographic paper has
> non-linearities, too.

I have no idea how well consumer-grade cameras are made, but my camera 
has an option for sRGB or Adobe RGB colour space, so I imagine it can't 
be that far off either one when selected.  Photographic film is probably 
worse, IDK.


Post a reply to this message

From: clipka
Subject: Re: Gamma of interpolated colors in color maps
Date: 21 Dec 2010 09:20:26
Message: <4d10b7aa$1@news.povray.org>
Am 21.12.2010 14:45, schrieb scott:
>> Not sure whether I mentioned it here or not, but such a mechanism has
>> already been on my agenda for a while (it will not make it into 3.7.0
>> proper though);
>
> OOC did you decide already which algorithm to use for this? Will it give
> more linear looking gradients between different colours too?

I expect so.

When interpolating between two colors, POV-Ray currently computes 
something along the lines of:

   q = 1-p;
   result = p * color1 + q * color2;

For a "perceptually linear" gradient, the formula would be changed to:

   q = 1-p;
   temp1 = pow(color1, 1/gamma);
   temp2 = pow(color2, 1/gamma);
   tempR = p * color1 + q * color2;
   result = pow(tempR, gamma);

where gamma would be a value around 2.5.

> That's exactly the sort of thing I was thinking of. Maybe Warp will
> argue that the default should be "perceptual" though, and we need a
> "linear" keyword to revert to the existing behaviour.

... except that he'd even argue that "linear" would be the wrong keyword 
for that purpose.

I'll just let him argue then. I'm not reading his newsgroup postings 
anyway, as it would ultimately result in the two of us getting mad at 
each other. Never put two zealots adhering to contradicting dogmata in 
the same room. Fortunately (for me) I'm not in a position of needing to 
be heard to get my will.


Post a reply to this message

From: Warp
Subject: Re: Gamma of interpolated colors in color maps
Date: 21 Dec 2010 13:14:53
Message: <4d10ee9c@news.povray.org>
scott <sco### [at] scottcom> wrote:
> That's exactly the sort of thing I was thinking of.  Maybe Warp will 
> argue that the default should be "perceptual" though, and we need a 
> "linear" keyword to revert to the existing behaviour.

  The thing is that most people are used to specifying colors as perceived
by the human eye rather than in watts. For example, doubling the values of
the color components is expected to double the brightness of the color
(iow. eg. 'rgb 0.8' is assumed to be twice as bright as 'rgb 0.4').

  To elaborate, if I have understood correctly, POV-Ray 3.7 has been
changed so that regular color specifications express the power of
luminous radiation (which is called radiant flux, and in physics is
measured in watts) rather than the perceived luminosity as seen by
the human eye. The relation between these two is not linear (but closer
to logarithmic). This means that eg. doubling the radiant flux (ie.
doubling the "wattage") does not correspond to doubling the perceived
luminosity of the color, as seen by the human eye.

  This might correspond more closely to reality when calculating
illumination. For example surfaces reflect a portion of the light they
receive, and this portion is relative to the radiant flux, not to the
perceived brightness. (In other words, if the surface properties and
angle with respect to incoming light is so that it reflects exactly
half of the light it receives, this half is measures in watts, not in
what the human eye perceives as "half bright".) I suppose that at least
in theory this ought to give a more realistic end result for surface
illumination, ie. a result which corresponds more to real life.

  As said, the only problem is that people are accustomed to specifying
colors and color gradients in perceived luminosity, not in watts. This
can and will cause confusion.

  In POV-Ray 3.6 color specifications correspond directly to pixel
component values, and this happens to be close to linear with respect
to the perceived luminosity, and hence 'rgb 0.8' looks about twice as
bright as 'rgb 0.4', and this is what people are accustomed to. Likewise
linear color gradients in POV-Ray 3.6 (which, as said, simply map
directly to pixel values) happen to be close to to perceived linear
brightness, which is also what people are accustomed to.

  "You don't specify perceived brightness anymore, but absolute brightness"
is a rather radical change, and many people will get confused by it,
especially since in most systems (at least those with a gamma of 2.2)
raw pixel values map almost linearly to perceived brightness.

-- 
                                                          - Warp


Post a reply to this message

From: scott
Subject: Re: Gamma of interpolated colors in color maps
Date: 22 Dec 2010 08:54:12
Message: <4d120304$1@news.povray.org>
>    "You don't specify perceived brightness anymore, but absolute brightness"
> is a rather radical change, and many people will get confused by it,
> especially since in most systems (at least those with a gamma of 2.2)
> raw pixel values map almost linearly to perceived brightness.

Just tell them to use the srgb keyword, as it uses the same colour space 
as the web, MS Office, Paint etc.  rgb should be reserved for use only 
when you need to specify the absolute physical brightness.  I can fully 
imagine that later on srgb will become more commonly used and then we'll 
have questions like "what is the rgb keyword for?".


Post a reply to this message

From: Jaap Frank
Subject: Re: Gamma of interpolated colors in color maps
Date: 22 Dec 2010 13:34:07
Message: <4d12449f@news.povray.org>
>"Warp"  schreef in bericht news:4d10761e@news.povray.org... 
>
>The problem with the current pov3.7 is that such a gradient is not
>looking even close to linear, even with monitors where 'rgb 0.5' is
>truly 50% bright, as compared to a test pattern. I don't know why this
>is so, but it just isn't.

I'm curious Warp. I've shrunk the file you made yourself for the thread
'More Gamma Again' in p.b.i to a very small one. Now you don't have
to see through your eyelids but can simple look at it. For me the 3.6 
side is lineair and the 3.7 side absolutely not. How looks this stamp 
on your monitor now?
Don't say it's the thrinking technic, because for me it's absolutely 
the same for the big and the small one.
If you have windows 7, than put the file on your monitor and you
automatically get a stamp as icon.

Can everybody react on this with which side is for them the right
one, because I'm under the impression that more people see 
what I see.

Thanks in advance,

Jaap Frank


Post a reply to this message


Attachments:
Download 'gradient_10_pov.png' (4 KB) Download 'gradient_pov_mini.png' (1 KB)

Preview of image 'gradient_10_pov.png'
gradient_10_pov.png

Preview of image 'gradient_pov_mini.png'
gradient_pov_mini.png


 

From: Jaap Frank
Subject: Re: Gamma of interpolated colors in color maps
Date: 22 Dec 2010 13:39:21
Message: <4d1245d9$1@news.povray.org>
>"Jaap Frank"  schreef in bericht news:4d12449f@news.povray.org... 
>
>If you have windows 7, than put the file on your monitor and you
>automatically get a stamp as icon.

This should have been:

If you have windows 7, than put the file on your DESKTOP and you
automatically get a stamp as icon.
Sorry,

Jaap Frank


Post a reply to this message

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

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