Sciencemadness Discussion Board

Converting absorbance/transmittance spectrum into digital colour code?

fusso - 5-5-2018 at 13:46

Compounds are coloured due to absorption of different wavelengths.
So I think it will be interesting if there's a way to convert absorbance/transmittance spectrum of a coloured species of a certain concentration (eg 1M) into a corresponding RGB value.
Then I hope there's someone (or >1?) that have a UV-vis spectrometer/scope to measure out absorbance/transmittance spectra for various species (metal ions & organic substances) and publish onto SM, then the rest of us could calculate the RGB and compile a list of "chemical colours in RGB" to be published onto SM wiki. Any thoughts?

j_sum1 - 5-5-2018 at 14:09

Let's see.
You want to measure the absorbance at a range of wavelengths and output your result as a colour in rgb format.

Why not just take a photo?



There are good reasons for not doing this.
1. Converting your spectrum data to a single rgb value involves a considerable loss of information.
2. The full spectrum lends itself to analysis and comparison that a single pixel doesn't.

Really, what are you actually trying to achieve?

fusso - 5-5-2018 at 14:37

Quote: Originally posted by j_sum1  
Let's see.
You want to measure the absorbance at a range of wavelengths and output your result as a colour in rgb format.

Why not just take a photo?



There are good reasons for not doing this.
1. Converting your spectrum data to a single rgb value involves a considerable loss of information.
2. The full spectrum lends itself to analysis and comparison that a single pixel doesn't.

Really, what are you actually trying to achieve?


I did think of that but I also think different cameras and lighting would give different rgb values so I think spectrometers would give more consistent data?

fusso - 5-5-2018 at 14:56

Quote: Originally posted by j_sum1  
Let's see.
You want to measure the absorbance at a range of wavelengths and output your result as a colour in rgb format.

Why not just take a photo?



There are good reasons for not doing this.
1. Converting your spectrum data to a single rgb value involves a considerable loss of information.
2. The full spectrum lends itself to analysis and comparison that a single pixel doesn't.

Really, what are you actually trying to achieve?


Also I want to map the ions onto a colour wheel or sth like that, just like cities on a map.

And of course the spectrum could be saved for future analysis.

phlogiston - 6-5-2018 at 07:04

What you ask is possible and this should point you in the direction:

https://en.wikipedia.org/wiki/CIE_1931_color_space

I don't really see yet why your plan would be a particularly useful thing to do. I've used this myself in the past to calculate the perceived color and saturation from recorded emission spectra of pyrotechnic compositions. The idea was that you could modify the composition, see how the spectrum changes and then calculate what that looks like approximately to the human eye.

mayko - 6-5-2018 at 17:20

BoingBoing recently featured in its store some devices designed to do this with reflected light:

https://boingboing.net/2017/10/24/dont-paint-a-room-without-...
https://boingboing.net/2018/04/21/the-nix-pro-color-sensor-m...

There's also an Arduino sensor which does this, though I was a little disappointed in the few minutes I've had to play with mine:

https://www.adafruit.com/product/1334

unionised - 7-5-2018 at 04:28

It's impossible.
Neodymium glass has only one spectrum, but it has more than one colour.