POV-Ray : Newsgroups : povray.pov4.discussion.general : Builtin color spaces, spectral colors? : Builtin color spaces, spectral colors? Server Time
25 Apr 2024 00:51:03 EDT (-0400)
  Builtin color spaces, spectral colors?  
From: Simon Copar
Date: 20 Mar 2013 21:45:00
Message: <web.514a651414042780f42173100@news.povray.org>
I'm just wondering: is there a plan to extend SDL to allow more than jst rgb
color spaces?

The color specification syntax is already perfectly designed to allow addition
of different colorspaces. So, instead of using macros from colors.inc, syntax
could be made more user-friendly, like

pigment {
  color hsl <0.5,0.3,1>
}

This is straight-forward, srgb/rgb difference already requires some conversion
anyway. This could be expanded to other color spaces: Yuv, CIE, Lab and so on.

On a similar note, if povray4 goes natively spectral, how will this be handled?
In my mind, I see a block in global_settings that specifies the color mode:
choose rgb or spectral, possibly with a number specifying how many samples to
use, and of course, a mapping function to get back from spectrum to rgb
(nontrivial, there are several different spectral response function models that
try to approximate the human eye, or a display device). In the spectral mode, I
think that colors specified as rgb could be modeled using a default response
function for r,g,b (let's say, the response functions of the eye), but one could
also specify colors as functions of the wavelength: point-wise specified spectra
(which could be specified in a big .inc file). Something like

pigment {
  gradient z
  color_map {
    [0 color rgb <1,0.5,0>] // actually 1*CIE_red+0.5*CIE_green
    [1 color spectral <440:0.1,550:0.4,600:0.6,700:1>] //linear interpolation
between specified wavelengths
  }
}

Is it reasonable to expect something like that?


Post a reply to this message

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