POV-Ray : Newsgroups : povray.advanced-users : rgb vs srgb Server Time
29 Jun 2024 01:53:45 EDT (-0400)
  rgb vs srgb (Message 29 to 38 of 48)  
<<< Previous 10 Messages Goto Latest 10 Messages Next 10 Messages >>>
From: Thomas de Groot
Subject: Re: rgb vs srgb
Date: 12 Sep 2011 03:08:17
Message: <4e6dafe1$1@news.povray.org>
On 11-9-2011 13:15, Jaime Vives Piqueres wrote:
> background{rgb <213,127,79>/255}

I think that is where my setup is *wrong* (and I apologize) because I 
use a colored object within a white sphere with finish {emission 1} (no 
light source). I understand now from the explanations by Warp and Ive, 
that the sphere's color influences the object's color. Obvious, but I am 
not always thinking straight ;-)

Remains my question: when to use the term 'srgb' in POV-Ray code?

Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: rgb vs srgb
Date: 12 Sep 2011 03:10:57
Message: <4e6db081$1@news.povray.org>
On 11-9-2011 23:44, Alain wrote:
>
> You can use: pigment{srgb<213, 127, 79>/255}

Yes, but that gives a totally different color. As I asked elsewhere here 
in answer to Jaime: I am unsure when you need to use the terms 'rgb' 
(which seems to be almost always) or the term 'srgb'in POV-Ray code.

Thomas


Post a reply to this message

From: Thomas de Groot
Subject: Re: rgb vs srgb
Date: 12 Sep 2011 03:23:54
Message: <4e6db38a$1@news.povray.org>
On 11-9-2011 15:37, Ive wrote:

> As I've already have stated: when you wish to feed POV-Ray with sRGB
> values then use srgb <whatever color> and POV-Ray will de-gamma-correct
> it for you.
> I for one do *never* use (and I do not think) in 8bit gamma-corrected
> values, I'm a human and I do not see any reason to imagine colors in a
> way that was practical for computers in the 90ies of the last century.
>
> And, more important, I like to mix colors (like e.g. rgb Pink*0.9 +
> Skyblue*0.1) and this works only (as I do expect it to work) when colors
> are linear defined otherwise the result of this kind of calculation is
> already mathematical wrong - and looks wrong.

Aha! This answers my puzzle! So, what you are saying is that it is a 
matter of (personal) choice: use the 'rgb' term in the POV-Ray code and 
all is well for most if not all cases, and if one wants (for whatever 
reason) to de-gamma the colors, use 'srgb' and adapt in consequence. 
Very well! This makes my life much simpler ;-)

Thomas


Post a reply to this message

From: Ive
Subject: Re: rgb vs srgb
Date: 12 Sep 2011 04:28:44
Message: <4e6dc2bc@news.povray.org>
Am 12.09.2011 09:10, schrieb Thomas de Groot:
> On 11-9-2011 23:44, Alain wrote:
>>
>> You can use: pigment{srgb<213, 127, 79>/255}
>
> Yes, but that gives a totally different color. As I asked elsewhere here
> in answer to Jaime: I am unsure when you need to use the terms 'rgb'
> (which seems to be almost always) or the term 'srgb'in POV-Ray code.
>

<sigh> you *use* 'srgb' when the color value you specify *is* in sRGB 
color space. E.g. when taken from some color picker, translated from 
HTML colors or you simply prefer to "think" of colors as sRGB colors.

And (as it was not yet mentioned within this thread), changing the gamma 
(using gamma correction for brightness adjustment on a per color or 
whole scene basis) or using 'wrong' gamma (rgb versus srgb) does NOT 
ONLY change the brightness, it also changes the hue.

And (more or less unrelated and not meant do add more confusion) 
personally I do avoid sRGB like hell simply because I'm meanwhile used 
to the AdobeRGB color primaries and one nice thing about POV-Ray is 
because it has no defined inbuilt color space (with some exceptions) 
this works like a charm.
And yes, I own a monitor that is actually calibrated for AdobeRGB and 
yes, this makes a difference. But I do convert my final images to sRGB 
when I show them somewhere in the web.
But when it comes to questions about color spaces things get indeed a 
bit complicated while I still think the gamma issue is trivial and the 
whole reason for confusion there is the huge amount of half-true 
information that is spread around.

-Ive


Post a reply to this message

From: Thomas de Groot
Subject: Re: rgb vs srgb
Date: 12 Sep 2011 04:41:29
Message: <4e6dc5b9$1@news.povray.org>
On 12-9-2011 10:28, Ive wrote:
> And (more or less unrelated and not meant do add more confusion)
> personally I do avoid sRGB like hell simply because I'm meanwhile used
> to the AdobeRGB color primaries and one nice thing about POV-Ray is
> because it has no defined inbuilt color space (with some exceptions)
> this works like a charm.
I can perfectly understand this! I shall do the same! Thanks for all 
your efforts to make me understand :-)

Thomas


Post a reply to this message

From: clipka
Subject: Re: rgb vs srgb
Date: 12 Sep 2011 04:56:07
Message: <4e6dc927$1@news.povray.org>
Am 11.09.2011 15:37, schrieb Ive:

