POV-Ray : Newsgroups : povray.advanced-users : CIE xyY color space Server Time
28 Mar 2024 07:28:24 EDT (-0400)
  CIE xyY color space (Message 9 to 18 of 18)  
<<< Previous 8 Messages Goto Initial 10 Messages
From: clipka
Subject: Re: CIE xyY color space
Date: 16 Mar 2017 09:40:11
Message: <58ca95bb@news.povray.org>
Am 16.03.2017 um 12:57 schrieb Bald Eagle:

> As for my original intent, my "analysis" is an effort to rapidly get a more
> pleasing result from sampled colors for use in color maps when trying to
> procedurally texture things.  You may recall my lamentations about trying to
> replicate the beautiful honey-yellow coloration of a wood floor, since my color
> maps only produced pale, washed-out results that weren't anywhere near what I
> wanted.

To be honest, no, I don't remember those lamentations.
Sounds pretty much like a gamma issue to me.


Post a reply to this message

From: Bald Eagle
Subject: Re: CIE xyY color space
Date: 16 Mar 2017 10:10:01
Message: <web.58ca9bfe55b89017c437ac910@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

> To be honest, no, I don't remember those lamentations.
> Sounds pretty much like a gamma issue to me.

It was Oct 2014, so not surprising.

http://news.povray.org/web.5435881bcbb3d8155e7df57c0%40news.povray.org


Post a reply to this message

From: clipka
Subject: Re: CIE xyY color space
Date: 16 Mar 2017 10:45:18
Message: <58caa4fe$1@news.povray.org>
Am 16.03.2017 um 15:06 schrieb Bald Eagle:
> clipka <ano### [at] anonymousorg> wrote:
> 
>> To be honest, no, I don't remember those lamentations.
>> Sounds pretty much like a gamma issue to me.
> 
> It was Oct 2014, so not surprising.
> 
> http://news.povray.org/web.5435881bcbb3d8155e7df57c0%40news.povray.org

`[0.4 rgb <184/255, 115/255, 48/255> * Tone]`

Yeah. Any expression starting with "rgb" and containing integer numbers
divided by 255 screams "gamma issue!" at the top of its lungs.

Integer numbers divided by 255 are a sign that the colour were
originally encoded as a byte triplet, most likely raw image values, e.g.
as picked from an image using external tool.

Raw image values typically use non-linear colour values, the best bet
being sRGB.

To specify sRGB colours, you need to use the `srgb` keyword instead of
`rgb`, otherwise you get the colour's gamma wrong.

Unless your scene uses `assumed_gamma srgb` (or an approximate value,
such as `assumed_gamma 2.2`), in which case your entire image suffers
from gamma issues.


(It should be noted that `srgb <184/255, 115/255, 48/255> * Tone`
doesn't give you exactly what you are asking for. Theoretically it
should be `(srgb <184/255, 115/255, 48/255>) * Tone`, but that's
currently not allowed by the parser.)


Post a reply to this message

From: Mike Horvath
Subject: Re: CIE xyY color space
Date: 16 Mar 2017 11:47:03
Message: <58cab377$1@news.povray.org>
On 3/12/2017 12:04 AM, Mike Horvath wrote:
> On 3/10/2017 1:19 PM, Mike Horvath wrote:
>> What value ranges are appropriate for this color space? I'm guessing Y
>> (uppercase) ranges from 0 to 100. But what about x and y? Thanks.
>>
>>
>> Mike
>
>
> I tried rendering something in this color space. I've tried all the
> methods suggested so far, but am still getting "disappearing" areas of
> the shape. See the "Holes in isosurface 3" thread in p.t.s-f.
>
>
> Mike


I was able to get it to work. Render times were much longer than 
previous scenes in this series, however. At 2048x2048 pixels, it took 6 
hours to get to 80%, and an extra 24 hours to get from 80% to 100%.


Mike


Post a reply to this message

From: Bald Eagle
Subject: Re: CIE xyY color space
Date: 16 Mar 2017 13:00:01
Message: <web.58cac3b955b89017c437ac910@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:

Excellent information, as always.
Al ways, always, always learning something new and useful here.   :)

> (It should be noted that `srgb <184/255, 115/255, 48/255> * Tone`
> doesn't give you exactly what you are asking for. Theoretically it
> should be `(srgb <184/255, 115/255, 48/255>) * Tone`, but that's
> currently not allowed by the parser.)

So something along the lines of this would be necessary:
(untested, needs handling of optional transmit and filter values)

#macro RGB2SRGB (C_linear)
 // https://en.wikipedia.org/wiki/SRGB
 // C_linear is a standard rgb color vector
 #local RGB = array[3] {C_linear.red, C_linear.green, C_linear.blue};
 #local SRGB = array[3];
 #local _a = 0.055;
 #local _Threshold = 0.0031308;
 #local _Gamma = 2.4;
 #for (Component, 0, 2)
  #if (RGB[Component] <= _Threshold)
   #local SRGB[Component] = 12.92 * RGB[Component];
  #else
   #local SRGB[Component] = ((1 + _a) * pow (RGB[Component], 1/_Gamma)) - _a;
  #end // end if
 #end // end for Component
 #local C_srgb = <SRGB[0], SRGB[1], SRGB[2]>

 C_srgb

