PixInsight - De-Linearize or Stretch

MAS - Multiscale Adaptive Stretch

updated: 2025-12-31

MSC Release date: 2025-12-31

MultiscaleAdaptiveStretch (MAS, for short) is an image delinearization (stretching) tool based on statistical and multiscale analysis. MAS implements a set of rigorous, robust, yet easy-to-use, image stretching, contrast recovery, and color saturation algorithms within a dedicated PixInsight process with full real-time and static preview capabilities. Thanks to its robustness and adaptability, MAS enables entirely automated processing. The MAS algorithms were designed by Vicent Peris, and the implementation was authored by Roberto Sartori. The documentation was written by Edoardo Luca Radice and Vicent Peris.

picture: PI_MAS_DefaultSettings

Controls:

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.

Contrast Recovery

It is recommended to enable the Contrast Recovery Option, because disabling it may result in poor image contrast.

Color Saturation

Default: enabled

Enables or disables the saturation enhancement step. When enabled, the tool applies a curve transformation to the saturation channel in HSV color space, increasing color vibrancy while protecting the background from chrominance noise amplification.

The saturation enhancement uses a specially designed curve that allows to select whether to boost only the mid-range saturation values or focus the enhancement on the least saturated pixels.

Recommendation: Enable for color images where natural color enhancement is desired. Disable if you prefer to perform color adjustments manually.

Important note: It is not recommended to enhance the color with this option in images with a high dynamic range because color clipping may occur in the highlights. In these cases, the recommended workflow is to stretch the image with the color saturation section disabled, then compress the dynamic range using HDRMT, and applying a color saturation curve with CurvesTransformation.

Example (North America Nebula - NGC 7000 - Starlust - Photos)

Using PixInsight Autostretch


Picture: PI_AutoStretch_Example

Using MAS default settings (see screenshot above)

Picture: PI_MAS_DefaultStretch

Using MAS settings:
Agressiveness: 1.0

Color Saturation Amount: 1.0

Color Boost: 1.0


Picture: PI_MAS_BoostStretch

Resources

Created with the Personal Edition of HelpNDoc: Create Professional CHM Help Files with HelpNDoc's Easy-to-Use Tool