PixInsight 1.5

The Officially Unofficial Reference Guide

Rev.0.1 – 3/29/2010

Section 18: Wavelets


ATrousWaveletTransform (ATWT) is an extremely rich and flexible processing tool that you can use to perform a wide variety of noise reduction and detail enhancement tasks. The à trous (with holes) algorithm of discrete wavelet transform is an elegant and powerful tool for multiscale (multiresolution) analysis of images.

With ATWT you can perform a hierarchical decomposition of an image into a series of scale layers, also known as wavelet planes. Each layer contains only structures within a given range of characteristic dimensional scales in the space of a scaling function. The decomposition is done throughout a number of detail layers defined at growing characteristic scales, plus a final residual layer, which contains the rest of unresolved structures.

By isolating significant image structures within specific detail layers, detail enhancement can be carried out with high accuracy. Similarly, if noise occurs at some specific dimensional scales in the image, as is usual in most cases, by isolating it into appropriate detail layers we can reduce or remove it without affecting significant structures.

ATrousWaveletTransform comprises two main sets of parameters to define the layered decomposition process and the scaling function used for wavelet transforms, respectively.

Wavelet Layers

Dyadic: Detail layers are generated for a growing scaling sequence of powers of two. The layers are generated for scales of 1, 2, 4, 8... pixels. For example, the fourth layer contains structures with characteristic scales between 5 and 8 pixels. This sequencing style should be selected if noise thresholding is being used.

Linear: When selected as Linear, the Scaling Sequence parameter is the constant difference in pixels between characteristic scales of two successive detail layers. Linear sequencing can be defined from one to sixteen pixels. For example, when Linear 1 is selected, detail layers are generated for the scaling sequence 1, 2, 3, ... Similarly, Linear 5 would generate the sequence 1, 6, 11, ...

Layers: This is the total number of generated detail layers. This number does not include the final residual layer, which is always generated. In PixInsight you can work with up to sixteen (16) wavelet detail layers, which allows you to handle structures at really huge dimensional scales. Modifying large scale structures can be very nice when processing many deep-sky images.

Scaling Function: Selecting the most appropriate scaling function is important because by appropriately tuning the shape and levels of the scaling function, you gain full control on how finely the different dimensional scales are separated.

In general, a smooth, slowly varying scaling function works well to isolate large scales, but it may not provide resolution enough as to decompose images at smaller characteristic scales. Oppositely, a sharp, peak-wise scaling function may be very good isolating small scale image features such as high-frequency noise, faint stars or tiny planetary and lunar details, but quite likely it will be useless to work at larger scales, as the global shape of a galaxy or large Milky Way structures, for example.

In PixInsight, à trous wavelet scaling functions are defined as odd-sized square kernels. Filter elements are real numbers. Most usual scaling functions are defined as 3×3 or 5×5 kernels. A kernel in this context is a square grid where discrete filter values are specified as single numeric elements. Here's a more detailed description of the different scaling functions offered in PixInsight's ATWT tool:

See below a 3D plot comparison between the 5x5 Gaussian, 5x5 Peaked and both 7x7 Peaked kernels, as defined in PixInsight:

The window below the pull-down option to define the scaling function will show the generated layers. Individual layers can be enabled or disabled. To enable/disable a layer, double-click anywhere on the layer's row. When a layer is enabled, this is indicated by a green check mark. Disabled layers are denoted by red 'x' marks. The last layer, R, is the residual layer, that is, the layer containing all structures of scales larger than the largest of the generated layers.

In addition to the layer and scale, an abbreviation of the parameters specific to each layer -if defined - are also displayed.

Detail Layer

Bias: This is a real number ranging from –1 to +15. The bias parameter value defines a linear, multiplicative factor for a specific layer. Negative biases decrease the relative weight of the layer in the final processed image. Positive bias values give more relevance to the structures contained in the layer.

Noise Reduction: For each detail layer, specific sets of noise reduction and detail enhancement parameters can be defined and applied simultaneously.

Threshold: The higher the threshold value, the more pixels will be treated as noise for the characteristic scale of the wavelet layer in question.

Amount: When this parameter is nonzero (and Noise Reduction has been enabled), a special smoothing process is applied to the layer's contents after biasing. The noise reduction amount parameter controls how much of this smoothing is used.

Iterations: This parameter governs how many smoothing iterations are applied. Extensive try out work is always advisable, but recursive filtering with two, three or four iterations and a relatively low amount value is generally preferable, instead of trying to achieve the whole noise reduction goal with a single, brute force iteration.

Large-Scale Transfer Function

ATWT lets you define a specific transfer function for the residual layer.

K-Sigma Noise Thresholding

When activated, k-sigma noise thresholding is applied to the first four detail layers. This technique will work just as intended if you select the dyadic layering sequence. The higher the threshold value, the more pixels will be treated as noise for the characteristic scale of the smaller wavelet layers.

