Tool for digitizing an LED spectrum from an image

I tried to leave a review, but it didn’t seem to go through (I saw a red box with Cyrillic text flash before the page reloaded itself). I can send you the text of the review I wrote, if you’d like–you are free to distribute it or upload it on my behalf.

This would be interesting! Once the user uploads a few spectra, maybe let them input weights assigned to each spectrum to compute a weighted average. Lots of folks here like to mix different emitters, and they would find this super useful.

Wow! That was my mistake — I hadn’t worked the algorithm out thoroughly enough. Everything is fixed now, so you can try again. It should work properly this time.

An unexpected problem came up with a black-and-white spectrum of a monochromatic LED from Osram.



I had to teach the algorithm to ignore dashed lines and various other noise. I’ve added a “Monochrome radiation” checkbox. The algorithm identifies the highest peak and then follows the plot downward in both directions, which can sometimes be useful.
Later, however, I taught the algorithm to digitize black-and-white spectrum plots for monochromatic LEDs using the original logic as well.

Great, then I’ll start working on a tool that can simulate the mixing of spectra from different LEDs in different proportions. I’ll probably create a separate topic for it later. This kind of tool would be very useful to me.

1 Thank

some ideas:
I think a some sort of “Bézier curve” or some sort of other vector graphic tool would be better to fit a curve to a curve then just drawing

Also some info i would like to see analyzed if the side has the spectrum.
The Lumens per Watt of optical power.
The color coordinate visualized in the CIE1931 space compared to the black body

the mel-EDI / mel-DER
you can uses this for “inspiration”

Maybe the option to combine multiple spectra proportional. so you can see the result of mixing different LEDs
(and maybe even to option to add Filter) for example 247 LEE Minus Green - LEE Filters

1 Thank

I’ve submitted a review, but looks like it’s not showing just yet.

What you did definitely worked, because I’m unable to reproduce the issue. How did you fix it?

That’s a very sensible suggestion–one can probably assume that most spectra of interest are locally smooth. But I don’t think it makes a difference in practice, because one can zoom in and draw the correction with error less than the thickness of the curve.

Spectral efficacy is indeed a very helpful evaluation to have! Hopefully should be easy to do, since the calculations are already done implicitly during the normalization process of fitting a reference spectrum to the test spectrum.

Also a helpful data point to have–lots of users on BLF/reddit have an Opple device that is incapable of producing a spectrogram, but is able to estimate basic quantities and plot a CIE1931 point.

Nice idea! A more general version is a feature to multiply two recovered spectra. This way, filtering can be performed by (1) digitizing the source/emission spectrum, (2) digitizing the filter’s transmission spectrum, then (3) taking their product.

Unfortunately, the plot in the linked website has an unlabeled horizontal axis, which is the first cardinal sin of data visualization and effectively renders the plot useless: 350, 400, 700, 750 are all somewhat standard conventions for endpoints of the visible spectrum.

1 Thank


The exact data is in the mouses over text in 5nm steps from 405 to 700nm

And i think its generally helpful to visualize the color coordinate.
But it need to be big enough and zoomed in. there is no point in a 200x200 pixel size CIE chart.
and maybe the option to transform it to LUV / cie 1976 less indsuty standard but better uniform perceptual difference per distance.

2 Thanks

Thanks for finding out about the axis scaling! The digitizer couldn’t handle the original plot (with good reason since it doesn’t have a consistent color!), but is ok with it once I passed the plot through an inversion filter and a thresholding filter.

In all seriousness, Lee’s data visualization practice is so horrible that it makes me question the accuracy of the plot itself, even after the plot is made interpretable by scraping essential information from the page inspector. I really hope better documentation of the filters exists somewhere.

1 Thank

https://claude.ai/artifact/Bud88nXQVnm8dC1FH1akpu
I had cloud help me do backup all the spectral data and make visualization.
Got the Data as CVS
spectra_long.h (953.6 KB)

Download and re name the file to a .CVS
After this the file can be imported in the Viewer.
I find it fascinating to see how the colors from the gels wander around in the color space when CCT or CRI changes.

In the next steps, I want to analyze the distance and direction they move in (in a perceptual color space).

And I want to fix the rendering of the CIE diagram… but I’m out of tokens :smiley:

1 Thank

