필터 지우기
필터 지우기

Color wave length and hue

조회 수: 18 (최근 30일)
Prashant Somani
Prashant Somani 2011년 9월 29일
편집: Nikhil R. 2020년 12월 5일
Is there any method to get color hue from its wave length?

채택된 답변

Walter Roberson
Walter Roberson 2011년 9월 29일
Hue = (650 - wavelength)*240/(650-475);
Note: the denominator consists of two seemingly arbitrary limits in the code. The 240 refers to the maximum hue value of 240 that is used in standard 8 bit Hue representation.
Visible light is about 400 to 700 nm, with 650 nm being the frequency of red. 475 is blue. Both indigo and violet fall below this limit, but the CIE model that defines the theoretical map of wavelength to hue has to treat colors in that range separately, and it could be that 475 nm is the effective limit for standard Hue calculation, perhaps requiring negative Hue (yes, that is possible in color theory, but not in standard 8 bit Hue representation.)
  댓글 수: 3
Walter Roberson
Walter Roberson 2018년 9월 4일
Sorry, I do not know, I did not write the code I linked to. I suspect the hue calculation given in that code might only be valid for colors in the range of red to blue, and that beyond that might start needing a different formula. The HSV and L*a*b* calculations are conditional based upon which component is strongest, and so calculating hue might get a bit complicated outside the noted range.
Nikhil R.
Nikhil R. 2020년 12월 5일
Just a disclamer: I tried 400º wavelength, but got 342º hue, when I was expecting ~280º. I think something is wrong with the formula.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Nikhil R.
Nikhil R. 2020년 12월 5일
편집: Nikhil R. 2020년 12월 5일
Hi! So, I have a formula from stackoverflow.com; if h = hueº, and w = wavelength nm.
w = (400 / 270)h. You use this as a graph:
Edit: Note: This formula tries to get the closest possible to the same. Hue tends to be brighter as for example:
400nm/~270º
~265nm/~180º
~575nm/~390º
...
Table of official hues to wavelengths (Approximently):
Name Hue Wavelength
Red 0/360 650
Orange 45 600
Yellow 60 420
Lime 100 575
Cyan 180 475
Purple 270 400

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by