> For anything that tries to be photo-realistic use assumed_gamma 1.
> Feed POV-Ray with *linear* values or when you prefer to do so use sRGB
> values and define colors with the srgb keyword. Since version 3.7 there
> is no more need to care about image maps, they work like a charm.

Always glad to hear that :-)

But I suggest everyone to calm down a bit; There are two approaches to 
working with colors in POV-Ray: (1) Using assumed_gamma 1.0 for 
photorealism, and (2) using assumed_gamma 2.2 (or something alike) for 
more pleasant brightness gradients in color_map and the like. Warp has 
always been a proponent of the latter, while you and I are proponents of 
the former, but at present it must be conceded that both have their 
benefits.

@Thomas: Don't listen to Warp in this matter - it'll only get you all 
the more confused.


Post a reply to this message

From: clipka
Subject: Re: rgb vs srgb
Date: 12 Sep 2011 05:00:30
Message: <4e6dca2e$1@news.povray.org>
Am 12.09.2011 09:23, schrieb Thomas de Groot:
> On 11-9-2011 15:37, Ive wrote:
>
>> As I've already have stated: when you wish to feed POV-Ray with sRGB
>> values then use srgb <whatever color> and POV-Ray will de-gamma-correct
>> it for you.
>> I for one do *never* use (and I do not think) in 8bit gamma-corrected
>> values, I'm a human and I do not see any reason to imagine colors in a
>> way that was practical for computers in the 90ies of the last century.
>>
>> And, more important, I like to mix colors (like e.g. rgb Pink*0.9 +
>> Skyblue*0.1) and this works only (as I do expect it to work) when colors
>> are linear defined otherwise the result of this kind of calculation is
>> already mathematical wrong - and looks wrong.
>
> Aha! This answers my puzzle! So, what you are saying is that it is a
> matter of (personal) choice: use the 'rgb' term in the POV-Ray code and
> all is well for most if not all cases, and if one wants (for whatever
> reason) to de-gamma the colors, use 'srgb' and adapt in consequence.
> Very well! This makes my life much simpler ;-)

Um... actually it's just the other way round: Use "rgb" if your color 
values are already linear - which typically they are NOT if you use 
external color pickers, so in that case use "srgb" (and divide by 255) 
if you take colors from somewhere else, to de-gamma them for POV-Ray.


Post a reply to this message

From: clipka
Subject: Re: rgb vs srgb
Date: 12 Sep 2011 05:04:59
Message: <4e6dcb3b@news.povray.org>
Am 11.09.2011 15:45, schrieb Ive:
> Am 11.09.2011 13:45, schrieb Warp:
>> POV-Ray 3.7 uses (now) a default assumed_gamma of 2.2, which perfectly
>> explains that.
>>
>
> No, it doesn't. At least RC3 does not.

Warp is right: It does.

Unless you specify a #version statement of 3.7 or higher, that is.


Post a reply to this message

From: clipka
Subject: Re: rgb vs srgb
Date: 12 Sep 2011 05:11:48
Message: <4e6dccd4$1@news.povray.org>
Am 11.09.2011 17:50, schrieb Ive:

>> Curiosly, I noticed that
>>
>> #version 3.7;
>> global_settings{assumed_gamma 2.2}
>> background{rgb <213,127,79>/255}
>>
>> gives a slighty different result than just:
>>
>> background{rgb <213,127,79>/255}
>>
>> The last gives back the correct <213,127,79>, while the former gives
>> <214,128,78>. ?!?!?
>>
>
> looks pretty much like the difference between a simple power 2.2 and the
> sRGB gamma response curve (composed of two functions and just 'close' to
> 2.2) to me.

... and that's what it is. To be precise, in the absence of a #version 
statement, RC3 defaults to "assumed_gamma sRGB" rather than 
"assumed_gamma 2.2". (Likewise, File_Gamma defaults to "sRGB" as well.)

The combination

   #version 3.7;
   global_settings{assumed_gamma 2.2}
   background{rgb <213,127,79>/255}

with

   File_Gamma=2.2

should give you <213,127,79> in Gimp as well.


Post a reply to this message

From: clipka
Subject: Re: rgb vs srgb
Date: 12 Sep 2011 05:41:25
Message: <4e6dd3c5$1@news.povray.org>
Am 12.09.2011 09:08, schrieb Thomas de Groot:
> On 11-9-2011 13:15, Jaime Vives Piqueres wrote:
>> background{rgb <213,127,79>/255}
>
> I think that is where my setup is *wrong* (and I apologize) because I
> use a colored object within a white sphere with finish {emission 1} (no
> light source). I understand now from the explanations by Warp and Ive,
> that the sphere's color influences the object's color. Obvious, but I am
> not always thinking straight ;-)
>
> Remains my question: when to use the term 'srgb' in POV-Ray code?

That question has a very, very simple answer in 3.7:

     -----------------------------------------
     Use "srgb" whenever you get a color value
     from an external application(*).
     -----------------------------------------

(*unless you know what you are doing)

And yes, it's really that straightforward; no caveats regarding 
assumed_gamma or #version in this context.


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.