Could you double-check the link? I’m getting a “Page Not Found” error from Claude, and don’t know whether there’s an issue on my end.

1 Thank

I am getting a “sign in to View this page” message. As I have no account, no telling what happens from there.

2 Thanks

I also got that initially, and it turned into an error message after signing in.

2 Thanks

sorry i try to fix it.
i can click Publish but after a view seconds i get “Sharing isn’t available for this artifact, but you can export a copy.”

Gel-Chromaticity-Map.h (169.7 KB)
If you want to try it offline you can rename this to .html

2 Thanks

It’s fascinating how bad of a spectrum can still be “CRI >80”

3 Thanks

Thanks–I am now able to open this. Where did Claude get the source data for the transmission spectra?

These two spectra actually don’t look terrible–they are pretty balanced with some narrow gaps in between. Since real-world objects tend to have very wide reflection spectra, small gaps in the spectrum won’t be particularly visible in the light reflected by the object. The only time this becomes very visible is if you have a narrow-band filter exactly at one of those gaps–a smooth spectrum would pass some light through while the spectrum with the gap doesn’t send any light through.

Another way to think about the above is that: objects having a reflection spectra that is, say, 20nm wide, is akin to smoothing the light’s spectrum by a 20nm-wide bump. So a super spiky but well-balanced spectrum (red), after smoothing, turns into a good spectrum (black).


On the other hand, if your spectrum is smooth but unbalanced, smoothing doesn’t help at all:

After all, even CFL spectra that look like this render colors somewhat acceptably:

2 Thanks

That might be more convenient, but I think it would be overcomplicating the tool.

That isn’t possible without actual optical power data.

I’m already working on the spectrum simulation tool because I already had about 60% of the code. I’ll publish it soon. Could you please tell me more about the filters?

1 Thank

Do you mean adding a chromaticity diagram to the report?

I’m not quite sure what you mean or why it would be useful. I haven’t come across this before.

At the moment, I’m working on an LED spectrum simulation tool. It’s a very useful tool for me personally. If you have any suggestions for improvements or genuinely useful features that could be added to the digitizer, I’d be happy to hear them, but I’ll work on those after I finish the spectrum simulator.

2 Thanks

I think this can be done, and has already been done implicitly!

Take any spectrum f(L), which is a function of wavelength L that outputs the relative power of that wavelength. Optical power is calculated by just integrating the area under the spectrum

Power = ∫ f(L) dL watts,

while lumens is just total power weighted by eye sensitivity, i.e.,

Brightness = ∫ f(L)V(L) dL lumens,

where V(L) is the luminosity function (lumens per watt at a certain wavelength). So the luminous efficacy (lumens per watt) of the spectrum is simply the ratio

Efficacy = ∫ f(L)V(L) dL / ∫ f(L) dL lumens per watt.

This quantity is well-defined even if the vertical axis of the spectrum is unlabeled, because scaling f(L) does not change the ratio.

When you normalized the reference/blackbody spectrum by total brightness, you already have the math packages for computing the total brightness, so implementing the above lm/W metric should be easy.

What I mean is that given an emission spectrum of a light source and a transmission spectrum of a filter, the filtered spectrum is just the product (emission spectrum)*(transmission spectrum). So if you want to implement filtering, all you need to do is implement multiplication of two spectra.

I believe this is what @six7 suggests.

2 Thanks

Now I get it! It’s called LER – Luminous Efficacy of Radiation. This parameter can indeed be calculated. It’s definitely something worth considering.

2 Thanks

Exactly! It looks like we’re just using slightly different terminology.

1 Thank

The second tool, for spectrum simulation, is not publicly available yet, but I’d like to share some screenshots.

I’ve already implemented the improvements suggested in this thread. The tool now displays a chromaticity diagram and Luminous Efficacy (LER).
It is also possible to download a PDF report containing the main results.
led_spectrum_report_en_by_SpecLED.pdf (355.9 KB)

Tool interface:

If the LED data from the datasheet is included directly in the file name, the parser will automatically populate the required fields. An example is shown below:
“Thrive_3000K_9.1V_100mA_100Lm.json” - The parser is configured to look for V, mA, mW, PPF, and Lm. The order of the parameters does not matter; the important thing is to specify each parameter in the number + value format.
The separator is an underscore (_).

1 Thank