• she/her

queer code witch - 18
discord @‍mintexists
send me asks! :3


boobs
I'm not convinced that this needs to be a link?
Yea no
it doesnt
i wonder if
**markdown** formatting *works* no it doesnt thats sad

I just nerdsniped myself and now I'm trying to figure out how light works. Is all u need to make a color wavelength and intensity?? What is light even??? How do you convert wavelength to rgb and back and what is white light even????

Where do I even learn all this stuff. Is this something that I can reasonably learn in a weekend? Why am I teaching myself this shit instead of being a normal highschooler?


You must log in to comment.

in reply to @mintexists's post:

oh if you're specifically interested in simulating refraction to get rainbows you need more sophisticated techniques than the RTin 1 weekend book. people pointing you towards CIE/LAB and wavelength response curves are on the right track.

i have like 10 years of programming experience and tried to write an efficient spectral path tracer in a weekend and... only sort of succeeded. it's not easy but it's definitely not impossible, and the results are super cool!

yeah like the important thing to get through your head is that there are two disjoint phenomena which "produce color": the physical reflection of light off of an object, and the chemical and cognitive processes which convert an observed light source to a visual stimulus

which leads to all sorts of side paths like metamerism and defects in color vision that are even weirder to think about

90% of what you're asking can probably be covered by Youtube videos in a weekend, yeah.

...The other 10% is going to take two college courses worth of electromagnetics, maybe one more of bio-optics, and given where you're going, probably one more on the philosophy of reality.

so wrt rgb that gets into how the human eye perceives things. you should take a look at the frequency response curves of the eye's various types of rods and cones - you'll find plots if you search around. they don't precisely correspond to red, green, and blue as monitors emit them, but they are close enough that it mostly works.

the deep secret that would make a lot of color theory easier to understand if people said it up front is that combining different frequencies of light does NOT make any color. it just fools the eye into thinking it's seeing any color, because the eye has its own "hardware" limitations.

we saw a really good essay a while back on the manner in which magenta fails to exist, which is unique and different from other weird colors such as orange, which also doesn't exist but in a totally different way (and perhaps a less fascinating one). magenta is amazing in that it is not a frequency of light at all, it is TWO frequencies of light that the brain understands to mean something different when they're together, in fact at the neurological level it's subtracting one signal from another to decide "how magenta" things are. because evolution doesn't care what we think makes sense ;)

the answer to the question you actually asked is a bunch of matrix multiplication, and matrices are just a fancy notation that means multiply your equation by all these constants, so you can and should look up directions for how to do it and you'll get the constants that people (mostly camera and printing companies) have decided on, but that won't leave you very enlightened by itself. you should still do it in order to convince yourself that that's ALL that's happening, that all this theory does come down to these multiplications. because it does.

for the record we taught ourselves this shit (and lots of other shit) instead of being a normal highschooler, and it was very rewarding and the understanding we got that way was way deeper than most people's, on pretty much every topic, and it has been the foundation of our career and we attribute a ton of our success to it

it sure did lead to us failing all our classes though, so there's that. you'll have to strike your own balance

The very short answer to "who do you convert wavelength to rgb and back" is like, you take the frequency response curves of the different types of cones in a human eye, and I think you take the correlation with those?

You'll want to look at the CIE color spaces for connection with the "standard observer" that people have agreed upon, and that most standard color math is based on.

what i literally just did a bunch of research into converting wavelength in nanometers into hex RGB

as it turns out, every option is garbage and gives different results depending on what you think light is and how you think human perception of light works and how you think monitors reproduce color, and most strategies do not care about at least one of those things to make it simpler and generally all three are ignored

the Kuntzleman-Jacobson technique for converting directly between nm and rgb is used by many online tools, but i find that it really struggles to produce colors that seem reasonable for certain wavelengths

the Spektre technique seems to be based on some minor misunderstandings of how light perception works, but due to the data collection process it seems to produce very believable colors, as best as i can determine this innovation is the original research of one stack overflow user and yet it has been working for me

as someone else said, CIE is the gold standard, if you figure out XYZ color space please share your discovery with me because plugging the data CIE provides in its papers into common conversion tools did not generate useful colors for me

Pinned Tags