#end // end macro RGB2SRGB


Post a reply to this message

From: Mike Horvath
Subject: Re: CIE xyY color space
Date: 16 Mar 2017 14:08:31
Message: <58cad49f$1@news.povray.org>
On 3/16/2017 12:56 PM, Bald Eagle wrote:
> clipka <ano### [at] anonymousorg> wrote:
>
> Excellent information, as always.
> Al ways, always, always learning something new and useful here.   :)
>
>> (It should be noted that `srgb <184/255, 115/255, 48/255> * Tone`
>> doesn't give you exactly what you are asking for. Theoretically it
>> should be `(srgb <184/255, 115/255, 48/255>) * Tone`, but that's
>> currently not allowed by the parser.)
>
> So something along the lines of this would be necessary:
> (untested, needs handling of optional transmit and filter values)
>
> #macro RGB2SRGB (C_linear)
>  // https://en.wikipedia.org/wiki/SRGB
>  // C_linear is a standard rgb color vector
>  #local RGB = array[3] {C_linear.red, C_linear.green, C_linear.blue};
>  #local SRGB = array[3];
>  #local _a = 0.055;
>  #local _Threshold = 0.0031308;
>  #local _Gamma = 2.4;
>  #for (Component, 0, 2)
>   #if (RGB[Component] <= _Threshold)
>    #local SRGB[Component] = 12.92 * RGB[Component];
>   #else
>    #local SRGB[Component] = ((1 + _a) * pow (RGB[Component], 1/_Gamma)) - _a;
>   #end // end if
>  #end // end for Component
>  #local C_srgb = <SRGB[0], SRGB[1], SRGB[2]>
>
>  C_srgb
>
> #end // end macro RGB2SRGB
>
>
>

Are you trying to come up with a way to interpolate between different 
sRGB values? I think clipla said sRGB space is nonlinear.


Mike


Post a reply to this message

From: Bald Eagle
Subject: Re: CIE xyY color space
Date: 16 Mar 2017 14:55:00
Message: <web.58cade7855b89017c437ac910@news.povray.org>
Mike Horvath <mik### [at] gmailcom> wrote:

> Are you trying to come up with a way to interpolate between different
> sRGB values?

Nope.  Convert from RGB to srbg

> I think clipla said sRGB space is nonlinear.

Yup.  That's why there's the exponential term.


Post a reply to this message

From: clipka
Subject: Re: CIE xyY color space
Date: 16 Mar 2017 20:08:55
Message: <58cb2917$1@news.povray.org>
Am 16.03.2017 um 17:56 schrieb Bald Eagle:
> clipka <ano### [at] anonymousorg> wrote:
> 
> Excellent information, as always.
> Al ways, always, always learning something new and useful here.   :)
> 
>> (It should be noted that `srgb <184/255, 115/255, 48/255> * Tone`
>> doesn't give you exactly what you are asking for. Theoretically it
>> should be `(srgb <184/255, 115/255, 48/255>) * Tone`, but that's
>> currently not allowed by the parser.)
> 
> So something along the lines of this would be necessary:
> (untested, needs handling of optional transmit and filter values)
> 
> #macro RGB2SRGB (C_linear)
...

No, what would be necessary is just the opposite: A mechanism to convert
from sRGB to linear. Because picked colours tend to be in sRGB, and what
POV-Ray needs deep down in its heart is linear.

Which is precisely what the `srgb` keyword was designed to do (presuming
you're using `assumed_gamma 1.0` like you should).

The only drawback is that you can't put `srgb` in brackets to multiply
that expression (which would be a linear colour) with a `Tone` factor.
And if you omit the bracket you get a multiplication in sRGB space
(effectively `srgb (<...>*Tone)`), which isn't exactly what you need.


Post a reply to this message

From: Bald Eagle
Subject: Re: CIE xyY color space
Date: 17 Mar 2017 15:20:00
Message: <web.58cc35cc55b89017c437ac910@news.povray.org>
Have you considered doing an overlay or an animated fade-in/fade-out of all the
color spaces you've rendered?


Post a reply to this message

From: Mike Horvath
Subject: Re: CIE xyY color space
Date: 17 Mar 2017 16:38:24
Message: <58cc4940$1@news.povray.org>
3/17/2017 3:15 PM, Bald Eagle wrote:
> Have you considered doing an overlay or an animated fade-in/fade-out of all the
> color spaces you've rendered?
>
>
>
>
>
>


I was thinking of showing the sRGB gamut and visible gamut next to each 
other, or overlaid. Need to finish working out how to do the visible 
gamut, first.


Mike


Post a reply to this message

<<< Previous 8 Messages Goto Initial 10 Messages

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