Home > Photography > Virtual Filters
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.
- Copy the ultraviolet-A version of an image into a new file.
- 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.
- 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).
- 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.
- 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.
- 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.
- 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.
- Flatten this image (or merge the layers).
- 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.
- 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.
- Change the compositing mode of the new ultraviolet-A layer to Difference.
- Flatten/merge the image again.
- 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).
- 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.
- Add a layer mask or alpha channel to this new layer.
- Copy the UVA mask and paste it into the layer mask or alpha channel you just created.
- Change the compositing mode of the resulting layer to Overlay.
- 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".
- 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).
- Copy the near infrared variation of the image and paste it in as a new layer in the file with the desaturated RGB background.
- Invert the colour of the NIR layer (again, since it should be greyscale, this is just inverting the brightness).
- Change the compositing mode of the NIR layer to Difference.
- Flatten/merge the file.
- 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.
- Add a layer mask (alpha channel) to this new layer, and paste the UVA mask image into that layer mask or alpha channel.
- Change the compositing mode of the resulting layer to Overlay.
- 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.
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.
Related Articles:
Taking Multispectral Pictures
Aligning Multiple Exposures in Hugin
Postprocessing
Reducing and Eliminating Hotspots
Drive 2007 - Day 04
Drive 2007 - Day 12
Drive 2007 - Day 15
Seattle