phetsims / color-vision

"Color Vision" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/color-vision
GNU General Public License v3.0
1 stars 7 forks source link

Purple Photons should be removed from model #88

Closed ariel-phet closed 9 years ago

ariel-phet commented 9 years ago

A user wrote in to phethelp and said

First let me say thank you for providing these online sims. They are a great addition to my curriculum. I am using the Color Vision Sim in my physics class to allow students to play with additive and subtractive color mixing. I noticed what I think is an error in the science. You will want to confirm this, The simulator allows students to generate purple light photons. According to my knowledge purple light photons do not exist. Purple(and Pink) are only created by mixing various quantities of Red and Blue. There are Violet photons, but these refer to dark blue as in roses are red violets are blue. If I am wrong, on this please let me know. Also, just a thought for improvement, adding colored surfaces for reflection and the ability to control what colors are absorbed rather than reflected will help solidify the concept of subtractive mixing. Just a thought. Thank you again for providing these sims, I teach at a small school and this site opens alot of content options for me.

The user is correct and we should remove the ability to make purple photons on the first screen. (This is basically only an issue on the first screen with the bulb and purple filter). It seems the easiest solution would be to remove this area of the spectrum from the filter spectrum, the bulb spectrum, and the model.

pixelzoom commented 9 years ago

The wavelength slider is a common-code component. It shows the entire visible spectrum, and currently has no ability to specify a subset (or subsets?) of that spectrum. So scenery-phet.WavelengthSlider will require modification.

The visible spectrum is 380 to 780 nm. Please specify which portion of that spectrum should be omitted. Hopefully it is 380 to some value. If it's a range in the middle of the spectrum, that will significantly complicate the modifications required to WavelengthSlider.

Finally... Presumably this is a fix that will not be applied to the Java version of the sim. @ariel-phet please confirm.

ariel-phet commented 9 years ago

Correct, Java version will be left alone.

@pixelzoom "purple" basically does not appear in the actual spectrum, so something needs to be adjusted with color mapping and such

From wikipedia: http://en.wikipedia.org/wiki/Visible_spectrum

The spectrum does not, however, contain all the colors that the human eyes and brain can distinguish. Unsaturated colors such as pink, or purple variations such as magenta, are absent, for example, because they can be made only by a mix of multiple wavelengths. Colors containing only one wavelength are also called pure colors or spectral colors.

For instance, we don't have "pink" in our spectrum

pixelzoom commented 9 years ago

Then it sounds like the problem is in scenery-phet.VisibleColor, which maps wavelengths to RGB values. VisibleColor is a port from Java common code, and was written circa 2004. I have no recollection of where the algorithm came from.

ariel-phet commented 9 years ago

This is a nice little tool (but still an approximation since color perception is kind of hideously complicated)

http://academo.org/demos/wavelength-to-colour-relationship/

It looks like maybe in the Blue/Violet crossover (around 410 nm) we need to choose a different color,

pixelzoom commented 9 years ago

The algorithm that we're using in VisibleColor is apparently fairly standard.
Here it is on StackOverflow: http://stackoverflow.com/questions/1472514/convert-light-frequency-to-rgb Here it is in Python: http://www.noah.org/wiki/Wavelength_to_RGB_in_Python Here it is in JavaScript: http://scienceprimer.com/javascript-code-convert-light-wavelength-color

Also note that modifying this implementation will change not only Color Vision, but all current and future sims that use VisibleColor.

ariel-phet commented 9 years ago

Understood, but it seems we really shouldn't be showing purple if that color does not appear in the actual spectrum (regardless of simulation context).

pixelzoom commented 9 years ago

The top-voted StackOverflow post (see above link) says:

the Fourmilab article makes the important point that some colours are not representable in RGB (bright oranges being a good example) because you cannot "make" arbitrary colours of light by adding three primary colours together, whatever our physics teachers may have told us (well mine did). Too bad, but in practice not usually fatal.

The Fourmilelab article is at http://www.fourmilab.ch/documents/specrend/, and recommends the algorithm that we are currently using in VisibleColor.

ariel-phet commented 9 years ago

Hmm, seems like truncating the spectrum on the first screen might be a solution.

Seems like a good topic to bring up for Status meeting.

@pixelzoom can you put this on your list of Status meeting discussion topics for this week.

pixelzoom commented 9 years ago

Consensus at 4/23/15 status meeting: Leave sim and VisibleColor as-is, mention this issue in the teacher tips. Assigning to @ariel-phet to reply to the customer.

ariel-phet commented 9 years ago

I have replied to the customer. I will open an issue for the teacher tips.