Tool for digitizing an LED spectrum from an image

Thank you so much for the updates! I’m gonna play with it for a while before giving any substantial feedback, but for now: the normalization looks correct, and the overlay and manual correction are both excellent additions to the tool.

I’ll respond more in a day or two!

1 Thank

Great! I’ll be waiting—thanks for the help. If you have any ideas, let me know.

1 Thank

I played with the digitizer some more, and I have the following feedback:

  • On the technical/UI side of things, it’s almost perfect. My only critical observation is that for test spectra with CCT > 5000K, a daylight spectrum of corresponding CCT should be used as the reference, rather than blackbody or sunlight. Here’s a bit more info on implementation.

The manual correction (pointwise correction and re-drawing on an interval) is extremely helpful. In addition to correcting the recovered spectrum, it also allows the user to make minor perturbations to the spectrum to see how CRI and other colorimetric data change. Thank you very much for thinking of this!

  • On the presentational side of things, I have a few minor comments:
  1. For R1-R15 (VS1 to VS15), in addition to numerical output, it would be nice to have a visual representation of the values, which is easier for a human to process at a glance. A standard way to visualize them is these colored bars:
  2. I suggest changing the aspect ratio of the recovered spectrum to match the aspect ratio of the input image (post-calibration). At the moment the aspect ratio seems to be perfectly square, while most spectrograms have a width:height ratio of 2:1.
  3. It would be nice to add the option to download the entire color report in addition to the spectrum.
1 Thank

Instead of implementing the evaluation and visualization again, what about a bridge to https://www.hcri.io/? Parse the chart and export it to hcri.io with a single click.

2 Thanks

This could be a sensible solution. My only concern is the long-term stability of the hcri.io webpage–if it ever goes down for unforeseeable reasons (who knows what these AI companies are up to), this part of the function would be lost.

1 Thank

Isn’t it the same the other way around?

1 Thank

I assumed that hcri.io is hosted by Anthropic like Claude artifacts, but upon looking into it further it appears to be self-hosted. If that is indeed the case, I no longer have the concern about stability.

1 Thank

So both should allow you to export the data in a common format so you can back up a library of measurements.

Best case, the library as well as the site/algorithm would be open source and automatically backed up to something like GitHub, so we have a version history.

2 Thanks

It was made by our fellow member @fizzgig:

(You even participated in the development.)

Should the server go down, he will most likely host it somewhere else.

2 Thanks

It was not clear to me that hcri.io is not only developed by humans, but also hosted by a human! I must have mixed it up with some Claude artifacts floating around (which are also developed by humans with AI assistance). Thanks for clearing this up.

1 Thank

hCRI.io was developed by me with significant help by Claude for both coding and calculations. It is hosted at spaceship.com.

It’s easily portable if it needs to be re-hosted.

2 Thanks

So, in a way, I’ve created a competitor. However, the original goal of my tool was specifically to digitize spectra for analysis. The tool was initially designed for analyzing light for plant lighting. But later I thought, why not use it to perform all the other calculations as well, especially since there are Python libraries available that already do all of this very well?

1 Thank

I think your tool and hcri.io by @fizzgig are mutually complementary rather than competitive. Your focus is much more on the digitization of an image, and your tool is extremely functional at that. The website hcri.io is a comprehensive analyzer given digitized data.

In light of the knowledge that hcri.io is likely to remain stable, I think it is not necessary for the digitizer to perform full spectral analysis. However, I would still keep the existing features as they are–it is very convenient to be able to slightly modify a spectrum and see the effect on measurements immediately, without needing to switch to a different site.

1 Thank

I have released another major update for the spectrum digitization tool:

  1. VS1–VS15 values are now displayed as a color-coded scale.
  2. Added the ability to export reports to PDF. The file is generated on a one-page-per-spectrum basis; for instance, digitizing 5 spectra will yield a 5-page PDF containing individual reports for each. The report language automatically matches the user’s selected locale on the tool page. The spectrogram in the report perfectly reflects its current UI configuration (e.g., color fill vs. line plot, and whether the black-body radiator comparison is toggled on or off).
    spectrum_report_Thrive_4000K_en_by_specled.pdf (513.1 KB)
  3. Added a toggle button that loads a blank chart for manual spectrogram drawing, designed primarily for educational purposes and experimentation. The button allows seamless toggling back and forth between modes.
  4. To preserve the UI layout on the webpage, the strict 2:1 aspect ratio for the spectrogram chart is now applied exclusively to the exported PDF reports and PNG images.
  5. The “Auto-baseline alignment” checkbox is now disabled by default, as practical testing revealed this feature is rarely needed.
  6. I incorporated your feedback regarding the reference illuminant: if the CCT is above 5000K, we use the daylight spectrum for comparison. This is now handled automatically. The system switches reference illuminants if the calculated CCT exceeds 5070K (the extra 70K acts as a tolerance margin for digitization errors).
  7. Minor bug fixes.
1 Thank

Would be nice to have Spectrum import/export function.

1 Thank

All of this looks fantastic!

I realized that I was being an idiot and didn’t realize that the VS values aren’t the same thing as the R values commonly used. For example, VS9 is not deep red, and VS12 is not deep blue. Consequently, the CQS CRI is not the same thing as the Ra CRI (average of R1 through R8) that is commonly used.

Would it be possible to add/swap the VS values for the more commonly-used TCS values? Again, my apologies for the mistake.

1 Thank

That’s another good idea. You can export the spectrum in CSV or JSON format, so why not add the option to upload spectra in the same formats? This feature is already available in the new update.

Everything is fine. I got stuck on CQS, which I was using myself, but in practice, nobody is really interested in it — everyone uses CRI. In the web report, you can now see both the CRI and CQS scales. In the PDF report, I replaced the CQS scale with the CRI scale. This makes the report more useful than it was before.

  1. The ability to import spectra in CSV or JSON format.
  2. The CSV and JSON download buttons are now available only when a single spectrum is selected. If multiple spectra have been digitized, the buttons are disabled. To enable them, deselect the unwanted spectra and leave only one selected.
  3. If blackbody spectrum display is enabled and multiple plots have been digitized, downloading a PDF report for multiple spectra will now generate the correct blackbody reference spectrum for each individual plot — using the appropriate color temperature or daylight spectrum. Previously, a single reference temperature was applied to all plots, which was incorrect.
  4. CRI has been added to the web report. The report now displays both values in a single row: CRI & CQS.
  5. Minor changes to the user menu.

Thank you for the help.

2 Thanks

Many thanks for implementing these modifications! I have run out of improving suggestions and think this tool is perfect.

Thank you very, very much for building this! It has been bookmarked and will see frequent use…

1 Thank

Great, that means I can edit the text of the article below the tool!)) Please leave a review when you have some time.

I was thinking yesterday… I already have about 60% of the code needed to create a tool that would allow users to upload a digitized spectrum for each channel, set the power for each channel, and generate the resulting combined spectrum. In other words, a tool that would allow users to combine LEDs with different spectra and calculate the resulting spectrum with around 95% accuracy! I think this could be really useful.

2 Thanks