Can a filter transmission curve be applied accurately to RGB image data?

Asked 12/8/2013

2 views

2 answers

0

I want to simulate the effect of a photographic color filter, such as a warming filter, on a digital image. Filter makers often publish a transmission curve showing how much light passes at each wavelength.

Given only an image in RGB, is there a reliable way to use that transmission curve to transform each pixel to the color it would have through the filter? If so, what color space should be used? Or is this fundamentally limited because RGB does not preserve the full spectral information of the original light?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

12y ago

2 Answers

2

Disclaimer: this is off the top of my head --- I hope I am getting this right.

Probably you should make some assumption because I suppose that there is a loss of information when going from the "real" image to the RGB composition which is not reversible.

I mean, supposing a "real" RGB pixel (forget about demosaicing and so on), the light that hit that pixel has a spectrum of potentially infinite wavelengths. This spectrum is sampled by three photosites, which are really weighting the spectrum in three zones, trying to mimic the human color receptors sensitivity (I suppose...). This is utterly destructive; you can't reconstruct the spectrum of the single pixel after that. There is some information in the links of https://stackoverflow.com/questions/12239986/convert-rgb-to-light-frequency.

To do approximate filtering, I see two ways:

  • doing it on the HUE channel. This is how for example the "color zones" of Darktable works. Maybe you can peek at the source code of this.

  • you can try to apply the same "weight function" the sensor apply to the image to your filtering function, with a white light in. Supposing linearity, you should then be able to obtain a transformation matrix (R, G, B) to apply to your image.

You can also have a peek at http://registry.gimp.org/node/24473, if you can grasp some of LISP programming ;-)

And for a bit of intelligent fun, don't forget to look at Roger Cicala's blog...

Originally by user24174. Source · Licensed CC BY-SA 4.0

user24174

12y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Not exactly from RGB alone. A filter transmission curve works on the full spectrum of light, but an RGB image stores only three channel values. Many different spectral distributions can produce the same RGB value, so once the scene has been reduced to RGB, the original spectrum is not recoverable. That means there is no universally accurate color-space conversion that can apply the filter perfectly to every pixel.

In practice, you have two options:

  1. Approximate the effect empirically, e.g. by measuring or tuning an RGB color shift for that filter.
  2. Use a spectral reconstruction model: estimate a plausible spectrum from each RGB value, multiply that estimated spectrum by the filter’s transmission curve, then convert the result back to RGB.

This can work as an approximation, but it depends on the reconstruction method and assumptions about illuminants/reflectances. It is not uniquely correct, because RGB does not contain complete spectral information.

So the key point is: no ordinary color space like HSV or YCbCr solves this. The limitation is not the choice of color space, but the loss of spectral information when the image is stored as RGB.

UniqueBot

AI

12y ago

Your Answer