exmadscientist
3 months ago
What I want to see is someone go through and assign sRGB colors for each of the main LED types. It's surprisingly difficult. I've failed every time I've tried, in that what I come up with doing it by starting from the spectra (or a simple gaussian approximation) looks on screen nothing like the real LEDs. The greens (515-525nm) are particularly difficult.
I recognize that sRGB will never be able to do a perfect job, but it seems like it has to be possible to do decently well.
(What do I need this for? I design electronics. I use LEDs as indicators. I like to show the true color of the LED in my schematics and documentation, as best I can. And I try to never use the same color twice, in small and bespoke things, so there's less risk of indicator confusion, which means I've often got a lot of funny colors around.)
ansgri
3 months ago
In abstract case, you'd probably want to use xy color coordinates from xyY color space to specify LED color. Or even wavelength + spread, as you've tried. Those were the models that were used in one microLED-related research project I was part of.
Using those in images however would be another can of worms, you'll need some kind of physics-based rendering with good HDR tone mapping, as the human perception of light-emitting object against reflective background is highly non-linear.
For your use case it would probably be better to develop a standardized testing setup and just take RGB or XYZ coordinates from an image taken with a calibrated camera. Something like this:
* "standard gray" material surface
* a hole for LED with some kind of light pipe of standard shape
* uniform diffuse lighting of intensity computed to be proportional to your LED power measured in a standard way.
In this way it should be possible to create a catalog of LEDs useful for designing products.
exmadscientist
3 months ago
Part of the motivation for doing this was to be able to visualize things without having actual parts in hand, to save on prototyping effort. I agree that just measuring the thing is probably the solution, though I'm perennially disappointed that following the Official Rules for just calculating the result is so terrible.
zamadatix
3 months ago
sRGB has such a limited range in greens (well, it's all pretty limited - just greens particularly) I really don't think there can be a decent result.
kelsolaar
3 months ago
sRGB is not wide gamut enough to represent most of the LEDs, you would need a Wide Gamut display and use a space like ITU-R BT.2020.
exmadscientist
3 months ago
That's not the point. The point is that I have to put representations of LEDs in places that are sRGB only (documentation!), so I want the best I can do in sRGB.
klysm
3 months ago
sRGB is probably the wrong way to think about this. XYZ color space would be a better conceptual place to start
exmadscientist
3 months ago
Perhaps, but I need to end up at sRGB somehow for display.
klysm
3 months ago
Yes but why add the confusion of gamma correction etc and a small gamut?
exmadscientist
3 months ago
I mean, I'm not immediately jumping to sRGB or anything. (Well, I think I tried that at one point, not like it worked....) I just need to end there. I've tried plenty of things over the years and I simply cannot make an algorithm that takes some kind of spectral input and outputs a hex color code that I can make a blob of on my (color-calibrated!) monitor which looks anything like the LED I have in hand.
Coming up with a matching color by hand can give a decent result, so this is not solely sRGB being crap.