[ Beneath the Waves ]

Colour Isolation

article by Ben Lincoln

 

In the spring and summer of 2011, a handful of different ideas came together in my mind, and the software at the bottom of this page is the result. It provides a way of increasing the difference between colours in an image, which can make them clearer, brighter, or at least more interesting.

I've tentatively named this technique "colour isolation", because it seems like a reasonably good description of the effect, and to avoid confusion with the term "colour separation", from optical photo-processing.

The full background for this technique is a little lengthy, so feel free to skip ahead. However, I've found that the reaction to the concept as a whole has been "isn't that the same as _______?", so I thought it would be helpful to make the whole thing available here to help answer that sort of question. In short, it's sort of like a lot of things, but not quite like any other technique that I've been able to find references to. It is much simpler mathematically than (for example) Decorrelation Stretch Images, so I was sure that someone else had done it first, but I've come up empty so far. If I'm wrong, please let me know!

Background

Although I've been very happy with the results I've gotten by using a grey card for white-balancing images, I've always been a little frustrated at another aspect of the colours in the photos I've taken over the years: certain colours didn't seem as "real" or vivid as I remembered them as appearing in person. I notice this most in photos of green plants - no matter how green they look to my eyes, they always seem to be more yellow or brown in unprocessed digital photos. I've used various techniques to compensate for this (increasing the saturation, applying different levels, curves, and so on), and was reasonably happy with the results. On the other hand, I always felt like that sort of workaround shouldn't be necessary.

Working with IR- and UV-bandpass filters, I'd realized that while the filters I was using for those were usually chosen with the best filtering out of other spectral bands in mind, the visible light shots were not like this at all - the red, green, and blue sections of my camera's Bayer filter all overlapped to some degree (which is intentional, because our eyes do this too to some degree, but not with the same amount of overlap). There are well-isolated/narrow-band red, green, and blue filters (Baader offer a set, for example), but I really didn't want to take three more shots instead of just one for visible light. An interesting alternative to these are filters made from didymium (which B&W, for example, sell as the #491). These filters pass red more-or-less unimpeded, but have a spikey transmission that blocks most of the overlap between the other colours. They're marketed to photographers as "red-enhancing" filters, and to astrophotographers as "contrast-enhancing" filters.

As I was working on the TMSB Tutorial 4F: Yellow Filter Processing tutorial for The Mirror's Surface Breaks, I started to think about the possibility for using a similar technique to decrease the amount of spectral "overlap" between the adjacent colour channels in a standard photo. An method identical to the yellow filter NIR-R-G processing is not possible, because it depends on having a channel that contains the image to be subtracted from the other two (mixed) channels, but I thought it could be approximated by subtracting some percentage of the adjacent channels from each other. For reasons that may or may not be obvious, this is not identical to using optical filters, but I hoped the results would be useful in some way.

While discussing the subject over at the NikonGear forums, I realized that the same technique could also be viewed from a very different perspective - artificially increasing the difference between the dominant colour(s) in a given pixel and the other colour(s) in the same pixel. For example, if a pixel were greenish-blue (that is, mostly blue, but with a green tint), this type of processing would make it closer to pure blue. The more neutral a colour was, the less it would be affected, meaning the white balance of the image would remain more-or-less unchanged.

This last point convinced me that even if my original theory proved incorrect, I could incorporate a few different options into the software, and if nothing else, it would still (hopefully) be a useful tool for purposes of intentionally changing the colours in an image[4].

Processing Method

The basic algorithm looks something like this:

out1 = (inC1 - (inC2 * c1c2Isolation)) / (1.0 - c1c2Isolation);

out2 = (inC1 - (inC3 * c1c3Isolation)) / (1.0 - c1c3Isolation);

if (out1 > out2)

{

result = (out1 - (inC3 * c1c3Isolation)) / (1.0 - c1c3Isolation);

}

else

{

result = (out2 - (inC2 * c1c2Isolation)) / (1.0 - c1c2Isolation);

}

This is an expansion of the basic equation:

result = (((inC1 - (inC3 * c1c3Isolation)) / (1.0 - c1c3Isolation)) - (inC2 * c1c2Isolation)) / (1.0 - c1c2Isolation);

The expanded form is used so that the lower-fidelity of the two components is subtracted from the higher-fidelity component (rather than vice-versa), which should result in higher overall quality.

