4

Your way of calculating XYZ functions is probably the most efficient way to go about calculating accurate colors from a spectrum. It is standard practice afaik, for examples the books Physically Based Rendering (3rd) and Real-Time Rendering (3rd) both use this method. You can add the colors in RGB space, but only if you convert from sRGB to linear RGB first....


2

Getting sRGB values outside [0, 1] is expected and normal when using spectral rendering. The sRGB gamut only covers a triangle in the middle of the CIE chromaticity space: (diagram from Wikipedia) The big "horseshoe" shape is the set of all physically possible chromaticities (CIE xy coordinates) from any possible spectrum. So your xy coordinates should be ...


1

You can take a 1D Fourier transform of a row of pixels from the image; it will give you the horizontal frequencies present in that row. You could sample one row out of the image, or else average all the rows together to get an overall picture of the horizontal frequencies.


1

Iridesence can be seen in several variations: diffraction as seen in CDs and DVDs (see Stam's SIGGRAPH 1999 paper on this), phase shifting and modulation in multi-layered surfaces as you see in oilspills on water, or structural coloration as you see in butterfly wings. (Also there is the related pearlescence). However, it's not trivial in any way, probably ...


Only top voted, non community-wiki answers of a minimum length are eligible