A photograph that includes color beyond the usual visible spectrum can be constructed by "overlaying" the image from a conventional camera with that from an infrared (or ultraviolet, or x-ray) one.

Are there effective ways of mapping such a photo's more-than-three channels down to the three of R,G,B? I've messed around with mappings such as

  • infrared --> R
  • average(R,G) --> G
  • average(G,B) --> B

but I'm hoping for something more perceptually sound.

  • 2
    Have you tried adding the IR channel using a luminosity blend? – JenSCDC Oct 9 '14 at 17:32
  • Well, since after all it's infraRED, how about working in HSV (or HSL) and "compressing" the visible spectrum part a bit - for example [red-red] to [yellow-red] and then "reinserting" the infrared at the beginning of the hue "spectrum". See here en.wikipedia.org/wiki/HSL_and_HSV for (hopefully) clarifying picture :-) I expect the results to be weird or artistic depending on the original image and IR channel. – FredP Oct 9 '14 at 19:33
  • @FredP, so, convert the RGB to HSV, scooting H away from red; also convert the infrared to another HSV with pure red H; then combine those two HSV's with some kind of blending operation (like, say, Andy's luminosity blend)? – Camille Goudeseune Oct 9 '14 at 20:40
  • Just a suggestion, but yes... why not try it if you have time. Blending is a good idea, otherwise the transition from red(ex-IR) to yellow(ex-red) could be abrupt (depending on your IR sensor sensitivity to other wavelengths...), therefore probably ugly. Try linear (or maybe rather S-curve for finer control ?) luminosity blend in the ("yellowmost") oranges. If you try I'd be curious to see the results (if possible of course). Maybe easier/faster : you could decrease the saturation of the original RGB (trial and error for %, say to 70%) and add IR in red channel (with 30% max saturation). – FredP Oct 9 '14 at 21:03
  • Before we go any further, what do you mean "perceptually sound"? I don't think I've heard that phrase before. "Perceptually uniform", OTOH, I'm familiar with. – JenSCDC Oct 10 '14 at 0:57

Some of the answers here discussed a more complex question: what is the optimal mapping of more than 4 colors into a 3 component image. This is a very subjective question. From an artistic standpoint, there is no good answer.

But from an engineering standpoint, one can use compression algorithms. A very basic algorithm for multiple band compression is called PCA (principal component analysis).

It 'basically' finds a linear transformation of your X spectral components into Y new spectral components in a way that:

  1. each component is orthogonal to the other (they have minimal correlation).
  2. the components are sorted by the level of variability in the image. so the first components have most of the data and the last components are mostly noise.

so basically using an algorithm such as PCA or equivalent and displaying the first 3 components as your RGB would give you an image with maximum information and contrast that can be put into a 3 band composition. Is it going to be a pretty image? not necessarily. natural looking? most probably no. But its probably more useful if you were a scientist/engineer and wanted to improve contrast.

| improve this answer | |
  • So, consider the 4-channel image as just a set of pixels, i.e., points with 4 coordinates. Run PCA. From that keep only the first 3 coords. Then map those to RGB or, better, something based on luma and chroma. Is that right? – Camille Goudeseune Oct 14 '14 at 17:17
  • yes exactly. But I would suggest looking at something better than PCA, its a good start but there are better algorithms. The Kernel PCA algorithm is a more modern example, and it allows finding a nonlinear transform which is in many cases needed. – user2324712 Feb 13 '15 at 7:50

I'm afraid there is no one-size-fits-all answer to this question, as mapping of incoming light values to output pixel values is never 1-to-1, not even for plain visible light photos. You can start by reading about gamma correction and tone mapping. Typically, the exact mapping will vary depending on the content of the photograph.

I suspect you will have more luck working on such composite images using a graphics editor rather than a math driven application that simply iterates over all pixels. For best results, you may need to use masks to apply slightly different curves to different areas of the same image.

| improve this answer | |
  • 1
    These mappings deal only with (adjusting the dynamic range of) 3-component color. But this question is grappling with reducing more-than-3 components to just 3. AFAIK PhotoShop can't manipulate, say, a 7-channel image (unless you pour in the extra channels one at a time through a blend). Maybe specialized astronomy software can? – Camille Goudeseune Oct 10 '14 at 20:28

Specialized astronomy software typically converts three channels taken in different filters (e.g. three of the 'wide band' Johnson UBVRIJHK.... filters spanning ultra-violet to 2.5 microns and beyond) to RGB channels that humans can see. Photographic imaging software thinks of images in three colors (I believe), as off-the-shelf cameras take three color images... you'd have to figure out how to map whatever three channels your detector gets with your filtration into RGB. If you get into programming your own mixes this is not that difficult, using a free, modern language like Python, for example, which has an imaging library (PIL).

| improve this answer | |
  • So, like the "CIR" answer here, it's common to just choose three channels and discard the rest. The "PCA" answer is more work, but more promising. – Camille Goudeseune Oct 14 '14 at 17:16
  • Satellite imagery, such as LANDSAT, also just chooses three channels and discards the rest. – Camille Goudeseune Oct 21 '14 at 19:37

As said before me, there is no standard on this. With that in mind, I will give you one of the most popular IR color compositions.

The composition is called CIR (color infra-red) And it uses IR->R G->G B->B

There is a known phenomena in vegetation called the 'red edge' which causes vegetation to reflect more light in a narrow spectrum in the IR due to their chlorophyl content. scientific explanations aside, this is really useful: many satellites use this for agriculture applications and photographers exploit this for cool photography. Here is a link to a nice photo montage done in korea using the CIR composition.

| improve this answer | |
  • Ah, so this just discards R. Even simpler than my invented formula, which discards a little bit each of R, G, B. – Camille Goudeseune Oct 14 '14 at 16:42
  • Yes, but it depends at what phenomena you are looking at. Image analysis software usually allows to display both images and flicker between them and see the difference. – user2324712 Oct 14 '14 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.