POV-Ray : Newsgroups : povray.newusers : Wavelength to RGB converter? Server Time
4 Nov 2024 19:18:38 EST (-0500)
  Wavelength to RGB converter? (Message 1 to 10 of 38)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Kaveh
Subject: Wavelength to RGB converter?
Date: 28 Feb 2003 19:49:37
Message: <1fr4a7h.44sdcb1jqm0yuN%kaveh@delete_this.focalimage.com>
Is there an .inc file that converts a wavelength to the approximate
equivalent RGB components? I am looking for perfect accuracy. An
approximate look-up table will do. 

-- 
Kaveh


Post a reply to this message

From: Christopher James Huff
Subject: Re: Wavelength to RGB converter?
Date: 28 Feb 2003 20:49:14
Message: <cjameshuff-6A6C5B.20444028022003@netplex.aussie.org>
In article <1fr4a7h.44sdcb1jqm0yuN%kaveh@delete_this.focalimage.com>,
 kav### [at] delete_thisfocalimagecom (Kaveh) wrote:

> Is there an .inc file that converts a wavelength to the approximate
> equivalent RGB components? I am looking for perfect accuracy. An
> approximate look-up table will do.

You contradict yourself. Perfection or approximation, pick one...only an 
approximation is possible though.
You want to find the RGB values that would mimic monochrome light of a 
specific wavelength? There are no includes that do this that I know of. 
You could find the sensitivity curves of typical human eyes, and work up 
a macro that uses a spline generated from these curves.

Some sites which might be useful:
http://www.adobe.com/support/techguides/color/colortheory/vision.html
http://www.yorku.ca/eye/specsens.htm

BTW, what do you want this for? I can't think of many uses for this, 
except as a part of a system for converting spectral data to RGB.

-- 
Christopher James Huff <cja### [at] earthlinknet>
http://home.earthlink.net/~cjameshuff/
POV-Ray TAG: chr### [at] tagpovrayorg
http://tag.povray.org/


Post a reply to this message

From: Ive
Subject: Re: Wavelength to RGB converter?
Date: 28 Feb 2003 21:44:40
Message: <3e601e98$1@news.povray.org>
> specific wavelength? There are no includes that do this that I know of.
> You could find the sensitivity curves of typical human eyes, and work up
> a macro that uses a spline generated from these curves.
>

For the records.
Jaime Vives Piqueres' lightsys (a set of include files to generate realistic lighting)
is able to do this.

http://www.ignorancia.org/t_lightsys.php

-Ive


Post a reply to this message

From: Kaveh
Subject: Re: Wavelength to RGB converter?
Date: 1 Mar 2003 06:01:42
Message: <1fr524g.eym5jvaqbxdsN%kaveh@delete_this.focalimage.com>
Christopher James Huff <cja### [at] earthlinknet> wrote:

> In article <1fr4a7h.44sdcb1jqm0yuN%kaveh@delete_this.focalimage.com>,
>  kav### [at] delete_thisfocalimagecom (Kaveh) wrote:
> 
> > Is there an .inc file that converts a wavelength to the approximate
> > equivalent RGB components? I am looking for perfect accuracy. An
> > approximate look-up table will do.
> 
> You contradict yourself. Perfection or approximation, pick one...only an
> approximation is possible though.

Oops. A bad typo to make. I meant to say "I am *not* looking for perfect
accuracy"!! 

[...]

> 
> BTW, what do you want this for? I can't think of many uses for this, 
> except as a part of a system for converting spectral data to RGB.

I am writing a program to mimic the reconstruction of holographic
images. When a hologram (of a point object, say) is made with one
wavelength, and replayed with another wavelenth, the image is displaced,
and distorted, as a function of the wavelength. (This is because of the
dispersion of light, which in diffractive optics is some 40 time greater
than in refractive optics.) 

I want the old image to be shown in the original wavelength colour, and
the new one in the colour of the new wavelength, as closely as
practical. So for each wavelength there would be a value in a lookup
table for the RGB to use.

When we use a large number of wavelengths, as in white light, I want to
see a more or less continuous spectrum of light, with each spectral
image in its correct position.

Thanks for your help. I will check the sites you mentioned.

-- 
Kaveh


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Wavelength to RGB converter?
Date: 1 Mar 2003 07:53:25
Message: <20030301135324.6a16c4c3.jaimevives@ignorancia.org>
On Sat, 1 Mar 2003 11:01:42 +0000
kav### [at] delete_thisfocalimagecom (Kaveh) wrote:

> I want the old image to be shown in the original wavelength colour,
> and the new one in the colour of the new wavelength, as closely as
> practical. So for each wavelength there would be a value in a lookup
> table for the RGB to use.
> 
> When we use a large number of wavelengths, as in white light, I want
> to see a more or less continuous spectrum of light, with each spectral
> image in its correct position.

  Check CIE.inc conained on my lightsys package (Ive posted the URL on
a previous reply). It has some macros to convert wavelength to several
RGB color systems, based on the CIE XYZ color space tranformations. Ive
done all this job alone, as a replacement for my lightsys color macros,
which used a poor aproximation at first based on Dan Bruton algorithm.

  Using CIE.inc, you sould be done with the Wavelength(W) macro, where
W is the wavelength in nm.( the default color system is sRGB). Have fun!

-- 
Jaime Vives Piqueres
		
La Persistencia de la Ignorancia
http://www.ignorancia.org


Post a reply to this message

From: Kaveh
Subject: Re: Wavelength to RGB converter?
Date: 1 Mar 2003 10:49:26
Message: <1fr5fsj.1beeuyb1xw7s8mN%kaveh@delete_this.focalimage.com>
Jaime Vives Piqueres <jai### [at] ignoranciaorg> wrote:

