home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / graphics / 8756 < prev    next >
Encoding:
Internet Message Format  |  1992-08-12  |  1.9 KB

  1. Path: sparky!uunet!utcsri!torn!news.ccs.queensu.ca!qucdn!polowinj
  2. Organization: Queen's University at Kingston
  3. Date: Wednesday, 12 Aug 1992 17:19:06 EDT
  4. From: Joel Polowin <POLOWINJ@QUCDN.QueensU.CA>
  5. Message-ID: <92225.171906POLOWINJ@QUCDN.QueensU.CA>
  6. Newsgroups: comp.graphics
  7. Subject: Re: Is there a mathematical relationship RGB -> wavelength?
  8. References:  <1992Aug9.151055.25530@cis.ohio-state.edu>
  9. Lines: 27
  10.  
  11.  > For curiosity's sake, I was wondering if it is possible to take a set
  12.  > of RGB color fractions and come up with an approximate wavelength of
  13.  > the observed mixture.  I suppose this could be done by just
  14.  > interpolating between some known values in a table, but I would like
  15.  > to know if there is a way to actually calculate the wavelength.  Of
  16.  > course, I'd also be interested in a formula to compute the RGB
  17.  > fractions for a given wavelength.
  18.  
  19. If you're interested, I've written a (relatively) short function in C
  20. which takes arguments of RGB values, computes a "brightness" value and
  21. the intensities of the two spectral colours (ROYGBV) present in the
  22. "colour" being described, and returns this information along with a
  23. description in words.  For example, given RGB of 230, 208, 179, it
  24. determines that this has a "brightness" of 80%, a grey level of 70%,
  25. orange 15%, yellow 5%: "lt, sl yelsh org".  (The routine needs some
  26. tweaking yet; on my monitor, this colour looks more like a yellowish
  27. orangey grey.  But the spectral-colour separation isn't bad.)  If
  28. you have wavelength info for some kind of arbitrary standard Orange
  29. and Yellow, you could probably then come up with a reasonable
  30. calculation of a wavelength for something which is 15% orange and 5%
  31. yellow.  What exactly you'd do to get the wavelengths of colours which
  32. combine red and violet I don't know off-hand.  The whole scheme is kind
  33. of arbitrary, but it seems to work fairly well.
  34.  
  35. Joel
  36.  polowin@silicon.chem.queensu.ca, polowin@chem.queensu.ca,
  37.    polowinj@qucdn.queensu.ca
  38.