[ Beneath the Waves ]

Virtual Filters

article by Ben Lincoln

 

False colour imagery is my favourite application of exotic imaging systems, but in many cases it can provide practical real-world uses for general photography as well. For example, Kodak has developed a prototype sensor which uses near infrared light-sensitivity to boost the brightness of conventional photos (allowing for better low-light performance, allegedly without affecting the perceived colours of objects).

By capturing other spectral bands in addition to visible light, it is possible to achieve effects that would traditionally be accomplished by placing a filter in front of the lens, or enhancing the final image in other ways by taking advantage of the changing properties of light across the spectrum. An additional benefit is that because all of this takes place in post-processing, there are no "irreversible decisions" made in the field by filtering out something you might change your mind and want later.

The techniques described in this article generally apply to landscape-style images which depict a "vista" including near and far objects. I will add others as time and experimentation permit. Because of the physics involved, it is generally possible to approximate the same effects with only a traditional photograph by substituting the nearest human-visible band for the non-human-visible band in question (e.g. using blue instead of ultraviolet-A, using red instead of near infrared). Of course, the results will likely not be as dramatic because there is no additional, expanded photographic information available.

Ultraviolet-A Mask

Most casual photographers know that ultraviolet light is associated with "haze" in images. This is because Earth's atmosphere scatters ultraviolet light more than it does visible light, and in fact this effect extends through the adjacent areas of the spectrum, with blue light being scattered more than green light, and green light being scattered more than red light. This resulted in the creation decades ago of the "haze filter" and the "skylight filter", which reduce the amount of ultraviolet and blue light that can pass through the lens onto the digital sensor or film[1].

For purposes of the two main types of "virtual filter" described below, a common element is necessary. This is a mask which isolates (more or less) the foreground from the background. Because of the atmospheric effect described above, an ultraviolet exposure provides an ideal starting point. Areas which are further away will appear to be covered in an increasingly bright fog, as if the photo were depicting a late-1990s 3D videogame.

  1. Copy the ultraviolet-A version of an image into a new file.
  2. Adjust the levels (preferably using an adjustment/effects layer) to maximize the contrast between the light and dark areas, while avoiding a "brick-wall" cutoff point. See the Los Angeles set below for an example.
  3. Keep this file handy for use shortly. It will be referred to as "the UVA mask".

Virtual Haze Filter

This method provides an effect which approximates the sharpening of distant objects provided by a traditional haze filter, while preserving the colour balance of the image (whether it represents human-visible light or is a false colour composite).

  1. Choose how dramatic an effect you would like to apply to the image. A more intense effect requires more spectral bands. Begin counting from blue and work upwards to near infrared. For example, a low-intensity effect would only require the blue channel, whereas high-intensity would use blue, green, red, and near infrared.
  2. Copy the appropriate channels and/or layers into a new file as individual layers. That is, if you will be working with blue and green, the new file should have a greyscale blue layer and a greyscale green layer on top of that.
  3. Make another choice as to the intensity of the effect. For the highest intensity, you will use a compositing type of Darker Color in the next step. For lower intensity you may use Overlay or leave the compositing type alone and simply adjust the opacity of the layers.
  4. Adjust the compositing type and/or opacity of the layers in the new file using the method arrived at in the previous step. For example, to achieve the most-dramatic effect possible, set the compositing mode of all layers other than the background to Darker Color. The result (in this case) will be a greyscale image which depicts (for each pixel) the darkest level present in any of the spectral bands.
  5. Flatten this image (or merge the layers).
  6. From the multispectral set (not the UVA mask!), copy the ultraviolet-A image and paste it in as a new layer at the top of the new image which contains the flattened/merged layers.
  7. Invert the colour of the ultraviolet-A layer that you just pasted in. Since it should be greyscale, this is effectively just inverting the brightness.
  8. Change the compositing mode of the new ultraviolet-A layer to Difference.
  9. Flatten/merge the image again.
  10. Create a second new file which contains the colour image you'd like to apply the virtual filter to (usually the RGB/human-visible light variation of an image).
  11. Switch back to the flattened/merged image and copy the contents. Paste them in as a new layer above the colour image in the second new file.
  12. Add a layer mask or alpha channel to this new layer.
  13. Copy the UVA mask and paste it into the layer mask or alpha channel you just created.
  14. Change the compositing mode of the resulting layer to Overlay.
  15. Adjust the opacity of the layer until the desired effect is achieved.

Near Infrared-Enhanced Contrast

