Hi everybody,
A number of users have recently asked how a high-pass filter can be implemented or applied in PixInsight. The answer is straightforward: use ATrousWaveletTransform as a low-pass filter and PixelMath to subtract low-frequency components. The screenshot below shows an example.
In this screenshot we have:
-
test - This is the original image.
-
low_pass - The low-frequency components. This is the result of applying the ATrousWaveletTransform instance shown, which simply removes the first five wavelet layers.
-
high_pass - The high-pass filtered image. This is the result of subtracting low_pass from the original image. The subtraction has been performed with PixelMath.
You can vary the degree of high-pass filtering by varying the number of wavelet layers removed and the scaling function in ATW. Obviously, you can also apply the PixelMath instance through a mask (a luminance mask for example) to restrict high-pass filtering to high-SNR areas.
For programming-oriented people, I leave a JavaScript implementation of this high-pass filter as an exercise. It should not require more than 8 - 10 relevant lines of source code.
Now, before someone asks for this to be implemented as a dedicated tool, the question is: why? Why do you need such a rough tool in PixInsight, if you have a sophisticated wavelets processing tool (ATW)? What I have described above is a naive implementation of a high-pass filter (which is identical to the high-pass filter so famous in other applications). Besides being much less versatile and efficient than wavelets, such a naive implementation has an important drawback: ringing. The
Gibbs phenomenon will cause dark rings to appear around all jump discontinuities in the image, such as stars. Our ATW tool has an efficient deringing feature that can prevent these problems very easily.
Anyway, now you know how to do it in PixInsight. Another exercise that we can bring up is how to implement a band-pass filter in PixInsight?