comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » dominant wavelength from an XYZ colour stimulus
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
dominant wavelength from an XYZ colour stimulus [message #93400] Mon, 04 July 2016 16:32 Go to next message
mat.g.allan is currently offline  mat.g.allan
Messages: 2
Registered: June 2016
Junior Member
I want to calculate the dominant wavelength from an XYZ colour stimulus.

There is a web page which does this:

http://www.brucelindbloom.com/index.html?Equations.html

Does anyone have any code which would do this?

Thanks in advance,

Mat
Re: dominant wavelength from an XYZ colour stimulus [message #93401 is a reply to message #93400] Mon, 04 July 2016 19:38 Go to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
On Monday, 4 July 2016 16:32:30 UTC-7, mat.g...@gmail.com wrote:
> I want to calculate the dominant wavelength from an XYZ colour stimulus.
>
> There is a web page which does this:
>
> http://www.brucelindbloom.com/index.html?Equations.html
>
> Does anyone have any code which would do this?
>
> Thanks in advance,
>
> Mat

Hi Mat,

Using Google Chrome, I viewed this page (it's tricky to determine this page's address!):
http://www.brucelindbloom.com/ColorCalculator.html

… and then "View Frame Source" (right-click on the page provided that) showed me the HTML. In there was a link to the JavaScript code at:
http://www.brucelindbloom.com/javascript/ColorConv.js

… where a search for "dominant" gives you two functions that total a few dozen lines that might not be too hard to convert to IDL. (you'll need the lookup arrays, too: CIE1931StdObs_x, CIE1931StdObs_y, CIE1931StdObs_z)

Does that help?

(There's a few formulas in this paper from 25 years ago, but they only work in the expected range of colours of red wine!: https://www.researchgate.net/publication/222642170_Proposal_ of_a_novel_formula_to_calculate_dominant_wavelength_for_colo r_of_red_wines )

(Or, if you prefer tracing through Excel spreadsheets, the XYZtoDom item on this page might do: http://colour4free.org/FrameSpreadsheet.htm )

Cheers,
-Dick

Dick Jackson Software Consulting Inc.
Victoria, BC, Canada --- http://www.d-jackson.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: NCDF_VARGET and Insufficient number of indices in OFFSET array
Next Topic: secondary Y axis

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 07:23:58 PDT 2025

Total time taken to generate the page: 0.00657 seconds