POV-Ray : Newsgroups : povray.advanced-users : CIE xyY color space Server Time
9 Oct 2026 07:27:08 EDT (-0400)
  CIE xyY color space (Message 1 to 18 of 18)  
From: Mike Horvath
Subject: CIE xyY color space
Date: 10 Mar 2017 13:19:12
Message: <58c2ee20@news.povray.org>
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


Post a reply to this message

From: Mike Horvath
Subject: Re: CIE xyY color space
Date: 10 Mar 2017 13:21:13
Message: <58c2ee99$1@news.povray.org>
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

Never mind. I just figured out they go from 0 to 1. Doh!


Mike


Post a reply to this message

From: clipka
Subject: Re: CIE xyY color space
Date: 10 Mar 2017 13:48:11
Message: <58c2f4eb@news.povray.org>
Am 10.03.2017 um 19:21 schrieb Mike Horvath:
> 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
> 
> Never mind. I just figured out they go from 0 to 1. Doh!

Yup.

With the additional constraint that x+y<=1.

Y technically ranges from 0 to infinity, with no well-defined scale, and
will often be normalized so that the chosen whitepoint has Y=1 or Y=100[%].


Post a reply to this message

From: Mike Horvath
Subject: Re: CIE xyY color space
Date: 12 Mar 2017 00:04:16
Message: <58c4d6d0$1@news.povray.org>
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


Post a reply to this message

From: Bald Eagle
Subject: Re: CIE xyY color space
Date: 15 Mar 2017 15:10:01
Message: <web.58c9911355b89017c437ac910@news.povray.org>
Mike,

With all of your experience with the various color spaces, do you think one
better lends itself to analyzing color images than the others?

For instance, see what I mean here:
http://news.povray.org/povray.binaries.images/thread/%3Cweb.5792c33271d66b005e7df57c0%40news.povray.org%3E/


Post a reply to this message

From: Mike Horvath
Subject: Re: CIE xyY color space
Date: 15 Mar 2017 19:43:50
Message: <58c9d1b6$1@news.povray.org>
On 3/15/2017 3:08 PM, Bald Eagle wrote:
> Mike,
>
> With all of your experience with the various color spaces, do you think one
> better lends itself to analyzing color images than the others?
>
> For instance, see what I mean here:
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.5792c33271d66b005e7df57c0%40news.povray.org%3E/
>
>
>
>


I'm not sure 100% what you're trying to achieve in that thread. Some 
sort of histogram of colors used in a photo?

Anyway, this shape is a personal favorite:

https://commons.wikimedia.org/wiki/File:HSL_sphere_color_solid.png


Mike


Post a reply to this message

From: clipka
Subject: Re: CIE xyY color space
Date: 16 Mar 2017 04:01:40
Message: <58ca4664$1@news.povray.org>
Am 15.03.2017 um 20:08 schrieb Bald Eagle:
> Mike,
> 
> With all of your experience with the various color spaces, do you think one
> better lends itself to analyzing color images than the others?
> 
> For instance, see what I mean here:
>
http://news.povray.org/povray.binaries.images/thread/%3Cweb.5792c33271d66b005e7df57c0%40news.povray.org%3E/

If by "analyzing" you mean anything that is related to human perception
(as opposed to anything that is related to physics), then a somewhat
perceptually uniform colour space would certainly be advantageous, such
as CIE L*a*b or CIE L*u*v, or the even newer DIN99 series of colour spaces.


Post a reply to this message

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

> If by "analyzing" you mean anything that is related to human perception
> (as opposed to anything that is related to physics), then a somewhat
> perceptually uniform colour space would certainly be advantageous, such
> as CIE L*a*b or CIE L*u*v, or the even newer DIN99 series of colour spaces.

Probably true.
I recall spending much time observing your experiments with color gradients and
gamma.
(I think it would be nice to "remap" a color space from HSV to expand the very
narrow red region, and fix any other perceptually non-uniform characteristics.
Just for fun  ;) )

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.

A pipe-dream feature would be to have the RGB values of an area selected in the
render window (like the current re-render selected area feature) written to an
output file, which could then be used as a prototypical color mapping data set.

The edges of my brain's tentacles suggest that 3D fourier transform of that data
may well highlight the major contributing "3D" RGB vectors better than any
visualized histogram in a color space would.
Or I may just be overcomplicating the task.  ;)

I'm also wondering what algorithms various automatic pallette-generating apps
use (Android / Windows Store apps for interior decorating, selecting paint
colors, etc.)


Post a reply to this message

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

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