Wednesday 25 May 2016

raw - Why do we use RGB instead of wavelengths to represent colours?


As we know, the colour of a particular beam of light depends on its frequency (or wavelength). Also, isn't that the information which is first captured by digital cameras? Then, why do we use formats like RGB (or CMYK, HSV etc.) to represent colours digitally?



Answer



I think there are some misconceptions in prior answers, so here's what I think is true. Reference: Noboru Ohta and Alan R. Robertson, Colorimetry: Fundamentals and Applications (2005).


A light source need not have a single frequency. Reflected light, which is most of what we see in the world, need not have a single frequency. Instead it has an energy spectrum, i.e., its energy content as a function of frequency. The spectrum can be measured by instruments called spectrophotometers.


As was discovered in the nineteenth century, humans see many different spectra as having the same color. Experiments are done in which light of two different spectra is generated by means of lamps and filters and people are asked, are these the same color? With such experiments, one verifies that people don't see the spectrum, but only its integrals with certain weighting functions.


Digital cameras capture the response to light of sets of photodiodes covered with different filters, and not the fuller spectrum that you'd see with a spectrophotometer. Three or four different types of filters are used. The result is stored in a raw file output by the camera, although many people suspect that raw files are "cooked" to a greater or lesser extent by camera manufacturers (camera sensors are of course highly proprietary). The physiological responses can be approximated by applying a matrix transformation to the raw data.


For convenience, rather than using approximations to physiological responses, other types of triples of numbers are employed to name colors, e.g., Lab, described in https://en.wikipedia.org/wiki/Lab_color_space (but note warning on page). One must distinguish triples which can express the full range of estimated physiological responses from others, like RGB, which can't. The latter are used because they do express the colors which computer screens can display. They are the result of conversions from triples like Lab, or from raw data. CMYK is for printers.


No comments:

Post a Comment

Why is the front element of a telephoto lens larger than a wide angle lens?

A wide angle lens has a wide angle of view, therefore it would make sense that the front of the lens would also be wide. A telephoto lens ha...