Hi Sara
Some centuries ago I wrote a PixelMath tutorial:
http://pixinsight.com/tutorials/PixelMath/en.htmlwhich is now pretty obsolete but may be useful to get your feet wet with this tool.
Using PixelMath is much simpler than it may seem at first glance. The first important thing to remember is that each image has a unique identifier (read: a name) in PixInsight. By default an identifier based on the image's file name is assigned when you open a file, but you can change it to something more manageable by double clicking on the main view's selector (a view selector is the vertical tab at the left side of the image window). For example, let's say you assign the following identifiers to your red, green, blue and hydrogen alpha images, respectively:
R
G
B
Ha
Then the following PixelMath expressions would allow you to mix one half of the Ha image with the R channel:
(R + Ha)/2
G
B
As Rob has said you have to disable the "Use a single RGB/K expression" option of PixelMath to enable the three expression slots. You should also disable "Rescale result" in this case to preserve the original channel data. To execute this PixelMath expression you have several options. The simplest one is to create a duplicate of one of the images, convert it to the RGB color space (Image > Color Spaces > Convert to RGB Color), and apply the PM instance to it. A better option is setting the following options in the Destination section of PM:
Create new image: enabled
Image width: <as target>
Image height: <as target >
Color space: RGB color
Sample format: 32-bit floating point
and then apply PM to one of the images (no matter which one; the target image is only used to acquire the width and height in pixels in this case).
Mixing red and Ha by equal parts usually yields quite poor results. Let's say you want to create your red channel as a 25% of red and the rest of Ha, which seems more reasonable. These expressions do the trick:
0.25*R + 0.75*Ha
G
B
As you see, the PixelMath language is very similar to common algebraic notation. You can refer to the 'target image', that is to the image to which you apply PM, as $T (or equivalently $target). $M (or $mask) stands for the active mask image of the target image. Most of the time PixelMath is used in 'single expression' mode, that is defining a single expression that is applied to all nominal channels of the image, but in these cases we need separate expressions to control how each channel is generated.
Now that you know how to use PixelMath to blend your Ha with your red channel data, you know how to implement the
worst way to carry out this task
Why is this the wrong way? Because a plain mix of red and Ha data leads to two important problems: star images are damaged or lost (because stars are much smaller and dimmer in the Ha image), and the signal-to-noise ratio of the resulting image is severely degraded.
A somewhat better result can be obtained with a maximum operator applied to the red and Ha images. In PixelMath terms:
max( R, Ha )
G
B
which requires that both R and Ha images be
statistically compatible. You can achieve this with the LinearFit tool: just select one of the images as reference and apply LinearFit to the other image. The maximum operation solves the problem with the stars, but it doesn't fix the noise transference problem. Now that you have more information on this topic, you may be interested in the
correct way to merge Ha and red data:
http://pixinsight.com/tutorials/narrowband/theory/en.htmlHope this helps.