> On Sat, 1 Mar 2003 11:01:42 +0000
> kav### [at] delete_thisfocalimagecom (Kaveh) wrote:
> 
> > I want the old image to be shown in the original wavelength colour,
> > and the new one in the colour of the new wavelength, as closely as
> > practical. So for each wavelength there would be a value in a lookup
> > table for the RGB to use.
> > 
> > When we use a large number of wavelengths, as in white light, I want
> > to see a more or less continuous spectrum of light, with each spectral
> > image in its correct position.
> 
>   Check CIE.inc conained on my lightsys package (Ive posted the URL on
> a previous reply). It has some macros to convert wavelength to several
> RGB color systems, based on the CIE XYZ color space tranformations. Ive
> done all this job alone, as a replacement for my lightsys color macros,
> which used a poor aproximation at first based on Dan Bruton algorithm.
> 
>   Using CIE.inc, you sould be done with the Wavelength(W) macro, where
> W is the wavelength in nm.( the default color system is sRGB). Have fun!

I just downloaded all those and saw that. It is *exactly* what I need.
And congratulations for doing so much work on color. It's not an easy
field!

I am probably doing something silly here, but when I run your test file:

===============
    #include "lightsys.inc"            // main include
    #include "lightsys_CIE-sRGB"       // saved rgb values for common
colors
    
    // global variables
    #declare BRIGTHNESS=1.25;              // a little "overexposed"
    #declare WHITE_POINT=Wp_Daylight_Film; // translate white point to
5500K 
    #declare COLOR_FILTER=CC05R;           // 5% CC red filter

    // obtain a light_source
    object{
     Light(Cl_Cool_White_Fluor,Lm_Fluorescent_15w,9*x,9*z,4,4,0)
    }
===============

I get an error:

===============
Parsing...File: rgbtest.pov  Line: 1

    #include "lightsys_CIE-sRGB"

    #declare WHITE_POINT=Wp_Daylight_F     // a little "overexposed"

ilm <----ERROR

Parse Error: Cannot assign uninitialized identifier.
===============

It complains that Wp_Daylight_Film is not initialized, but it is, in
lightsys_CIE-sRGB. Can you see what I am doing wrong?

-- 
Kaveh


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Wavelength to RGB converter?
Date: 1 Mar 2003 11:22:41
Message: <20030301172241.0b6e3890.jaimevives@ignorancia.org>
On Sat, 1 Mar 2003 15:49:27 +0000
kav### [at] delete_thisfocalimagecom (Kaveh) wrote:

> I just downloaded all those and saw that. It is *exactly* what I need.

  Nice! And don't forget to show us the results!

> And congratulations for doing so much work on color. It's not an easy
> field!

  Yeah... but here all the merit goes to Ive, who done the hard work
researching and implementing color transformations. I'm still learning
and trying to understand it all, but I know already enough to see that
there are plenty of potential applications for CIE.inc. 

> I am probably doing something silly here, but when I run your test
> file:

  Oh! No! You used the non-tested example on the readme! :)

> I get an error:
> 
> ===============
> Parsing...File: rgbtest.pov  Line: 1

  Hmmmm... line 1 ????

> It complains that Wp_Daylight_Film is not initialized, but it is, in
> lightsys_CIE-sRGB. Can you see what I am doing wrong?

  Sorry, I've not tested this example, and it is not functional as it
does not contains any scenery. Better try any of the demo files
included, for example demo_basic.pov.

-- 
Jaime Vives Piqueres
		
La Persistencia de la Ignorancia
http://www.ignorancia.org


Post a reply to this message

From: William F  Pokorny
Subject: Re: Wavelength to RGB converter?
Date: 1 Mar 2003 13:40:50
Message: <3E60FEB3.EB7D364B@attglobal.net>
Jaime Vives Piqueres wrote:
> 
> On Sat, 1 Mar 2003 15:49:27 +0000
> kav### [at] delete_thisfocalimagecom (Kaveh) wrote:
> 

Jamie, 
I want to interject that the page http://www.ignorancia.org/t_lightsys.php shows
up blank for me when I access it using netscape from a PC or from an unix box.
However, I can view the page source from within netscape and Internet Explorer
works fine. I am not sure what is amiss. Does anyone else get the blank page
with netscape? Oh, and pages on your site other than the techniques page display
as expected.   
Bill P.


Post a reply to this message

From: gonzo
Subject: Re: Wavelength to RGB converter?
Date: 1 Mar 2003 14:45:57
Message: <3e610df5$1@news.povray.org>
William F. Pokorny <pok### [at] attglobalnet> wrote in message
news:3E60FEB3.EB7D364B@attglobal.net...
>
> Jamie,
> I want to interject that the page http://www.ignorancia.org/t_lightsys.php
shows
> up blank for me when I access it using netscape from a PC or from an unix
box.
> However, I can view the page source from within netscape and Internet
Explorer
> works fine. I am not sure what is amiss. Does anyone else get the blank
page
> with netscape?

Yes, I had the same thing. Only that page, all other pages work fine.  I
could view source to get the link to download.

RG


Post a reply to this message

From: Jaime Vives Piqueres
Subject: Re: Wavelength to RGB converter?
Date: 1 Mar 2003 15:21:07
Message: <20030301212106.1bf42fe3.jaimevives@ignorancia.org>
On Sat, 01 Mar 2003 13:40:51 -0500
"William F. Pokorny" <pok### [at] attglobalnet> wrote:

  Oops! Sorry, a table was not properly closed.... thanks for pointing
it out. Next time I will check also with netscape for any major change.

-- 
Jaime Vives Piqueres
		
La Persistencia de la Ignorancia
http://www.ignorancia.org


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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