POV-Ray : Newsgroups : povray.advanced-users : L*C*h(uv) color solid : Re: L*C*h(uv) color solid Server Time
2 May 2024 08:58:28 EDT (-0400)
  Re: L*C*h(uv) color solid  
From: Christian Froeschlin
Date: 18 Nov 2016 08:37:57
Message: <582f0435$1@news.povray.org>
On 18.11.2016 8:22, Mike Horvath wrote:

> I would like to create a three-dimensional representation of the
> L*C*h(uv) color space in the form of a cylinder.

I assume you already have a formula to convert the color space to sRGB.

What you need is a function-based pigment that yields appropriate
RGB values based on x,y,z coordinates inside the cylinder. There is
no direct way to define a user-defined color function (unless you
already have a pigment) but you can do it like this:

1. Define three separate float functions yielding R, G, B separately

f_R(x,y,z)
f_B(x,y,z)
f_G(x,y,z)

2. Create red / green / blue pigments from that using function
pattern and red / green / blue color_maps

3. Join the 3 pigments into RGB pigment via "average" pattern.

Regarding implementation of f_R(x,y,z) I was going to suggest
you derive radial distance and angle around y from x-z pair via
(pythagoras / atan2) but as far as I understand LCh(uv) is already
a cylindrical version of Luv so these transformations are
technically part of the color space conversion itself.

Still it would probably be useful to implement the coordinate
transformation (including appropriate scaling of intervals) in
a separate set of functions f_L, f_u, f_v since you need them
multiple times in the definition of f_R, f_G, f_B.


Post a reply to this message

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