POV-Ray : Newsgroups : povray.general : What clipka actually said about the srgb keywords Server Time
23 Jun 2024 03:47:25 EDT (-0400)
  What clipka actually said about the srgb keywords (Message 1 to 3 of 3)  
From: Cousin Ricky
Subject: What clipka actually said about the srgb keywords
Date: 14 Aug 2023 14:09:13
Message: <64da6dc9$1@news.povray.org>
I just ran across these comments while looking for something else.
Clipka's initial warning was:
  https://news.povray.org/58625d1f%241%40news.povray.org

His correction to the initial warning:
  https://news.povray.org/5862ea88%241%40news.povray.org

To summarize the two posts:

  ... you need to use

      #declare C = srgb <R,G,B>;
      colour C * Brightness

  rather than

      colour srgb <R,G,B>*Brightness

  because the latter would be interpreted as

      colour srgb (<R,G,B>*Brightness)

My response was:
  The moral seems to be get all of your srgb declarations out of the way
  as early as possible--including before you do any math on such colors.

This is in agreement with what Ive and I said in Kenneth's thread two
years ago, less the note about byte triplets.  I can see how confusion
could arise about dividing by 255, but that situation is different.


Post a reply to this message

From: Samuel B 
Subject: Re: What clipka actually said about the srgb keywords
Date: 14 Aug 2023 19:00:00
Message: <web.64dab1d02197683df8c47d526e741498@news.povray.org>
Cousin Ricky <ric### [at] yahoocom> wrote:
> I just ran across these comments while looking for something else.
> Clipka's initial warning was:
>   https://news.povray.org/58625d1f%241%40news.povray.org
>
> His correction to the initial warning:
>   https://news.povray.org/5862ea88%241%40news.povray.org
>
> To summarize the two posts:
>
>   ... you need to use
>
>       #declare C = srgb <R,G,B>;
>       colour C * Brightness
>
>   rather than
>
>       colour srgb <R,G,B>*Brightness
>
>   because the latter would be interpreted as
>
>       colour srgb (<R,G,B>*Brightness)
> [...]

This clears up an issue I had a few days ago: multiplying an srgb value at
declaration gave me much different results than when multiplying it within a
sky_sphere's color map. Very good to know, thanks!

Sam


Post a reply to this message

From: Thomas de Groot
Subject: Re: What clipka actually said about the srgb keywords
Date: 15 Aug 2023 02:20:13
Message: <64db191d$1@news.povray.org>
Op 14/08/2023 om 20:09 schreef Cousin Ricky:
> I just ran across these comments while looking for something else.
> Clipka's initial warning was:
>    https://news.povray.org/58625d1f%241%40news.povray.org
> 
> His correction to the initial warning:
>    https://news.povray.org/5862ea88%241%40news.povray.org
> 
> To summarize the two posts:
> 
>    ... you need to use
> 
>        #declare C = srgb <R,G,B>;
>        colour C * Brightness
> 
>    rather than
> 
>        colour srgb <R,G,B>*Brightness
> 
>    because the latter would be interpreted as
> 
>        colour srgb (<R,G,B>*Brightness)
> 
> My response was:
>    The moral seems to be get all of your srgb declarations out of the way
>    as early as possible--including before you do any math on such colors.
> 
> This is in agreement with what Ive and I said in Kenneth's thread two
> years ago, less the note about byte triplets.  I can see how confusion
> could arise about dividing by 255, but that situation is different.

Thank you indeed! I have had a lot of confusion about this issue in the 
(recent) past as you may remember :-] . This seems to clearly summarize 
the problem.

-- 
Thomas


Post a reply to this message

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