MultiscaleAdaptiveStretch (MAS, for short) is an image delinearization tool based on statistical and multiscale analysis. It has the following goals:
  • Bypassing the traditional PixInsight STF - HistogramTransformation workflow to perform a consistent delinearization in an image set.

  • Apply a robust delinearization based exclusively on statistical properties of the target image. This provides a uniform nonlinear image representation, a basic requirement for composition techniques like LRGB.

  • Preserve the information of the high-contrast structures while maintaining the contrast of a traditional midtones transfer function stretching.
MAS implements some of the techniques I use to delinearize my own pictures, with additional improvements that enable a completely automated processing. The statistical approach and the embedded dynamic range compression avoid the composition mismatch problems we can see in our LRGB composition video series.

Special care has been taken to preserve the Gaussian profile of stars and any other high-contrast, small-scale structure. The dynamic range compression algorithm allows control over how the structures are stretched depending on their contrast. At left, we can see the image stretched with a midtones transfer function (using HistogramTransformation); at right, the same image stretched with MAS:

NGC1514-1.jpg


Usage of MAS is pretty straightforward. We have three main controls:
  • Target background sets the brightness of the sky background. The further to the right, the brighter the background will be. We usually use a sky background level of between 0.1 and 0.20. If the image contains large, extended objects, a higher value (0.25 - 0.40) may be needed.

  • Aggressiveness sets the shadows clipping point. The higher the value, the closer the clipping point will be to the histogram's main peak of the sky background, forcing a more aggressive midtone adjustment to increase the background brightness. Too high values increase image noise, while too low values decrease the overall contrast of the objects.

  • Dynamic range compression controls the contrast of high-brightness areas during adaptive stretching. This parameter modifies how aggressively bright structures are stretched. The function of this parameter is to restore the shape of high-contrast structures, especially preserving the Gaussian profile of stars. Increasing this value will result in smoother stars; values that are too high may affect the contrast of image details—leaving this parameter to 0 results in a pure midtone-based stretching.
The first two parameters are similar to those found in the STF auto-stretch configuration menu, so you'll already be familiar with their usage.

The above image was processed using the following parameters:

NGC1514-1-GUI.jpg


We recommend leaving the Contrast Recovery option enabled in most cases. Leaving it disabled will result in poor overall contrast in the image. I suggest turning it off only in exceptional cases, such as when the object we are photographing has very high contrast, like a planetary nebula or the core of M42. In the case of NGC1514 above, turning off the Contrast Recovery option and increasing the dynamic range compression from 0.4 to 0.7 flattens the planetary nebula:

NGC1514-3.jpg


MAS has a built-in color saturation control. It automates saturation handling with CurvesTransformation. Below you can see MAS applied with color saturation disabled at left and enabled at right:

NGC1514-2.jpg


Here's another example with an M45 image by Edoardo Luca Radice. At left, the result with HistogramTransformation and CurvesTransformation; at right, with MAS:

M45.jpg


The above image was processed using the following parameters:

M45-GUI.jpg


And here's an example of a small field around Barnard 150. At left with HistogramTransformation; on the middle with MAS and Color Saturation disabled; at right with MAS and Color Saturation enabled:

B150.jpg


I don't recommend using the Color Saturation option in objects having a huge dynamic range, such as the HDR composition shown below:

M42-1.jpg


MAS was applied to this image with the color saturation option enabled. Then, we apply HDRMT, revealing the color artifacts. This is not a problem with the tool, but a misuse of it: color cannot be enhanced in this kind of picture before compressing the dynamic range, because some structures will fall outside the color space. We first need to apply HDRMT, then enhance color saturation with CurvesTransformation. The proposed workflow here would be:
  • MAS with Color Saturation disabled.
  • HDRMT to compress the dynamic range.
  • CurvesTransformation to enhance the color with a curve in the S channel.
Applying this workflow, the color saturation artifacts are gone:

M42-2.jpg


The above image was processed with MAS using the following parameters:

M42-2-GUI.jpg


There are two parameters that are better explained with a video tutorial: Scale separation and Boost. I recommend watching the MAS video tutorial we just released:


For detailed mouseover examples, please read the tool documentation within the PixInsight core application.