This algorithm is called three times. In the most simple implementation:

  1. For the output red level: inC1 = the red value for a given pixel in the input image, inC2 = the green value for a given pixel in the input image, inC3 = the blue value for a given pixel in the input image, c1c2Isolation = how much to isolate red and green from each other, and c1c3Isolation = how much to isolate red and blue from each other.
  2. For the output green level: inC1 = the green value for a given pixel in the input image, inC2 = the red value for a given pixel in the input image, inC3 = the blue value for a given pixel in the input image, c1c2Isolation = how much to isolate red and green from each other, and c1c3Isolation = how much to isolate green and blue from each other.
  3. For the output blue level: inC1 = the blue value for a given pixel in the input image, inC2 = the green value for a given pixel in the input image, inC3 = the red value for a given pixel in the input image, c1c2Isolation = how much to isolate blue and green from each other, and c1c3Isolation = how much to isolate red and blue from each other.

In the software implementation, I added three additional modes that modify this behaviour somewhat: "isolate primary colours", "isolate secondary colours", and "isolate primary and secondary colours" (in addition to the basic behaviour, which I named "unrestricted"). These variations work by capping the maximum output levels in different ways (and, in the case of "isolate secondary colours", performing the operating in CMY colourspace instead of RGB). Please examine the source code for the full logic, or have a look at the comparison images for a more intuitive illustration.

Comparison Images

This first set of images shows the result of the various processing methods (at different levels) on a pair of artificial images based on the "hue wheel". The left image has a lightness gradient applied, and the right image has a saturation gradient applied. The bottom row of each image shows the "end state" of that line of processing, so if you're in a hurry, you can focus your attention there.

Colour Isolation Comparison - Artificial Image
[ Original Image ]
Original Image
[ 0.0/0.0/1.0 ]
0.0/0.0/1.0
[ 0.0/1.0/0.0 ]
0.0/1.0/0.0
[ 0.0/1.0/1.0 ]
0.0/1.0/1.0
[ 1.0/0.0/0.0 ]
1.0/0.0/0.0
[ 1.0/0.0/1.0 ]
1.0/0.0/1.0
[ 1.0/1.0/0.0 ]
1.0/1.0/0.0
[ 1.0/1.0/1.0 ]
1.0/1.0/1.0
 

The numbers (0.0/1.0/0.0) refer to the red/green, green/blue, and red/blue isolation multiplier, respectively. For example, "1.0/1.0/1.0" means a value of 100% is used for all three parameters.

 

Note that at or below 50% overall isolation, the "unrestricted" method actually isolates the primary and secondary colours to their own areas of the hue wheel more smoothly than the "isolate primaries and secondaries" method, but above 50%, primary colours disappear entirely. The "isolate primaries and secondaries" option is more quantized, resulting in the odd geometric mandala pattern that I modified to use as the icon for this article[2].

