Stretching Images with MultiscaleAdaptiveStretch
Turn a dark linear image into a visible, permanently stretched image. Learn the main MAS controls, compare a first trial, and protect faint detail and bright structures as you refine the result.
Sources reviewed October 25, 2026
What does stretching mean?
A stacked astronomical image often looks almost black even when it contains plenty of useful signal. In a linear image, bright and faint features occupy a range that a normal display cannot show comfortably all at once. Stretching redistributes those brightness values so faint structures become visible.
ScreenTransferFunction (STF) changes the display without altering the image pixels. MultiscaleAdaptiveStretch (MAS) applies a permanent nonlinear transformation. After applying MAS, the image is no longer the linear master used for operations such as SPCC.
MAS combines stretching with optional contrast recovery and color-saturation controls. This exercise separates them: first make an assessable stretch, then decide whether the optional refinements help. A dramatic preview is not the same as a well-preserved result.
1. Save a ready-to-stretch checkpoint
Start with an integrated image whose intended linear processing is complete. For broadband RGB, finish the relevant gradient correction and color calibration first. Keep a saved linear master, such as Target_RGB_linear_ready.xisf, and work on a duplicate.
For this first exercise, you can leave the stars in the image. Star removal is not required by MAS. If you already have a starless image and a separate stars image, keep both and preserve the original full image; their stretches and eventual recombination need their own checks.
Inspect unwanted borders, residual gradients, and obvious calibration problems before stretching. MAS makes faint signal and faint defects easier to see; it does not replace background correction or add exposure time.
Use the current official PixInsight updates. MAS is a built-in process, not a third-party repository installation, and it does not require Gaia or MARS files just to stretch an image. Background Reference and Contrast Recovery controls differ between releases, so check the installed process help when a control is missing.
2. Open MAS and make a simple first trial
Open Process → IntensityTransformations → MultiscaleAdaptiveStretch, or find it under All Processes. Category wording may vary by release. Activate your full working image, reset a reused MAS instance, and reset or disable STF on that image.
The example below is a learning trial, not a vendor default or a universal preset. The important habit is to change one thing at a time and compare fresh duplicates of the same linear checkpoint.
- Turn Background Reference off initially. Turn Contrast Recovery and Color Saturation off so you can assess the stretch without those extra adjustments.
- For an example trial, set Target background to 0.15, Aggressiveness to 0.70, and Dynamic range compression to 0.40. If your image needs a very different stretch, use the controls as described in the next section rather than forcing these values.
- Open MAS’s Real-Time Preview using its labeled preview control or tooltip. Start from the full image rather than a tiny extracted crop. Inspect both the overall composition and bright features.
- When the preview is reasonable, close the preview and apply MAS once to the working image using Apply to active view, or drag its New Instance triangle onto the image.
- Reset STF again if needed. Inspect the actual stretched image with STF off and save Target_RGB_MAS_trial01.xisf. It should remain visible without an automatic screen stretch.
3. Understand the three main controls
Target background sets the desired background level used by the transformation. Raising it generally makes the background brighter. It is a normalized image-level target, not a percentage of exposure or a promise that every background pixel will equal that value. Lowering it until the sky looks black can conceal faint dust and emission.
Aggressiveness influences the shadow-clipping point and the resulting midtone adjustment. A stronger setting can make faint structures more prominent, but can also expose noise and sacrifice shadow information. Check dark lanes and faint outskirts rather than judging only the bright subject.
Dynamic range compression changes how bright structures are rendered relative to fainter ones. Use it to evaluate bright cores and stellar profiles; too much can make the result look flat. It cannot recover detail that was already saturated in the acquired data.
Try one alternate value on a fresh duplicate, leaving the other settings fixed. Name the trials and compare them with STF off, at the same zoom. Avoid repeatedly stretching the previous trial while deciding on an initial MAS setting.
4. Use Background Reference only when you can identify background
A field dominated by bright nebulosity or a galaxy can make a whole-image background estimate unrepresentative. If the image has a genuine background area, create a preview over a representative patch that avoids stars, halos, extended objects, and stacking edges.
Enable Background Reference and use From Preview to transfer that region into MAS. Check that the selected preview belongs to the current target image. The region guides background estimation; it does not mean the stretch will be applied only inside that rectangle.
Do not select the darkest dust lane merely because it is dark, and do not invent an empty-sky patch when the object fills the frame. Leave this option off and assess the full image if you cannot identify a suitable reference.
A background reference does not remove a gradient. If one side of the image is much brighter or a strong color wash becomes visible, revisit the linear background-correction checkpoint rather than hiding it with a darker stretch.
5. Add contrast recovery as a separate experiment
Once the basic stretch is useful, compare a second trial with Contrast Recovery enabled. Keep the main stretch settings fixed so you can tell what this option changes. Version 1.1 adds an Intensity control for adjusting its strength.
Scale Separation determines the division between smaller and larger structures used by the recovery operation. Read its tooltip and use the large-scale component preview, if available, to understand which structures fall on each side of that division. Do not copy a scale from an image with a different pixel size or framing without checking it.
Judge the full-image result for local contrast, texture, bright boundaries, and dark rims. Reduce the effect or leave it disabled if it looks harsh. Contrast recovery is optional, including for a detailed nebula or galaxy.
Small preview regions can produce a different result from full-image multiscale processing. Use previews to inspect details, but confirm the stretch and contrast behavior on a full-image trial before keeping it.
6. Treat saturation as optional finishing
Keep Color Saturation off while establishing the stretch. If you later enable it, compare a modest adjustment with the unsaturated trial. Inspect faint background color, bright star cores, and high-intensity nebular regions for unnatural patches or clipped color.
Saturation enhancement is not color calibration. It cannot correct a wrong camera/filter response, replace SPCC, or reconstruct color lost in saturated pixels. Leaving it off and using a separate, controlled color adjustment later is a valid choice.
For a grayscale luminance image, concentrate on tonal structure rather than color controls. For separate starless and stars layers, avoid assuming that one stretch strength suits both. Preserve their color and bright profiles and check the combined result using the recombination method chosen for the workflow.
7. Inspect before accepting the stretch
With STF off, look at the whole frame first. The subject should be readable without the background dominating. Then inspect stars, bright cores, dark lanes, faint outer structure, and background texture at 1:1.
Use HistogramTransformation or another histogram view to inspect the image without applying another transformation. Check for a substantial pile-up at the black or white endpoints, and inspect individual RGB channels as well as the combined view. Some pixels can legitimately reach an endpoint; a large new loss of detail is the concern.
Compare with the preserved linear source under a suitable display-only STF to check whether faint structures existed before the stretch. For comparisons between MAS trials, turn STF off on both and keep zoom and framing consistent.
Keep the version that makes structure visible without crushed shadows, flat white cores, exaggerated noise, or distracting halos. A slightly quieter first stretch often leaves more room for careful finishing.
Common problems and quick checks
Everything turns very bright or looks washed out: reset STF first. Check whether MAS was applied twice or applied to an image that was already permanently stretched. Return to the saved linear checkpoint for a fresh trial.
Dust disappears or dark lanes become solid black: compare with the linear source and inspect the histogram. Try a less aggressive stretch rather than forcing a black background.
Bright cores look flat: inspect compression and saturation choices, then compare with the source for acquisition clipping. Stretching cannot restore an already saturated core.
The result is noisy or blotchy: a stronger stretch can expose limited signal and residual gradients. Reduce the push, review earlier processing, and distinguish real faint structures from noise before adding smoothing or contrast.
The applied image differs from a preview: verify the target, STF state, background-reference coordinates, and full-image versus cropped-preview context. Check that a diagnostic large-scale preview was not mistaken for the finished image.
MAS or a control is missing: finish official updates and read the installed documentation and release notes. Do not install an unrelated stretch tool’s repository just because it has a similar name.
Save a nonlinear checkpoint and continue
Save the retained result as Target_RGB_stretched.xisf and keep the original linear-ready file. Save the MAS process instance and record whether Background Reference, Contrast Recovery, and Color Saturation were enabled, along with their settings.
Continue with finishing adjustments appropriate to the image. If you need to redo linear-only measurements or calibration, return to the linear file rather than trying to make the stretched result linear again.
The references below introduce MAS and its version 1.1 improvements. Use the installed process documentation for exact parameter definitions and defaults in your release. This lesson provides an original practice sequence; its example values are not a tested guarantee for every dataset.
See the technique in practice
This lesson is public. Detailed project workflows and dataset downloads require an active membership. Dataset selections follow your membership allowance; reading a workflow does not use a selection.
Cocoon Nebula: the LRGB processing workflow
See this technique in the recorded Cocoon Nebula IC 5146 workflow. Use that project’s documented order, retained settings, and limitations.
Member-only processing guide
Open member guide →View member dataset →Member-only download · selection allowance applies
Finding the detail in the dust
See this technique in the recorded Iris Nebula NGC 7023 workflow. Use that project’s documented order, retained settings, and limitations.
Public overview · Member-only detailed workflow
Explore story and member workflow →View member dataset →Member-only download · selection allowance applies
Finding the Lion in gold, cyan and blue
See this technique in the recorded Lion Nebula Sh2-132 workflow. Use that project’s documented order, retained settings, and limitations.
Public overview · Member-only detailed workflow
Explore story and member workflow →View member dataset →Member-only download · selection allowance applies
Let the shell stand alone
See this technique in the recorded Crescent Nebula - NGC6888 workflow. Use that project’s documented order, retained settings, and limitations.
Public overview · Member-only detailed workflow
Explore story and member workflow →Finding the Pelican in blue and gold
See this technique in the recorded Pelican Nebula - IC5070 workflow. Use that project’s documented order, retained settings, and limitations.
Public overview · Member-only detailed workflow
Explore story and member workflow →