TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Exploring the Visible Spectrum in Python

56 点作者 codedrome将近 6 年前

6 条评论

staticfloat将近 6 年前
This mapping of wavelength to RGB value is very misleading: in particular, when moving to higher and higher frequencies, blue does not wrap around to red creating purple. The perceptual color space that we are used to working in by mixing pigments or various frequencies of light is independent of light frequency. Unlike all other colors in the rainbow, there is no single frequency that will activate both the red and blue cones within your eye to create purple; if you had a single frequency between blue and red, it would look green. Instead, you must have two disjoint frequencies both stimulating the red and blue cones simultaneously (note that this is not strictly true, as for some people, the red cones do have some response down in the blue range, but the amount of red response within the blue region is extremely weak, and will not give the sensation of purple that is shown in articles such as this one).<p>This is why rainbows do not have purple at the edge, and why prisms do not create purple; it is a &quot;non-physical&quot; color (I made that term up, but it hopefully makes sense given my explanation above).<p>For a more physically-sound mapping of wavelength to color, see the CIE XYZ color system [1]. In particular, in Figure 2, the &quot;pure wavelengths&quot; are given as points along the outside edge of the curved surface, and as you can see, purple does not exist along that outside edge.<p>For those interested in simulation of color, I highly recommend Jiahao Chen&#x27;s old notebook &quot;The Colors of Chemistry&quot; [2], which goes through a lot of these concepts, and accurately simulates things like the color of solutions just from knowing their chemical composition. Truly fascinating stuff.<p>[1] <a href="http:&#x2F;&#x2F;www.fourmilab.ch&#x2F;documents&#x2F;specrend&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.fourmilab.ch&#x2F;documents&#x2F;specrend&#x2F;</a> [2] <a href="https:&#x2F;&#x2F;github.com&#x2F;jiahao&#x2F;ijulia-notebooks&#x2F;blob&#x2F;master&#x2F;2014-06-09-the-colors-of-chemistry.ipynb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jiahao&#x2F;ijulia-notebooks&#x2F;blob&#x2F;master&#x2F;2014-...</a>
评论 #20604139 未加载
评论 #20628616 未加载
评论 #20604603 未加载
jcims将近 6 年前
The use of a fill chart type is confusing, it&#x27;s only accurate at the line at the top of the chart.<p>There&#x27;s also something odd to me about how one chart appears to be polynomial and the other linear.<p>Lastly the mapping of RGB value to the frequency on the chart is inconsistent between the two charts. In the first we see 255,0,0 at ~480THz and in the second at over 500THz<p>In short, neat concept but I think the output needs a little validation.
ta1234567890将近 6 年前
This is pretty cool.<p>Been playing around with &quot;inverted colors&quot; lately and noticed that the inversion is purely mathematical, but not perceptual.<p>For example, if you have the RGB color (120, 30, 10) the inverse of that is (135, 225, 240). But our eyes have different sensitivity to different colors, so when you invert a whole picture, the contrast gets all messed up and it&#x27;s very hard to tell things apart (wanna try it? Set your screen to inverted colors then watch a video on YouTube and you&#x27;ll see what I mean).<p>So, does anyone know how to get &quot;perceptually equivalent&quot; inverted colors?
SiempreViernes将近 6 年前
So this just draws all possible colours that can be visualised?<p>There was entirely to much text and code for me to bother reading it all and see if it actuallt does somethig more...
评论 #20601071 未加载
rSi将近 6 年前
How about gamma correction? The resulting images are meant to be displayed on a screen I&#x27;m guessing?!
评论 #20601744 未加载
dosshell将近 6 年前
It shows three wavelengths correct atleast :P<p>I still remeber when I first realized that white color from the pc-monitor is not white.
评论 #20601319 未加载