Your deep sky companionYour deep sky imaging companion
Stretching your stacked image in Siril
A freshly stacked image looks almost black, and the picture is hiding in it. Stretching brings it out. This guide shows what the controls in Siril do, what happens when you go too far, and how many stretches to use, with a demo you can play with.
Your camera records light in proportion to how much arrives. In a deep-sky image almost all the pixels are dim: the sky background and the faint nebula sit down near black, and only the stars are bright. The histogram shows this as one tall hump crammed against the left edge.
Stretching is a re-mapping of brightness. It spreads those crowded dark values apart and leaves the bright end mostly alone, so faint detail comes up to where your eyes can see it. It does not add any information. It only reveals what the stack already holds, which is why a clean, well-calibrated stack stretches so much better than a noisy one.
In Siril you will see the stack in a stretched display most of the time. That is a preview only. Until you apply a stretch tool, the data in the file is still linear.
Some steps need linear data, so do them first. In Siril they are in the Image Processing menu.
Crop the ragged edges
Stacking leaves uneven, noisy borders. Crop them off first so they do not fool the background and color tools or end up stretched into bright seams.
Remove the gradient
Light-pollution gradients are easiest to model while the data is still linear. Siril's Background Extraction does this. After a stretch, a gradient is much harder to remove cleanly.
Calibrate the color
Photometric Color Calibration (for color cameras or filters) works on linear data. Siril's own notes warn against unlinked auto-stretching after color calibration because it changes the white balance.
Keep a linear copy
Save the image as a FITS file before you stretch. Anything done after stretching cannot be undone in the file, and a linear copy lets you start over without re-stacking.
This is a pretend stacked image: a nebula, stars and a faint glow, still linear. Press a Watch button to see the sliders move the way they do in Siril’s Histogram Transformation window, or drag them yourself.
- Sky level: 4%
- Clipped to black: 0.0%
- Newly burned to white: 0.0%
The image and its numbers are made up for this demo, and the sliders use the same midtone formula as Siril’s Histogram Transformation, so the shapes you see are realistic. Real data will differ in the details.
Siril has four ways to stretch. They are all in the Image Processing menu, and they all do the same basic job. The difference is how much control you get.
Histogram Transformation
Three sliders: shadows, midtones, highlightsShadows sets the black point, highlights sets the white point, and midtones moves the middle brightness up or down without touching either end. Siril also shows the percentage of pixels the change clips. The same dialog has an Auto-stretch button.
Best for: The simplest tool and the best place to start. Use it to learn what a stretch does. Siril's documentation says the Auto-stretch button is rarely advisable to use as it is.
Asinh Transformation
A stretch factor and a black pointA single strength control (the stretch factor, from 1 up to 1000) that lifts faint signal strongly while treating bright areas gently. By default it blends the stretch with the image's brightness so star colors are kept.
Best for: Quick, and good at keeping star color. Less control than the other tools, because there is only one strength control.
Generalised Hyperbolic Stretch (GHS)
D, b, SP, LP and HPD is the strength. SP, the symmetry point, is the brightness where the stretch is strongest. b sets how concentrated the stretch is around SP. LP protects the shadows and HP protects the highlights so stars do not bloat.
Best for: Siril describes it as the most capable tool, built for several small adjustments instead of one big one. It has more settings, but a few stretches with it give the cleanest results.
Curves
Drag points on a curveBend the brightness curve by hand. It can be used for contrast, for adjusting the black and white points and for targeting one brightness range.
Best for: A finishing tool. Siril's documentation says it works best on an image that is already stretched.
Menu names and options can change between Siril versions. This page follows Siril’s current documentation (1.4). Check the dialog on your own copy if a label looks different.
- Shadows (the black point). Slide it to the right until it sits just below the left foot of the sky hump. Siril’s auto-stretch places it about 2.8 sigma below the peak, which is a good place to start. Watch the clipped-pixels percentage and keep it very small.
- Midtones. This is the main control. Slide it left to brighten, and lower numbers mean a stronger stretch. It never clips anything by itself. Stop when the sky has moved off the left edge and the faint detail is just visible.
- Highlights. Usually leave it at 1.0. Pulling it down brightens everything and burns the top end to white.
- Use the toolbar. The log view and the X zoom make the crowded left part of the histogram easier to read. If you set a region of interest (ROI), the histogram will not show the effect on the preview, so clear the ROI before judging the result.
- Apply. Nothing changes in the image until you click Apply. Then look at the new histogram and decide whether to go again.
Use the “Jump to” buttons in the demo above to see each of these on the pretend image. A stretch that is slightly too far looks fine on a phone screen and falls apart on a large one.
The sky turns gray and the contrast goes flat
Push the sky much past about a third of the way up the scale and the background stops looking like space. The faint nebulosity you were trying to show sits on a gray wash and is harder to see.
Noise is stretched along with the signal
A stretch boosts everything that is faint, including the random noise in the sky. A hard stretch turns fine grain into blotches, and colored noise into green and magenta patches.
Stars swell and lose their color
Every star has a faint outer halo. A strong stretch pulls that halo up until the star becomes a big white blob, hiding small stars and neighboring detail. This is the reason Siril's notes recommend early stretches that are gentle rather than auto-stretch strength.
Bright cores burn to white
The brightest areas, like a nebula core, run out of room at the top of the scale. Once they reach pure white the structure inside them is gone. Saving the file does not bring it back.
Crushing the blacks cuts off real data
Moving the shadows slider too far right sets all the faint pixels below it to pure black. The sky looks clean and dark, but the faintest dust and nebula edges have been deleted along with the noise. The clipped-pixels readout in Siril is there to warn you.
How to tell you have gone too far: the hump of the sky sits past about a third of the way across, the clipped percentage is more than a fraction of a percent, stars look like soft discs, or the nebula’s bright area has no texture left.
Do several small stretches, usually two to four, and look at the result after each one. Stop when the sky sits at roughly 10 to 25 percent and the faint detail is visible.
Honestly, the math is the same: stretching the midtones twice by a little each time gives about the same curve as stretching once by a lot. The benefit of going in steps is not a better formula. It is that you stay in control.
- You re-measure the histogram after each one, so you do not guess how far to go.
- You can stop at the first sign of noise, bloating stars or clipping, and undo just that step.
- You can use different tools for different jobs: a gentle GHS or histogram stretch first, a small one with the highlights protected next, then Curves for contrast.
- You can reduce noise or adjust color between steps, when it is easiest to see.
Siril’s documentation takes the same approach for GHS: early stretches should be gentle, with the symmetry point just left of the main peak, a fairly high b value of about 6 or more and only a small increase in D. Then repeat with small adjustments rather than one big one.
One stretch is fine for a quick look, to check that a stack worked or that a target is there. For the version you will share, take it in steps.
- Crop, remove the gradient and color-calibrate. Save a linear FITS copy.
- First stretch (gentle). In Histogram Transformation, set the shadows just below the sky hump and lower the midtones until the sky is about 8 to 10 percent. Or use GHS with SP just left of the peak, b of about 6 or higher and a small D. Apply.
- Look at the image and the histogram. Check the clipped percentage and the stars.
- Second stretch (small). Measure again, since the hump has moved. Lift the midtones a little more, and if the stars are swelling, lower HP in GHS to protect them. Apply.
- Optional third. A last small lift. Stop as soon as the faint detail is visible and the sky is a dark gray.
- Finish with Curves for contrast and color saturation. Save the result as a new file.
- Why is my stacked image almost completely black?
- Stacked data is linear: the brightness values are proportional to the light collected, and in a deep-sky image nearly all of the pixels are very dark. Your screen needs those values spread out to show them, and that spreading is a stretch. Siril's viewer can show a temporary auto-stretch so you can see the image, but that does not change the data until you apply a stretch.
- Should I stretch once or several times?
- Several small stretches, usually two to four. Mathematically, repeated midtone stretches add up to one big one, so the advantage is control. You can stop and look after each one, re-measure the histogram, protect the stars and the bright core, and avoid pushing past the point where the image falls apart. A single large stretch is quick, but if it goes too far you have to undo it and start again.
- What should the histogram look like when I'm done?
- A common target is a clear gap between the left edge and the sky's hump, with the hump sitting roughly 10 to 25 percent of the way across for a dark-gray sky. The bright end should have only a small tail of stars, with no pile-up against the right edge. These are guidelines, not rules, and your taste and the target both matter.
- Is the Auto-stretch button good enough?
- It is a useful way to see what is in the data, and Siril's own documentation says it is rarely advisable to use as it is. It tends to stretch strongly in one step. Use it for a preview, or as a starting point you then adjust.
- Which is better, Histogram Transformation, Asinh or GHS?
- None is better in every case. Histogram Transformation is the easiest to learn. Asinh is fast and keeps star color. GHS gives the most control over where the stretch happens and how much to protect the shadows and stars. Many people start with Histogram Transformation, then move to GHS as they want more control.
- Do I stretch before or after removing stars?
- Star removal tools such as StarNet usually work best on linear or lightly stretched data, so check the tool's own instructions. If you stretch the starless image and the stars separately, you can push the nebula hard without bloating the stars, and then put them back together. This is an advanced step, so get comfortable with one image first.
- Can I fix an overstretched image?
- Not fully. If you saved a linear copy, go back to it and stretch again more gently. If you only have the stretched file, you can darken the sky with the shadows slider or Curves, but clipped stars and burned cores cannot be recovered, and noise that was boosted stays.
See where stretching fits in the whole processing workflow. Still planning the shoot? Read the histogram guide for exposure, or the calibration frames guide.