Threshold: Defines the noise threshold, that is, it tells ATWT

Amount: Strength of the threshold

Soft thresholding: When enabled, the ATWT tool will apply a soft thresholding of wavelet coefficients instead of the default harder thresholding.

Use multiresolution support: Enable this option to compute the noise standard deviation of the target image.


Considered as a whole, when you use the ATrousWaveletTransform process for detail enhancement, what you are applying is essentially a high-pass filtering process. High-pass filters suffer from the Gibbs effect, which is due to the fact that a finite number of frequencies have been used to represent a signal discontinuity in the frequency domain.

On images, the Gibbs effect appears as dark artifacts generated around bright image features, and bright artifacts around dark features. This is the well-known ringing problem. Ringing is an extremely annoying —and hard to solve— issue in image processing. You probably have experienced this problem as black rings appearing around bright stars after unsharp mask or deconvolution.

However, ringing doesn't occur only around stars. In fact, you'll get ringing to some degree wherever a significant edge appears on your image and you enhance it, including borders of nebulae, galaxy arms, and planetary details, for example. In all of these cases, ringing is actually generating erroneous artifacts as a result of some limitations inherent to the numerical processing resources employed. Whether some ringing effects are admissible or not for a particular image is a matter of taste and common sense.

PixInsight's ATrousWaveletTransform implementation includes an efficient procedure to fix the ringing problem on a per-layer basis. It can be used for enhancement of any kind of images, including deep-sky and planetary.

Dark: Deringing regularization strength for dark ringing artifacts.

Bright: Deringing regularization strength for bright ringing artifacts.

Output deringing maps: Generate an image window for each deringing map image. New image windows will be created for the dark and bright deringing maps, if the corresponding amount parameters are nonzero.

Dynamic Range Extension

Several operations executed during a wavelets transformation – such as a bias parameter - may result in some areas reaching the upper or lower limits of the available dynamic range. The dynamic range extension works by increasing the range of values that are kept and rescaled to the [0,1] standard range in the processed result. You can control both the low and high range extension values independently.

Low range: If you increase the low range extension parameter, the final image will be brighter, but it will have fewer black-saturated pixels.

High range: If you increase the high range extension parameter, the final image will be globally darker, but fewer white-saturated pixels will occur.

Any of these parameters can be set to zero (the default setting) to disable extension at the corresponding end of the dynamic range.

Target: Whether ATWT should be applied over to the luminance only, chrominance only, or luminance and chrominance.


The HDRWT tool is PixInsight's implementation of the High Dynamic Range Wavelet Transform algorithm by PixInsight's Vicent Peris. HDRWT is a multiscale processing tool (HDRWaveletTransform) designed to control the dynamic range of images. While wavelet transformations are able to separate image structures as a function of their characteristic scales, HDRWT is a step forward that further separates and isolates individual wavelet layers and their contained structures. In this way, local contrast of structures defined in a given wavelet layer is not perturbed by larger structures defined in subsequent layers.

It is important to point out that the HDRWaveletTransform process must be tried out on previews that include the full range of brightness values that is present on the whole image; otherwise the obtained results on the preview won't be identical to what will be achieved for the image after applying the same instance.

Number of layers: This parameter is the number of wavelet layers to which HDRWT will be applied, using a dyadic sequence. A value of 6 for example (the default) means that HDRTW will be applied to scales of 1, 2, 4, 8, 16 and 32 pixels (the first 6 layers of a dyadic sequence). A value of 3 will only apply HDRWT to scales 1, 2 and 4.

Number of iterations: The HDRWT algorithm can work iteratively to converge to a solution where the image is completely flat above the scales where it has been applied. Here you define the number of times (iterations) you want to execute the defined HDRWT transformation.

Inverted: Enable inverted HDRWT iterations. This option can be useful to preserve shadow details.

Scaling function: Select a wavelet scaling function. Peaked scaling functions such as linear interpolation work better to isolate small-scale structures. Smooth scaling functions such as cubic B-spline work better to isolate larger scales. For a more detailed explanation of each of these scaling functions, review the documentation about the Scaling Function parameter for the AtrousWaveletTransform process.

To luminance: Apply HDRWT only to the luminance of color images.

Preserve hue: After applying HDRWT, recover the original hues.

Luminance mask: Use a luminance mask to protect dark background regions.


Small-scale: Deringing strength for small-scale ringing artifacts.

Large-scale: Deringing strength for bright ringing artifacts.

Output deringing maps: Generate an image window for each deringing map image. New image windows will be created for the dark and bright deringing maps, if the corresponding amount parameters are nonzero.

Midtones Balance

None: Don't apply a midtones transfer function.

Automatic: Apply an automatic midtones transfer function to recover the original median values.

Manual: Manually specify a midtones balance value, using the Midtones balance option (below these three options).

Back to the Index | Copyright Note