For comparison, here are some images that show different levels of saturation and "vibrance" (Adobe's mysterious variation on saturation) applied to the same pair of images:

Saturation and Vibrance
[ Saturation and Vibrance ]
Saturation and Vibrance
       

For comparison, the same artificial image showing the result of different saturation and vibrance increases.

 

A photo of my friend Raw Garbage's fluorescent artwork provides a real-world example of the various results:

Colour Isolation Comparison - Photograph
[ Original Image ]
Original Image
[ 0.0/0.0/1.0 ]
0.0/0.0/1.0
[ 0.0/1.0/0.0 ]
0.0/1.0/0.0
[ 0.0/1.0/1.0 ]
0.0/1.0/1.0
[ 1.0/0.0/0.0 ]
1.0/0.0/0.0
[ 1.0/0.0/1.0 ]
1.0/0.0/1.0
[ 1.0/1.0/0.0 ]
1.0/1.0/0.0
[ 1.0/1.0/1.0 ]
1.0/1.0/1.0
 

The original photo is from the Stencil Art by Raw Garbage article. The numbers (0.0/1.0/0.0) refer to the red/green, green/blue, and red/blue isolation multiplier, respectively. For example, "1.0/1.0/1.0" means a value of 100% is used for all three parameters. Note: these images are fairly large (2460 x 2664) in order to show the detailed differences between variations.

 

With the basic technique in hand, I decided to see how well it could approximate an image shot with a didymium filter.

As expected, the results are not identical, but I would consider them in the same general "class" of effect.

The 1.0/0.7/0.2 (100% red/green isolation, 70% green/blue isolation, 20% red/blue isolation) values were obtained by tweaking the sliders until the results looked "right" (using a variety of test images, and compared to what I would expect to see with my own eyes). Interestingly, this is fairly close to the amount one would want to reduce the "overlap" of the red, green, and blue filters in my D70 if they were to come up with filters that did not overlap at all.

The differences in this set of images may be somewhat subtle at first glance, but pay attention to the red of the wood on the building close to the camera, the blue of the window in the building behind that, the green of the grass on the far shore, and the red of the rust on the old gasworks equipment (also on the far shore), among other things. The final version illustrates the "special effects" usage of this processing method, in which the image has been transformed into something that looks like it appeared on early colour television, or a late-60s film/concert poster[3].

Didymium Filter Comparison
[ ND Filter Only ]
ND Filter Only
[ ND + Didymium (Stack Profile/Stack WB) ]
ND + Didymium (Stack Profile/Stack WB)
[ ND + Didymium (ND Profile/Stack WB) ]
ND + Didymium (ND Profile/Stack WB)
[ ND + Didymium (ND Profile/ND WB) ]
ND + Didymium (ND Profile/ND WB)
[ Colour isolation variation 1 ]
Colour isolation variation 1
[ Colour isolation variation 2 ]
Colour isolation variation 2
       

This isn't a great shot, art-wise, but it has a variety of colours and distances from the camera. The photo is of Lake Union in Seattle (looking north towards Gasworks Park). The first version is as shot through a 3.0 (1000x) neutral density filter. The second through fourth images are variations of a shot through the same ND filter, but with a B&W didymium filter stacked on top. The second image uses a colour profile and white balance created using this filter combination. The third image uses a colour profile created using just the ND filter, but white balance from the stacked combination. The fourth uses a colour profile and white balance created with the ND filter alone (and the result is obviously wrong - it is included only for comparison). The fifth image is the original (ND-only) shot, processed using the "colour isolation" method (unrestricted mode, 1.0/0.7/0.2 at 25% overall) to approximate the look of a didymium filter (specifically, the variation with the ND-only colour profile but the didymium-filter white balance, since it was the most "red-enhanced", to my eyes). The final image also uses the "colour isolation" method, but to the point of absurdity (56.4% overall).

Date Shot: 2011-04-12
Camera Body: Nikon D70 (Modified)
Lens: Nikkor-Q 200mm f/4
Filters: LDP CC1, B&W ND 3.0, B&W 491 "Redhancer"
Date Processed: 2011-05-30
Version: 1.0

 

Since didymium filters are marketed (to regular photographers) as "red enhancers", here are some examples of this "pseudo-didymium filter" on a few photos of tree leaves in autumn.

Autumn Colours Colour Isolation
[ Original RGB ]
Original RGB
[ After isolation ]
After isolation
[ Comparison Grid ]
Comparison Grid
[ Original RGB ]
Original RGB
[ After isolation ]
After isolation
[ Comparison Grid ]
Comparison Grid
[ Original RGB ]
Original RGB
[ After isolation ]
After isolation
[ Comparison Grid ]
Comparison Grid
 

A few images from The Colours of Autumn, processed using the "colour isolation" method (unrestricted mode, 1.0/0.7/0.2 at 30% overall). Note: the comparison grids are quite large.

Date Shot: 2009-10-24
Camera Body: Nikon D70 (Modified)
Lens: Nikkor-Q 200mm f/4
Filters: LDP CC1
Date Processed: 2011-05-29
Version: N/A

 

Multispectral Comparison Images

As I'd hoped, pre-processing the red/green/blue image with this technique can help improve the distinction between colours in multispectral composites as well. In the following sets of images, only the human-visible (RGB) image has been processed - the near infrared and/or ultraviolet-A components are the same between all variations.

In the (large) comparison grids, the images are divided into four major columns (one for each variation on the colour isolation method), and each of those columns is three images wide (Red-Green-Blue, Near Infrared-Red-Green, and Green-Blue-Ultraviolet-A variations).

The effect is not guaranteed, but note in particular the trees on the shore of this first set. In the NIR-R-G false colour image created from the unprocessed R-G-B image, they all appear essentially the same colour, but when created from a pre-processed R-G-B image, it becomes much easier to see the distinction between them.

Eastern Washington Colour Isolation
[ R-G-B ]
R-G-B
[ R-G-B at 40% isolation ]
R-G-B at 40% isolation
[ NIR-R-G [3C] ]
NIR-R-G [3C]
[ NIR-R-G from 50% isolated R-G-B [3C] ]
NIR-R-G from 50% isolated R-G-B [3C]
[ G-B-UVA [3C] ]
G-B-UVA [3C]
[ G-B-UVA from 50% isolated R-G-B [3C] ]
G-B-UVA from 50% isolated R-G-B [3C]
[ Comparison Grid ]
Comparison Grid
     

A shot of the Columbia River from near Ginkgo Petrified Forest State Park before and after processing via the "colour isolation" method (unrestricted mode, 1.0/0.7/0.2). See the discussion in the main text regarding the false colour variations. Note: the comparison grid is quite large.

Date Shot: 2008-08-26
Camera Body: Nikon D70 (Modified)
Lens: Nikon Series E 28mm (?)
Filters: LDP CC1, RG1000 or B&W 092, Baader U-Filter
Date Processed: 2011-05-29
Version: N/A

 

The near infrared-based variations of these next two sets didn't benefit much from pre-processing the human-visible bands, but the ultraviolet-A images certainly did.

Hurricane Ridge Colour Isolation
[ R-G-B ]
R-G-B
[ R-G-B after isolation ]
R-G-B after isolation
[ G-B-UVA [3C] ]
G-B-UVA [3C]
[ G-B-UVA created from isolated R-G-B [3C] ]
G-B-UVA created from isolated R-G-B [3C]
[ Comparison Grid ]
Comparison Grid

A shot from Hurricane Ridge in Olympic National Park before and after processing via the "colour isolation" method (unrestricted mode, 1.0/0.7/0.2 at 40% overall). See the discussion in the main text regarding the false colour variations. Note: the comparison grid is quite large.

Date Shot: 2009-08-20
Camera Body: Nikon D70 (Modified)
Lens: Nikon Series E 35mm (?)
Filters: LDP CC1, RG1000 or B&W 092, Baader U-Filter
Date Processed: 2011-05-29
Version: N/A

 
Midway Geyser Basin Waterfall Colour Isolation
[ R-G-B ]
R-G-B
[ R-G-B - 40% isolation (unrestricted) ]
R-G-B - 40% isolation (unrestricted)
[ R-G-B - 40% isolation (primary colours) ]
R-G-B - 40% isolation (primary colours)
[ G-B-UVA [3C] ]
G-B-UVA [3C]
[ G-B-UVA - created from the 40% unrestricted R-G-B [3C] ]
G-B-UVA - created from the 40% unrestricted R-G-B [3C]
[ G-B-UVA - created from the 66% unrestricted R-G-B [3C] ]
G-B-UVA - created from the 66% unrestricted R-G-B [3C]
[ G-B-UVA - created from the 50% primary colours R-G-B [3C] ]
G-B-UVA - created from the 50% primary colours R-G-B [3C]
[ Comparison Grid ]
Comparison Grid
[ R-G-B - special effect ]
R-G-B - special effect
[ G-B-UVA - special effect [3C] ]
G-B-UVA - special effect [3C]

One of my photos from Yellowstone National Park before and after processing via the "colour isolation" method (1.0/0.7/0.2). See the discussion in the main text regarding the false colour variations. Note: the comparison grid is quite large. A pair of "special effects" variations performed using unusual colour isolation settings (unrestricted mode, settings approximately 1.0/0.15/0.1 at 60% overall) are included because I thought they looked interesting.

Date Shot: 2009-08-20
Camera Body: Nikon D70 (Modified)
Lens: Nikon Series E (unknown focal length)
Filters: LDP CC1, RG1000 or B&W 092, Baader U-Filter
Date Processed: 2011-05-29
Version: N/A

 

More Uses

2011-12-03: I was processing the RGB image from the first image in the Poppies (Papaver) article, and with the default value for the colour isolation Pixel Bender file, I noticed that the processing made the veins on the petal pop out dramatically, making them much easier to map. In addition, high levels of processing made visible grains of pollen on the petals which I hadn't even seen until then.

Poppy Petal Vein and Pollen Contrast-Enhancement
[ Unprocessed image ]
Unprocessed image
[ 30% colour isolation, unrestricted ]
30% colour isolation, unrestricted
[ 63.5% colour isolation, primary colours ]
63.5% colour isolation, primary colours
[ 63.5% colour isolation, unrestricted ]
63.5% colour isolation, unrestricted
[ Full-resolution detail - no processing ]
Full-resolution detail - no processing
[ Full-resolution detail - 30% colour isolation, unrestricted ]
Full-resolution detail - 30% colour isolation, unrestricted
[ Full-resolution detail - 63.5% colour isolation, primary colours ]
Full-resolution detail - 63.5% colour isolation, primary colours
[ Full-resolution detail - 63.5% colour isolation, unrestricted ]
Full-resolution detail - 63.5% colour isolation, unrestricted
   

More images from this series are in the Poppies (Papaver) article. All colour isolation used the default settings other than overall percentage and mode.

Date Shot: 2011-07-03
Camera Body: Nikon D70 (Modified)
Lens: EL-Nikkor 80mm f/5.6 (metal-bodied) at f/?
Filters: LDP CC1, B&W 491 "Redhancer"
Date Processed: 2011-12-03
Version: 1.0

 

Try It Yourself

Currently, there are two download options for this software: as an Adobe Pixel Bender filter, or an add-on for The Mirror's Surface Breaks/DaVinci's Shadow.

The Pixel Bender format is preferable for most users, because it is easy to get feedback in realtime, and it can be used with any Adobe product that supports the format (Photoshop®, AfterEffects®, et cetera). Photoshop® users will need to download the Pixel Bender Plug-In (it's free!) to use this filter. Note that you may encounter limitations regarding the size of images that can be processed (especially depending on your computer hardware). I haven't run into trouble with the 6MP images from my D70, but if you have a fancy newer camera you should give it to me! may need to scale your images down first.

Note also that the sliders use the 0.0 - 1.0 floating-point convention instead of 0% - 100%. If you are not familiar with this, 1.0 = 100%, 0.9 = 90%, and so on.

Screenshots
[ Pixel Bender Filter Screenshot ]
Pixel Bender Filter Screenshot
       

 

 

The second option makes the necessary functionality available to both DaVinci's Shadow (the script processor), and The Mirror's Surface Breaks. You can use it in TMSB with the included configuration file, or call the colourIsolation() function directly from within the DaVinci's Shadow command-line interface.

For use in TMSB, you will need to customize the variables in the Process-Custom-Colour_Isolation.xml file.

To use the function in DaVinci's Shadow directly, the syntax is (assuming your output object should be named "result", your input image is named "rgb", and you want to use the default values from the Pixel Bender version):

output = colourIsolation(rgb, mode="u", master=0.5, rg=1.0, gb=0.7, rb=0.2)

Replace "u" (unrestricted) with "p" for "primary colours" mode, "s" for "secondary colours" mode, or "ps" for "primary and secondary colours" mode. The master parameter is the overall multiplier for the effect strength. rg controls the red/green isolation, gb controls the blue/green isolation, and rb controls the red/blue isolation.

 
Download
File Size Version Release Date Author
Colour Isolation Filter in Adobe Pixel Bender Format 3 KiB 1.0 2011-05-30 Ben Lincoln
Includes source code.
 
Download
File Size Version Release Date Author
Colour Isolation Filter in TMSB/DShadow Format 24 KiB 1.0 2011-05-30 Ben Lincoln
 
 
Footnotes
1. Among other things, separate red, green, and blue exposures mean that common white-balancing tools in software become a lot harder to use.
2. I'd been watching a lot of old Doctor Who episodes, and the highly-ordered pattern made me think of something that would have appeared on that programme in the 70s or 80s as the emblem of some sort of "colour isolation space fascists", so I decided to run with that idea.
3. But it's not the same as just increasing the saturation! Interestingly, early colour television cameras apparently had trouble with accurate colour reproduction because their colour filters provided too much isolation between red, green, and blue.
4. Did you know that the vocoder (one of the most beloved effects processors in electronic music and science fiction entertainment) was originally designed as a way to squeeze more voice traffic onto telephone lines? Secondary purposes really can be more successful!
 
[ Page Icon ]