PixInsight Tips: Narrow Band Combinations with PixelMath – HOO
One of PixInsights most powerful features is PixelMath. This innocuous seeming tool is actually the heart of an extensive set of functions and functionality that allows you to apply mathematical formulas to each and ever pixel in an image, sourcing one or more images as input, and even allowing you to access and process the individual channels. One often overlooked yet extremely handy use case for PixelMath is narrow band channel combinations, or even NB+LRGB combinations. With PixelMath, the options are limitless, and you might even be able to put some of the built in math functions to use to produce complex blends or solve common problems that arise with narrow band imaging.
Channel Blending Basics
Channel blending is the process of taking individual grayscale narrow band channels, such as Ha and OIII, and combining them together to produce a full color image. One of the simplest and most common blends is the HOO blend, which maps Ha to red, and OIII to green and blue, while other common blends are SHO which maps SII to red, Ha to green and OIII to blue and HSO which maps Ha to red, SII to green and OIII to blue. With PixelMath, however, you can perform far more complex blends, create more accurate “natural palette” blends, customize common blends or even come up with your own unique personal blends. You can also perform cross-blends, which are the subject of another article.
One of the key factors of blending narrow band channels with PixelMath for me is it can be done on the linear data. I find linear channel blending produces the best results for me, particularly on the star front. PixelMath can be used to blend any data, linear or non-linear. However, one of the potential pitfalls with non-linear blends is the star profiles can end up being stretched very differently for different channels. This often results in strong colored halos, frequently blue if the telescope does not handle blue dispersion well. With a linear blend, when the data has been properly prepared, star halo issues can be greatly mitigated. While this is not a cure for a poorly corrected telescope, it can help minimize issues.
My primary recommendation with PixelMath channel blends is to perform your blends on linear data, rather than non-linear data. Proper use of curves can do wonders for tonal and color distributions after the combination has been stretched, almost on the same order as star removal and classic tonemapping such as that done by Metsaviano. However star removal need not be necessary with hue-based mapping.
Prepping your Data
First thing about channel blending with PixelMath (PM from here on) is the channels must be both registered, and linear fit. Without both, you may end up with some odd results, and would have to resort to more complex math to get a reasonable blend as any offset in the channels can result in one or two channels completely dominating the others. With registration, reset the process and use one of the narrow band channels as a reference (I usually use Ha, however any will usually do unless it is overly weak), and use the triangle icon to apply to the other channels. Once you have the registered channels, you will want to fit them using LinearFit, which you can read about here.
For linear fit, I recommend fitting to the weakest channel. I have found that fitting to the strongest channel can result in worse SNR when the channels are combined, and possibly other problems. One thing to watch out for when doing this is to make sure no signal tails clip. The strongest channels should actually have the least noise, which should mean it’s shadow noise tail is smaller than the rest, however sometimes that may not be the case. Depends on the data. Once the data is fit, apply the same STF to each. I prefer to apply the Ha stretch to the other two, as that seems to give me the best visualization of noise differences.
Once you have all the channels aligned and stretched the same, you can verify that the channels are prepared for combination by stacking pairs of the windows, and using the CTRL+PGDN hotkey to swap between them. Stars and structures should overlay properly, and if you notice any major discrepancies, you either missed registering a channel, or a channel misregistered and you’ll want to fix that first. You should be able to identify structural differences between different channels. There will usually be some structural differences. SII and Ha often have very similar structure, however Ha will often include additional whispy and cloudy structure on top of the well defined and more solid structures evident in SII. OIII can often be quite different, existing as more tenuous, diffuse, and whispy or cloudy structures.
The HOO or “Natural Color” Blend
This is probably the most common narrow band blend. It is possible with only two narrow band channels, Ha and OIII, and as such is a key choice for beginners who often start with just these two filters. To perform this basic blend with PixelMath, configure it as so (trading the image names ‘Ha’ and ‘OIII’ for your own image names…make sure you reference the registered images):
Select one of the registered images and then apply by hitting the square icon in the lower bar of the PM dialog. Since we have configured PM to create a new image, it will use the current window as a reference for image width, height and bit depth (sample format), however it will be color instead of grayscale. Alternatively, you can drag the triangle icon to one of the registered channel images. Using this “naive” approach to the basic HOO blend, you might end up with something like the following…with potential small differences depending on the S/N strength of each channel:
With the “naive” approach the red channel will usually be fairly strong, while the oxygen may not quite have an ideal color. You may also find that your stars are a bit blue-green. A lot of the results will depend on the relative strengths of your channels, and a weak OIII may not exhibit with the best color. You can mitigate the blue-green color issue somewhat by using a more “natural” blend. A true natural blend will mix some amount of Ha into the blue channel to represent the Hydrogen-beta emission. This will pink up the Ha a bit, which many will find more appealing.
Exactly how much to blend really depends on the target, as Hb emissions are temperature dependent, and being bluer can also be scattered more by interstellar dust. Most commonly I will blend 15-20% Ha into the blue channel…in the case of my test image here, I blended 15% (and consequently, had to reduce my OIII contribution to 85%):
While this can give you a more realistic hydrogen color, it actually doesn’t help much with the green star issue. There are many ways to fix the stars, however one of the things I like to do is blend some Ha into the green channel as well. I often blend 20% Ha and 80% OIII in the green channel.
This helps to balance out the star color a little, and will mute some of the excessive pink color to the Ha. You may find the Ha color gets a little too reddish-orange…however there are easy fixes for that using curve adjustments. In general, any blend you create with PixelMath will often looks “soft” and almost pastel initially. Don’t worry so much about the initial color, as that can all be tweaked with curves, in particular the saturation, hue, and contrast curves.
This is looking a bit better…not so much green in the stars, they are more blue and neutral, with some red in the smaller background stars.
Sometimes you just won’t be happy with a “standard” blend. You may just not like how the color turns out, or you may simply want to flex your creativity. PixelMath gives you total freedom over your blends, so you can combine the channels however you please. I often prefer to create a customized HOO blend where my ratios for Ha in both the green and blue channels are higher:
By blending 35% into green and a bit more into blue, I get more of an orange/blue blend rather than a red/blue-green blend. This is similar to the modern and more bi-colored “Hubble Palette” blends that render SII and Ha as orange and OIII as blue…however achieved with only two channels instead of three:
You will likely notice in most cases that once you have your initial blend they are softer. They usually won’t have crisp, brilliant color right off the bad unless you have packed a huge amount of integration time into each channel, particularly into the OIII. This is because the noise from the weaker channels will diffuse through the image, and instead of crisp and shiny you have soft and diffused. There is still a bit of green in my custom HOO blend above, and neither the blue nor the orange really have that kind of punch I think so many look for with their narrow band images. Personally I prefer some amount of “softness” to my NB images, however I to like some brighter colors. This can be corrected with some basic curves work:
By boosting saturation a bit, shifting colors to blue in the b* chroma channel, and applying some hue curve tweaks to make oranges more orange and blues more blue, while pulling back on the greens, I am able to arrive at a richer and more color correct NB blend:
The reduction in green also helps improve the color contrast between the blue and orange, enhancing the differences in their structure. For crisper, smoother, brighter results, integrate more and/or apply some noise reduction to your data. Noise diffuses microcontrast, so less noise should help create crisper results. As a small note…for best results, most curves work should be done on the image after it has been stretched. Curves, particularly a* and b* chroma channel curves, can be overpowering on linear data, and are much easier to use on non-linear data.
If you happen to have some SII data, you can try creating a tri-channel variant of the classic HOO blend. Many thanks to Goofi of the CN Beginners & Intermediate Imaging forum, this blend is a great way to use a weaker SII channel to help create a blend with more balanced star color and more concentrated reds. This blend injects some SII data into the red channel, while leaving the rest of the blend the same as the “natural” variant:
An example of the differences with the standard natural blend, demonstrating tighter concentration of the Ha/SII energy into the structures and more neutral star colors:
You can always experiment with custom blends, with any number of channels. If you also have NII, you can try injecting that into a standard HOO blend as well, and if you have a full four channels, the options only expand further.
That’s it for this article! However, it is just the beginning of using PixelMath to perform narrow band channel blends. An article on the punchy and psychedelic SHO blend is coming, which will be followed up by an article covering the complicated and fussy HSO blend.