Just as atmospheric scattering increases towards the ultraviolet end of the spectrum, it decreases in the near infrared, making distant objects much easier to image in that spectral band. This can be used instead of or as a complement to the "virtual haze filter".

  1. Copy the RGB/human-visible light variation of an image into a new file, then desaturate it (convert it to greyscale, averaging the values of the red, green, and blue channels).
  2. Copy the near infrared variation of the image and paste it in as a new layer in the file with the desaturated RGB background.
  3. Invert the colour of the NIR layer (again, since it should be greyscale, this is just inverting the brightness).
  4. Change the compositing mode of the NIR layer to Difference.
  5. Flatten/merge the file.
  6. Copy the contents of the file and paste them in as a new layer above the colour image that you wish to apply the filter to.
  7. Add a layer mask (alpha channel) to this new layer, and paste the UVA mask image into that layer mask or alpha channel.
  8. Change the compositing mode of the resulting layer to Overlay.
  9. Adjust the opacity of the layer until the desired effect is achieved.

Mix and Match

These two examples are just a starting point. As always, feel free to experiment, including applying both methods to the same image to increase the visibility of distant objects even further (although generally you'll need to reduce the opacity of the virtual filter layers even further in this case).

Sample Results

Here are some of the initial images I produced using this method. Because I was looking for shots that exhibited a lot of haze, I ended up working with some of the photos I think are lacking compared to my others, but they are ideal for this testing.

Virtual Filters Applied to Los Angeles
[ Original Image ]
Original Image
[ Virtual Haze Filter ]
Virtual Haze Filter
[ NIR-Enhanced Contrast ]
NIR-Enhanced Contrast
[ Virtual Haze Filter Plus NIR-Enhanced Contrast ]
Virtual Haze Filter Plus NIR-Enhanced Contrast
[ UVA Levels For Virtual Filters Comparison ]
UVA Levels For Virtual Filters Comparison

Los Angeles provides an excellent testbed for these techniques, because its few tall hilltops provide an expansive view of a large, flat area, it is at sea level, and (although conditions have improved greatly since the 1970s and 1980s) still retains a higher-than-normal amount of extra haze due to heavy traffic. See Drive 2007 - Day 04 for the full multispectral set of this image. The "UVA Levels For Virtual Filters Comparison" is a side-by-side comparison of the greyscale ultraviolet-A version with the left half illustrating the levels adjustment that was performed to convert it into a usable mask, as described above.

 
Virtual Filters Applied to the Grand Canyon
[ Original Image ]
Original Image
[ Virtual Haze Filter ]
Virtual Haze Filter
[ NIR-Enhanced Contrast ]
NIR-Enhanced Contrast
[ Virtual Haze Filter Plus NIR-Enhanced Contrast ]
Virtual Haze Filter Plus NIR-Enhanced Contrast
   

Photos of the Grand Canyon are vulnerable to atmospheric hazing due to the extreme width of the canyon, so these methods can pull additional detail out. See Drive 2007 - Day 12 for the full multispectral set of this image.

 

This image of Yosemite incorporates one of many possible variations - instead of creating the "near infrared-enhanced contrast" version, I simply created a file which was a stack of all the spectral bands, with each (other than the background) set to Darker Color, and then applied that as a translucent Overlay layer on top of the original RGB photo.

Virtual Filters Applied to Yosemite
[ Original Image ]
Original Image
[ Virtual Haze Filter ]
Virtual Haze Filter
[ Darkest Overlay ]
Darkest Overlay
[ Virtual Haze Filter Plus Darkest Overlay ]
Virtual Haze Filter Plus Darkest Overlay
 

Like the Grand Canyon, the expansive vistas of Yosemite National Park can easily become obscured due to atmospheric haze. See Drive 2007 - Day 15 for the full multispectral set for this photo.

 
Virtual Filters Applied to Seattle in the Winter
[ Original Image ]
Original Image
[ Virtual Haze Filter ]
Virtual Haze Filter
[ NIR-Enhanced Contrast ]
NIR-Enhanced Contrast
[ Virtual Haze Filter and NIR-Enhanced Contrast ]
Virtual Haze Filter and NIR-Enhanced Contrast
 

Seattle's skyline, although very close to this park, is very difficult to make out through the fog that came along with the snowstorm taking place when this photo was shot. Virtual filtering can restore much of the missing detail. See Seattle for the full multispectral set.

 
 
Footnotes
1. Haze and skylight filters are (or at least were) distinct from so-called "UV filters", which are generally just thin pieces of glass (although just to confuse everyone, some manufacturers use "UV" and "haze" interchangeably). I am not an expert on the subject, but I am extremely skeptical of claims that "UV filters" actually provide any measurable filtration when used with conventional lenses. Unless the lens in question is an expensive, exotic multispectral lens made of e.g. quartz and/or fluorite, there is already so much (UV-filtering) glass in the light-path that adding a millimeter or two more can have only a trivial effect at best. Many photographers use "UV filters" as replaceable protective coverings for the front element of their lenses, and this at least seems somewhat reasonable (although the rear element - where damage matters most - remains unprotected by this method, and I tend to agree with Bob Johnson that it's generally unnecessary unless you are shooting in a hostile environment and/or are careless with your lenses after seeing just how much damage many people manage to inflict on their lenses, if someone wants to do this, they're welcome to do so as far as I'm concerned).
 
[ Page Icon ]