POV-Ray : Newsgroups : povray.general : strange problem with srgb color in light_source : Re: strange problem with srgb color in light_source Server Time
29 Mar 2024 02:15:10 EDT (-0400)
  Re: strange problem with srgb color in light_source  
From: Subclick
Date: 7 Apr 2021 17:20:01
Message: <87a6q9zta7.fsf@sp.am>
"Kenneth" <kdw### [at] gmailcom> writes:

> I run my old version of Photoshop in it's gamma 2.2 'working gamma space', as
> most people do (unless newer versions run in 'srgb'-- but that's a minor
> quibble.)
>
> When I want to specify "50% gray" there, I use r-g-b values of <128,128,128> in
> the 0-255 range. And the HSB indicators there give B or 'brightness' as 50.  I
> have always understood the  visual result there (under 2.2 gamma) to be the
> *perceptual* version of 50% gray-- what we would 'expect' to see as pleasing
> half black/half white.
>
> But Photoshop allows me to change the working gamma space to 1.0-- in which case
> the 50% gray now looks too bright 'perceptually.' However, the <128,128,128>
> values there have NOT changed, nor has the B of 50. In effect, all I have done
> is to change the working gamma space that the 50%-gray appears in-- the values
> themselves are 'what they are.' At least in Photoshop.

The numeric values of the color components are “what they are”; the
light intensities on the screen, and hence the actual color you see,
have changed, because you have changed the relationship between them and
the numeric values of the color components.

> Now, in  POV-ray, working in it's assumed_gamma 1.0 universe, I bring in
> <128,128,128>/255 and use it as simple RGB, at 'ambient 1.0'-- as a raw 'linear'
> color, in other words. (That's what I currently undertstand 'rgb' to
> mean.)

Neither numbers nor light intensities can by themselves be linear or
otherwise; only the relationship between the former and the latter can.

> The visual result is the same as in Photoshop in it's *gamma 1.0
> environment*.

If the numeric values and the relationship between them and light
intensities are the same, the light intensities are the same.

> So it seems logical to me that the initial <128,128,128> values in PS
> are 'linear' values, not sRGB values-- because using them as rgb in
> POV-ray (divided by 255) reproduces the identical visual result in
> BOTH gamma-1.0 environments... the 'linear' environments.

The initial <128, 128, 128> values are just numbers.  By themselves,
they don’t contain any information on whether they’re supposed to be
interpreted as light intensities encoded linearly or in any other
fashion, such as sRGB.  As you said, you can choose different ways to
interpret those values as light intensities—you do it by choosing the
working gamma space.

There’s nothing special about the linear relationship in this regard: if
you choose an arbitrary working gamma space in Photoshop, and use that
gamma value also as POV-Ray’s ‘assumed_gamma’, the visual result will be
the same, too.

> So going into in your IC app, and using the OPTIONS/BACKGROUND feature, I see
> the r-g-b sliders at '0.5' (by default.) I take that to mean "50% gray" in
> whatever sense or gamma environment is meant there...maybe gamma 1.0? So I
> compare the appearance of IC's generated 0.5 gray background with PS's 'gamma
> 1.0' appearance of <128,128,128>, and with POV-ray's   rgb <128,128,128>/255 at
> assumed_gamma 1.0. All three *look* identical to me, in their own
> environments.

Therefore, the relationship between numeric color values and light
intensities meant in that IC app is indeed linear—the assumed
gamma is 1.

> Yet IC reports its own '0.5' gray as being  'sRGB 187'. Not 128, as in
> Photoshop.  A calculation shows that 187/255  is approximately 128/255 to the
> power of 1/2.2. (I'm aware that  2.2 should actually be replaced with the more
> complex 'srgb' math equation.)

Exactly as it should be: the linear color components, in the 0–1 range,
are <0.5, 0.5, 0.5>; the sRGB components are <187, 187, 187>/255.
Now you’re considering one color and two different relationships between
it and the numeric values used to represent it, so those values are
different in each case.

> It's not clear to me yet what the discrepancy is
> as to why Photoshop reports 50% gray as <128,128,128>-- and *if* indeed those
> are supposed to be 'srgb' values rather than 'linear' like I thought--

You’ve already answered that yourself: Photoshop reports as <128, 128,
128> the gray you perceptually describe as 50% only when the chosen
working gamma space is the one that roughly matches your perception of
brightness; i.e., gamma 2.2.  Therefore, if you choose that working
gamma space, <128, 128, 128> are roughly the sRGB (similar to gamma 2.2)
values of the gray you see.  If you choose another working gamma space,
you’ll need numeric values different from <128, 128, 128> to get the
same gray, and those new values won’t be the gray’s sRGB values
any more.

> while IC reports <187,187,187> instead.

That’s a different gray.  Those were the sRGB components of the gray
which is half as bright as white physically (linear relationship), not
perceptually.


Post a reply to this message

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