Self-built gradient-removal pipeline: comparison vs PixInsight WBPP (Coma Cluster + Leo Triplet, identical data)

Dirk BauschVinWei-Hao Wang
24 replies568 views
Dirk Bausch avatar

---

UPDATE (16 May 2026) — please read before responding:

The framing I should have started with: this post is about two different ways to remove background gradients — doing it before stacking (per individual exposure) versus after stacking (on the final master).

Why this matters: A single exposure usually has a simple gradient — light pollution from one direction, a vignette ring, an atmospheric brightness slope. When many exposures with slightly different framing and rotation are stacked, those simple gradients combine into a more complex pattern in the final master. The stacking step itself can turn easy-to-fix gradients into harder-to-fix combined patterns.

- Post-stack tools (GraXpert, AutoDBE, GC, MARS) work on the integrated master after stacking. They model whatever pattern ended up there. Works well when the field has clearly empty sky to use as reference.

- Pre-stack (this pipeline) works on each exposure individually, before integration. Catches gradients while they're still simple, and works even when the final stack has no empty sky regions.

Where pre-stack demonstrably helps:

- Faint structures become more visible. Pre-stack gives a cleaner background floor, which lets you stretch the image more aggressively to bring out galaxy halos, tidal features, faint IFN — without the background going "blotchy" alongside the signal. On dense Hα fields like NGC 6888, pre-stack achieves the best combination of low background noise plus preserved diffuse nebula structure. It's the only method tested where faint structures end up ~21% more visible than in the no-BG baseline; post-stack tools at default cut more of the per-pixel signal alongside the BG, ending up between −4% and −25% in net visibility on this regime. On cleaner Coma-class galaxy fields, post-stack tools at default work similarly well — the pre-stack advantage shows up specifically when fields are crowded with diffuse signal.

- Heavily light-polluted data (Bortle 7-8 LP + vignette + moon): pre-stack achieves ~4× less residual gradient than the best post-stack tool at default (controlled test with synthetic gradient injection earlier in this thread).

- Dense narrowband nebula fields (NGC 6888 in Cygnus, suggested by @Wei-Hao Wang as a stress test): all gradient removal methods reduce the real diffuse Hα emission to some degree, but pre-stack loses noticeably less of it (~10% per pixel) than post-stack tools at default (20-35%). The diffuse structure is independently confirmed by professional surveys (IPHAS DR2 and Stefan Ziegenbalg's Northern Sky Narrowband Survey) — pre-stack matches those references better.

Where it doesn't help much: dark-sky data with weak gradients, or isolated galaxy targets — any tool at default works fine.

Retractions from earlier in the thread: "+0.7-1.2 mag deeper" and "8-14× flatter" — both were against the no-BG baseline, not against actual gradient-removal tools. @andrea tasselli and others correctly flagged this as apples-to-bananas. The advantage of pre-stack vs proper BG tools is real at stressed conditions and dense fields, marginal at clean ones.

Pre-stack as part of a toolbox, not a replacement:

- Pre-stack as an architecture isn't tied to this specific implementation. Any of the existing tools — GraXpert, AutoDBE, GC, MARS — can in principle be applied per-sub before stacking, instead of (or in addition to) the integrated master. The pipeline position is what creates the architectural advantage, not the specific algorithm. ABYSS is one implementation (wavelet-based BG modeling, Borlaff+2019 style) showing the principle works; running existing tools per-sub would give similar architectural benefits with their respective algorithmic tradeoffs. The methodologically interesting point is "before vs after stacking", not "my tool vs your tool".

- Post-stack workflow (applying tools to the integrated master) covers most amateur use cases well at default settings.

- MARS (Vicent Peris, PixInsight) is the architecturally cleanest post-stack approach for difficult fields — it automates what @Wei-Hao Wang has been doing manually for two decades (taking a wider-field reference image first).

- Pre-stack is a complementary architecture for harder cases (heavy LP, dense nebula fields), not a universal replacement.

Original post text below remains for context with existing replies.

---

Hi all,

Over the past months I've been developing a custom reduction pipeline focused on background gradient removal. The motivation was simple: I wanted to stretch faint structures (galaxy halos, tidal features, IFN) more aggressively without amplifying background gradients or other artifacts.

Existing tools didn't quite get me there. I find DBE tedious and error-prone in practice — manual sample placement is a lot of work and easy to get wrong, especially around large galaxies or extended nebulosity. GraXpert and multiscale gradient tools are faster but often don't give me the result I want, and it's hard to understand why the algorithm decided what it decided. And none of them address the per-sub flat-fielding stage where many gradient problems originate.

So I built something based on the ABYSS approach from professional deep imaging surveys (Borlaff et al. 2019, A&A 621, A133): multi-pass background fitting with source-masked sky flats per sub, conservative gradient removal designed to preserve extended low-surface-brightness signal. Implementation with GPU acceleration.

The practical result: backgrounds are flat enough that aggressive stretching no longer reveals processing artifacts. Faint structures survive the background fit instead of being subtracted with it.

Comparison images — Pipeline vs PixInsight WBPP on identical subs:

📷 Coma_Abyss.jpgComa_Abyss.jpg📷 Coma_Wbpp.jpgComa_Wbpp.jpg

The Coma Cluster comparison shows the most striking visual difference — hundreds of cluster member galaxies that are barely visible in the WBPP output emerge cleanly in the pipeline output, along with faint diffuse signal in the cluster core consistent with intracluster light reported in deep imaging surveys.

📷 M65_Abyss.jpgM65_Abyss.jpg📷 M65_Wbpp.jpgM65_Wbpp.jpg

The Leo Triplet output shows similar improvements with documented structures — the NGC 3628 stellar halo and southern tidal plume are clearly visible in the pipeline output but not in WBPP at identical stretch.

Both comparisons use the same calibrated subs after identical quality filtering. Stretching applied identically. No BXT, NXT, or any post-processing on either side — what you see is the stack output directly.

Quantitative summary:

  • 5σ detection depth: +0.7 to +1.2 mag deeper than WBPP (Gaia DR3 photometric calibration)

  • Background spread: 8-14× flatter

  • For Leo Triplet: 95% of the pipeline's additional detections have a direct PanSTARRS DR1 counterpart, confirming they're real sources rather than artifacts

  • Pipeline tested with pure-noise input (no spurious structures created) and mock-source injection (correct faint-source recovery)

Setup: SkyWatcher Esprit 120ED, QHY268M Mono, Bortle 5 skies. Coma: 432 ×120s subs. Leo Triplet: 376×120s L after quality filtering.

For now I'd genuinely appreciate critical feedback. Especially:

  1. Anyone seeing issues in the comparison images I'm missing?

  2. Suggestions for additional validation targets ?

  3. Experiences with similar approaches?

Happy to discuss methodology in the thread.

Clear skies, Dirk

Well written Helpful Insightful Respectful Engaging
Tony Gondola avatar

I would really like to see what your workflow is for this as you’re right, it’s the key for getting everything in the data out. Especially for those of us who image under less than pristine skies.

Well written Respectful Engaging Supportive
Jake Turner avatar

I also would love to have more insight into the workflow. The results on first look seem quite impressive! I have an image of the Leo Triplet as well where I just could not manage to get the tidal tail to show. I would be really interested in seeing what this method could do with my data.

Validating on an IFN rich target would be nice to see as well. Polaris is pretty rich with it and always accessible, though I know imaging Polaris can come with other challenges you may not want to deal with for this purpose.

Really interested in seeing how this develops!

Well written Respectful Engaging Supportive
Vin avatar

Those comparison results look v strong. And yes with you on the potential for improved gradient reduction tools. If you want I have about 14hrs data on a very faint IFN field in Virgo if you want to try running it on that. Or another good candidate if you want to image yourself would be M104 on a widefield - there’s a dimmer halo and IFN around it but its a tough thing to extract without either blowing things out, or getting artefacts.

Well written Helpful Respectful Concise Engaging Supportive
Victor Van Puyenbroeck avatar

The approach looks promising but your comparison images are not a good example in my opinion.

You should show:

  • The original WBPP image.

  • How your algorithm performs against other gradient removal tools like DBE, MSGC or Graxpert.

  • A ground truth reference image for the background that shows any large scale low surface brightness features that should be preserved during gradient correction.

Well written Helpful Concise Engaging
andrea tasselli avatar

WBPP is no gradient removal tool so those comparisons are meaningless. Compare against the outcome of known gradient tools and we’ll see how it goes…

AstroGadac avatar

Curious to try as I have some image with remaining gradients I just can't get rid off, living in Bortle 8

Joseph Biscoe IV avatar

Well if nothing else, this makes me very curious about the ABYSS process. So far your comparisons seem very promising. Especially with galaxy images. I am curious about the details of the methodology (I downloaded the paper for some reading later) and how ABYSS compares to Local Normalization/ Normalize Scale Gradient. These latter methods being gradient simplifiers, I wonder how much more accurate the ABYSS based method would be.

Well written Respectful Engaging Supportive
Dirk Bausch avatar

@Victor Van Puyenbroeck, @andrea tasselli — you're both right, and thank you for the pushback. The WBPP-only comparison was not the fairest demonstration. WBPP doesn't do post-stack BG removal, so comparing against it shows the absence of any gradient tool, not the quality of the Abyss like algorithm against the established tools.

I'm currently running a controlled comparison study with identical pipeline up to and including StarAlignment + LocalNormalization, varying only the gradient removal step:

  • Pipeline A: WBPP standard (no BG removal — current baseline)

  • Pipeline B: WBPP + DBE (manual sample placement)

  • Pipeline C: WBPP + GraXpert

  • Pipeline D: WBPP + GC (GradientCorrection)

  • Pipeline E: My pipeline applied post-stack (algorithm comparison)

  • Pipeline F: My pipeline applied pre-stack (architectural comparison)

Same calibrated subs, same StarAlignment, same LocalNormalization, same ImageIntegration, same stretching — only the BG removal step differs. Follow-up post coming with quantitative comparison (MAD, low-frequency residual variance, autocorrelation at large scales) and side-by-side visuals across all 6 pipelines.

The "8-14× flatter" claim was specifically vs raw WBPP and I should have stated that more clearly. Against DBE/GraXpert/MGC the gap is smaller in raw MAD but likely very different in spatial residual structure — which is the perception-driving metric. I'll show both.

Thank you valuable critique.

Well written Helpful Insightful Respectful Engaging
Dirk Bausch avatar

@Tony Gondola, @Jake Turner, @Joseph Biscoe IV — thanks for the methodology interest. Brief overview of the workflow:

The pipeline is a multi-scale wavelet implementation of the ABYSS architecture (per-sub pre-stack BG modeling, Borlaff et al. 2019). Mathematically: each frame gets its own background model via à-trous starlet decomposition, with the BG defined as wavelet scales above ~17 arcmin (cutoff configurable). Source masking via NoiseChisel on the preliminary stack, back-projected onto each frame's native pixel grid before applying the wavelet decomposition. Subtraction happens uniformly (including under sources, with the local sky interpolated from neighboring sky pixels via block-median fill).

Where it differs from LocalNormalization and NSG (Joseph): LocalNorm/NSG normalize photometric variations between subs but assume BG is already removed. My pipeline doesn't replace them — it adds a per-sub BG removal step before they run, addressing time-varying gradients (moon, LP rotation, atmospheric variation) that those tools by design don't touch.

@Vin — yes, very interested in your 14hr Virgo IFN data. That would be an outstanding test case for a target type where my pipeline could potentially struggle (faint extended LSB at scales near the cutoff). Could you share? Would include results in the follow-up post.

@Jake Turner — Polaris/Mu Cep region is on the list. Will plan an imaging session next clear winter.

Well written Helpful Insightful Respectful Engaging
Vin avatar

Dirk Bausch · May 15, 2026 at 07:17 AM

@Vin — yes, very interested in your 14hr Virgo IFN data. That would be an outstanding test case for a target type where my pipeline could potentially struggle (faint extended LSB at scales near the cutoff). Could you share? Would include results in the follow-up post.

Ok I’ll DM you a dropbox link to 3 files - R, G & B masterfiles (the only thing that they’ve had done to them is calibration of the underlying lights w darks, flats, and dark flats - and then stacking - in APP).

I can’t understand the subtleties of the maths processes you describe above, but all I know is that if an improved version of gradient removal can be developed, that’s great! Will you also compare your approach to the PI Multiscale GC (although that seems to have big chunks of sky that are not covered by it yet sadly)?

Dirk Bausch avatar

Thanks Vin — small but important clarification before you send: my original post specifically claimed the per-sub pre-stack stage as the architectural differentiator. Stacked masters alone would test only the algorithm in post-stack mode — useful, but doesn't demonstrate what I actually claimed.

For the proper pre-stack test I'd need a subset of individual calibrated subs (post-Bias/Dark/Flat in APP, pre-StarAlignment) rather than the masters. A single filter is enough — say 20-50 L subs if you have them (IFN is broadband, so L is ideal); R or G works fine if no L. That keeps the download manageable.

If individual subs aren't easily accessible from your APP archive — the masters are still useful and I'd run them through post-stack mode for the MGC/GraXpert algorithm comparison you mentioned. But pre-stack on calibrated subs would actually test what I claimed in the original post.

Either way: thanks for the offer — results with attribution in the follow-up.

Well written Helpful Respectful Engaging Supportive
Vin avatar

No worries @Dirk Bausch - DM sent with dropbox links for 50 R files (sorry I don’t shoot L, only RGB separately). Fingers crossed your approach works well.

Concise Supportive
ValeryL avatar

Interesting work for many for us living in suburban areas. You could dilpay starless images for better comparaison of faint ifn structures. That’s what i usually do when i compare tools on a new stack. Then i compare results with picture of people with a lot of data took in no light polluted skies ;)

Dirk Bausch avatar

Brief follow-up addressing what came up in the thread.

## The proper comparison

@andrea tasselli was right: comparing against WBPP-only wasn't the right test. So I ran a controlled gradient injection — Urban LP + vignette, ~94 ADU spread across the integrated stack, 230-530 ADU per individual sub. This is hopefully representative of typical Bortle 7-8 LP+vignette conditions (most amateur observers).

Same 50 calibrated subs, four tools at default settings, integration through to master:

📷 l2_real_comparison.pngl2_real_comparison.png

Visually clear: GraXpert, AutoDBE, and GC at default all reduce the gradient but leave visible residual structure. Pre-stack ABYSS produces a flat result.

Quantitatively (BG residual peak-to-peak on the integrated stack):

| Tool | residual | reduction |

| L2 BEFORE | 94.3 ADU | — |

| GC default | 39.8 ADU | 2.4× |

| AutoDBE default | 23.2 ADU | 4.1× |

| GraXpert default | 12.5 ADU | 7.5× |

| ABYSS pre-stack | 3.4 ADU | 27.4× |

Pre-stack achieves ~4× lower residual than the best post-stack default. On clean Bortle-5 data (Coma cluster from the original post) the gap is marginal — pre-stack matters specifically when the gradient is severe enough to stress post-stack assumptions.

---

## To specific commenters

@ValeryL — good suggestion on starless comparison. I'll do that for the IFN test (it's the right view for faint diffuse signal). For this gradient comparison the integrated stretched images already make the residual visible without starless, but for ICL/IFN preservation the starless view is more informative.

@Tony Gondola, @Jake Turner, @Joseph Biscoe IV — workflow is as described: per-sub à-trous starlet decomposition + NoiseChisel source masking, applied before integration; sits before LN/NSG, doesn't replace them. Uses open source tools.

---

## What I'm retracting from earlier in the thread

- "+0.7 to +1.2 mag deeper" — that was against WBPP without BG removal. Against actual BG-correction tools at clean conditions the gap is marginal (~0.07 mag).

- "8-14× flatter" — also against the no-BG baseline. Against GraXpert default at clean conditions it's ~16%.

The pre-stack architecture matters at stressed conditions, not universally. Proof of concept rather than pre-stack gradient removal is best.

---

## Where this doesn't help (and what's still untested)

- Hardware artifacts (focuser light leaks, internal reflections) — fix the hardware first

- Cellular/discontinuous gradient patterns — pre-stack uses smooth multi-scale priors and will fail

- Clean Bortle-5 conditions — no meaningful advantage over otgher gradinet removal tools at default

- Extended-nebula targets where most of the frame is signal (large emission nebulae filling the field, wide-FOV nebulosity, dense IFN-rich regions): the source-masking step requires enough sky-only pixels to fit a meaningful BG model. If the source mask covers >70-80% of the frame, the fit becomes unreliable. ABYSS hasn't been tested on this regime — open question

- Limited dataset coverage so far: N=2 (Coma cluster + controlled synthetic injection). Generalization to other targets, filters, sky conditions, RGB Bayer-pattern data, and multi-night campaigns with varying conditions remains open

Multi-scale wavelet BG modeling itself isn't novel (Bertin+1996, Borlaff+2019, similar in class to PI's GC). What's specific here is two things:

1. Pipeline position: per-sub, pre-stack. Adam Block has discussed in his educational content the principle that fixing issues in the data pre-stack can make data useable. Pre-stack gradient correction may be a natural extension. This pre-stack slot in WBPP isn't currently filled by post-stack tools, so the architectural distinction is real even though the algorithm class is shared.

2. Mathematical reproducibility: ABYSS is a deterministic analytical pipeline (à-trous wavelet decomposition + sigma-clipped sky fit + NoiseChisel masking). Same input → same output, every time. The algorithm steps are mathematically specified and auditable end-to-end. Useful in any context where the BG correction needs to be traceable. Complements rather than replaces tools optimized for ease-of-use or general-purpose convenience.

This could in principle be implemented natively in PI as a complement to GC/DBE/LN/NSG before the integration stage.

Clear skies,

Dirk

Well written Helpful Insightful Respectful Engaging
Wei-Hao Wang avatar

Dirk Bausch · May 16, 2026 at 07:04 AM

📷 l2_real_comparison.pngl2_real_comparison.png

I never imaged in Bortle 7-8. For those who did, please comment on whether this kind of weird background pattern is really typical.

My general comment is that so far all your example images are fields of small galaxies. This is not very challenging. All the other tools you tested were designed to tackle much more challenging cases: fields with large nebulas. For example, your 2025 top pick, NGC6888 (nice image BTW), could be a good target for testing. I am very curious what you will get if you dig out the pre-gradient removed image of that and run your new algorithm.

The most fundamental issue in gradient removal is to separate structures that belong to real celestial objects and that belong to gradient. The former should be kept while the latter should be removed. Fields of small galaxies are easy because the galaxies are much smaller than the characteristic size scale of the background gradient. In other words, the galaxies can be well above the S/N threshold within a small area where gradient is almost negligible, and therefore they can be easily masked out. That’s why most extragalactic surveys don’t even need the method described by Borlaff et al. The true challenge comes when your targets and background gradient all share similar characteristic sizes and brightness and when there is little source-free background area in the image to construct a robust gradient model. All the other tools you tested were actually geared toward solving such challenging cases (with different approaches). Based on the example above, your tool seems to be able to handle the small-scale structure in the complex background pattern (I even hesitate to call it “gradient”) and remove it cleanly. This naturally leads to the question of what if such smaller-scale structures are actually nebulas? Is you tool smart enough to leave them and not removing them? This is why I suggest to use your own NGC6888 as a test target.

Well written Helpful Insightful Engaging
AstroGadac avatar

Wei-Hao Wang · May 16, 2026, 08:12 AM

Dirk Bausch · May 16, 2026 at 07:04 AM

📷 l2_real_comparison.pngl2_real_comparison.png

I never imaged in Bortle 7-8. For those who did, please comment on whether this kind of weird background pattern is really typical.

My general comment is that so far all your example images are fields of small galaxies. This is not very challenging. All the other tools you tested were designed to tackle much more challenging cases: fields with large nebulas. For example, your 2025 top pick, NGC6888 (nice image BTW), could be a good target for testing. I am very curious what you will get if you dig out the pre-gradient removed image of that and run your new algorithm.

The most fundamental issue in gradient removal is to separate structures that belong to real celestial objects and that belong to gradient. The former should be kept while the latter should be removed. Fields of small galaxies are easy because the galaxies are much smaller than the characteristic size scale of the background gradient. In other words, the galaxies can be well above the S/N threshold within a small area where gradient is almost negligible, and therefore they can be easily masked out. That’s why most extragalactic surveys don’t even need the method described by Borlaff et al. The true challenge comes when your targets and background gradient all share similar characteristic sizes and brightness and when there is little source-free background area in the image to construct a robust gradient model. All the other tools you tested were actually geared toward solving such challenging cases (with different approaches). Based on the example above, your tool seems to be able to handle the small-scale structure in the complex background pattern (I even hesitate to call it “gradient”) and remove it cleanly. This naturally leads to the question of what if such smaller-scale structures are actually nebulas? Is you tool smart enough to leave them and not removing them? This is why I suggest to use your own NGC6888 as a test target.

These are much stronger gradients than what I experience in Bortle 8-9. I have less trouble with emissions nebula thanks to narrowband imaging so this is a very interesting endeavour still imo.

@Dirk Bausch I can provide Bortle 8-9 mono or osc raws with calibration frames from a range of targets if needed.

Helpful Supportive
Die Launische Diva avatar

Dirk Bausch · May 16, 2026, 07:04 AM

📷 l2_real_comparison.pngl2_real_comparison.png

My gut feeling is that the weird patters are result of improper flat calibration and/or stray light. While I don’t image from high Bortle skies (I’m blessed with Bortle 5 skies), I have seen similar patters when my flats weren’t made properly (uneven illumination) or having a neighbor’s/street light shining towards my gear.

For areas lacking nebulosity one can go as flat as possible by placing a multitude of DBE sample points away from stars and small sources. Of course this is a very boring task but is “easy” since there is no large-scale nebulosity to be confused with parasitic light.

Well written Helpful Respectful Concise Engaging Supportive
Dirk Bausch avatar

Wei-Hao,

your framing was exactly right. I took NGC 6888 literally — Baader 3.5 nm UNB, 87×300s, ~7.3h. Honestly? On targets like this I had usually skipped post-stack gradient correction anyway, because the results always felt unsatisfying. Your comment forced me to ask why methodically.

Two things came out of it.

First, the field really is BG-free in Hα. Stefan Ziegenbalg's Northern Sky Narrowband Survey shows the entire FOV filled with diffuse Cygnus-X filaments — there is no spatial region that qualifies as "clean sky" for fitting a complex BG model.

This is the practical version of your "free background area" point. Pro Hα surveys at this depth restrict themselves to a low-order plane fit at most for exactly this reason; anything higher-order catches real diffuse emission that nothing in the data can distinguish from gradient.

Second, there's a structural lower bound that any post-stack method hits: σ_residual is bounded below by the per-sub gradient variance. Pre-stack methods aren't bounded by this because at the per-sub level, the diffuse signal (~1-3 ADU) sits below photon noise (~10 ADU) while the gradient (5-30 ADU) sits above — they're separable per-sub but not after stacking. This isn't an ABYSS-specific point; it's true for any pre-stack architecture (pixel-space, catalog-based, etc.).

Tested it directly with synthetic gradient injection at three Bortle-realistic levels (1.5%, 2.4%, 8.2% of sky). ABYSS recovers σ_sky to noise-floor at all three — so the tool does detect and remove gradients when present, it's not just "leaves everything alone".

On real NGC 6888 data:

| Method | σ_sky | r vs IPHAS (nebula-only) | F_diffuse vs prelim |

|---|---|---|---|

| prelim (no BG) | 5.14 | 0.43 | — |

| GraXpert (default) | 4.22 | 0.34 | +10.5% * |

| AutoDBE | 4.24 | 0.35 | −0.6% |

| GC (PI) | 4.27 | 0.35 | +6.4% |

| MARS / MGC | 3.90 | 0.35 | +1.1% |

| ABYSS pre-stack (MFB-p2) | 3.82 | 0.44 | −7.9% |

(* GraXpert "gain" is a sky-pedestal-shift artifact, not real signal.)

_ngc6888_4panel_comparison.png

What you predicted shows up in r vs IPHAS: self-contained post-stack tools drop morphology correlation from 0.43 → 0.34 because they treat the diffuse Cygnus filaments as gradient. MARS escapes this by bringing in external reference data — and is the standout post-stack performer in our test, exactly as Vicent Peris's architectural choice predicts. ABYSS escapes via the pre-stack architecture argument.

The open question I'd put back to you and the thread:

> On fields like NGC 6888 — no free BG region, gradient and diffuse signal sharing scales after stacking — is self-contained in-frame post-stack gradient removal a well-defined problem at all? Or is it information-theoretically restricted to either (a) external reference data, (b) pre-stack methods, or (c) accepting a low-order plane fit only?

If (c) is the honest answer, large parts of amateur NB post-processing are working on something that doesn't have a clean in-frame solution — and the workflow advice should reflect that.

Thanks for the original challenge!

Dirk

Well written Helpful Insightful
Dirk Bausch avatar

@Die_Launische_Diva — actually a really useful comment, because the line "easy since there is no large-scale nebulosity to be confused with parasitic light" is the cleanest possible articulation of the boundary I tried to set up in the post above. That's exactly the regime where DBE-style sample placement is well-defined and works as designed: when sources and BG live are easily distinguishable you can put samples in genuinely empty sky and the fit is unambiguous.

What I was digging into is the regime where they don't. NGC 6888 in 3.5 nm Hα has extended Cygnus filaments filling the entire field — Stefan Ziegenbalg's Northern Sky Narrowband Survey (NSNS DR0.2) confirms this independently. There's literally nowhere to put "sample points away from stars and small sources" that isn't also on diffuse Hα emission. In that regime, DBE sample selection no longer separates source from BG, and the fit pulls real diffuse signal into the gradient model. Same for GraXpert AI, GC, and similar self-contained approaches.

On the flat-calibration / stray-light hypothesis — also a real possibility on a lot of data, and a good reminder of something useful: pre-stack per-sub corrections catch per-sub flat residuals and stray-light variations on the fly that post-stack tools can't reliably tell apart from sky gradient. So your hypothesis actually strengthens the "do it per-sub when you can" argument either way, regardless of whether the underlying cause is the sky or the flat.

So the framing might be:

- Your regime (Bortle 5, isolated targets, no large-scale nebulosity): DBE-style "boring but easy" is exactly right, works structurally well

- Dense NB-on-galactic-plane regime: same workflow becomes "boring but architecturally undecidable" — the data itself doesn't contain the information needed to separate gradient from real diffuse signal in a self-contained way

Both regimes exist, and the choice of tool should reflect which one you're in. Thanks for crystallizing the boundary so clearly.

Best,

Dirk

Well written Helpful Insightful Respectful Engaging Supportive
Wei-Hao Wang avatar

Hi Dirk,

In your NGC6888 test, did you use the Ha image or R broad-band? I think it will be more challenging in R than in Ha, as the background brightness (and therefore the gradient) will be much higher in R.

I really don’t feel there is a perfect answer. NGC6888 is one example to this challenge. Another example may be a 200mm FoV toward anywhere near the Milky Way plane especially near the center of the summer Milky Way. There, as long as the FoV is not pointed exactly at the Milky Way plane, there will be a gradient caused by the Milky Way. This gradient can be easily mixed and confused with the sky gradient. There is really no way to exactly separate the two gradients without relying on external information. The famous Dragonfly Array project by Yale also developed their algorithm to preserve large-scale IFN (in professional astronomy, this is called “cirrus” instead) reflection by referencing to far-IR and radio neutral hydrogen maps. There is just no other way round. They do reasonably well by using far-IR data to guide the algorithm on where the cirrus (IFN) may be. So ultimately, one will need some external guide.

Personally, I have been taking the MARS approach for almost two decades. I took very wide-field image first, to provide the “external information.” If the FoV is wide enough, wider than the target and wide enough to include many nebula-free regions all over the FoV, then a good gradient removal can be done on such wide-field image using existing tools (like DBE). Then such a gradient-removed image can serve as a reference for the narrow-field image. This is essentially what the MARS project tries to do, and I can’t think of a better method.

But, back to the images with many tiny galaxies, the Borlaff et al. method can actually work. If the goal is to preserve IFN while removing gradient, there is hope to actually achieve such a goal as long as the characteristic scale of IFN is smaller than the scale of gradient. Some parameter tuning may be needed for a different image, but fundamentally this is achievable as long as the two scales are different. All I want to say here and in my previous reply is that this method may run into trouble if the target scales are larger and comparable to the gradient size scale.

Cheers,
Wei-Hao

Well written Helpful Insightful Respectful Engaging
Georg N. Nyman avatar

Dirk Bausch · May 14, 2026, 04:55 PM

Hi all,

Over the past months I've been developing a custom reduction pipeline focused on background gradient removal. The motivation was simple: I wanted to stretch faint structures (galaxy halos, tidal features, IFN) more aggressively without amplifying background gradients or other artifacts.

Existing tools didn't quite get me there. I find DBE tedious and error-prone in practice — manual sample placement is a lot of work and easy to get wrong, especially around large galaxies or extended nebulosity. GraXpert and multiscale gradient tools are faster but often don't give me the result I want, and it's hard to understand why the algorithm decided what it decided. And none of them address the per-sub flat-fielding stage where many gradient problems originate.

So I built something based on the ABYSS approach from professional deep imaging surveys (Borlaff et al. 2019, A&A 621, A133): multi-pass background fitting with source-masked sky flats per sub, conservative gradient removal designed to preserve extended low-surface-brightness signal. Implementation with GPU acceleration.

The practical result: backgrounds are flat enough that aggressive stretching no longer reveals processing artifacts. Faint structures survive the background fit instead of being subtracted with it.

Comparison images — Pipeline vs PixInsight WBPP on identical subs:

📷 Coma_Abyss.jpgComa_Abyss.jpg📷 Coma_Wbpp.jpgComa_Wbpp.jpg

The Coma Cluster comparison shows the most striking visual difference — hundreds of cluster member galaxies that are barely visible in the WBPP output emerge cleanly in the pipeline output, along with faint diffuse signal in the cluster core consistent with intracluster light reported in deep imaging surveys.

📷 M65_Abyss.jpgM65_Abyss.jpg📷 M65_Wbpp.jpgM65_Wbpp.jpg

The Leo Triplet output shows similar improvements with documented structures — the NGC 3628 stellar halo and southern tidal plume are clearly visible in the pipeline output but not in WBPP at identical stretch.

Both comparisons use the same calibrated subs after identical quality filtering. Stretching applied identically. No BXT, NXT, or any post-processing on either side — what you see is the stack output directly.

Quantitative summary:

  • 5σ detection depth: +0.7 to +1.2 mag deeper than WBPP (Gaia DR3 photometric calibration)

  • Background spread: 8-14× flatter

  • For Leo Triplet: 95% of the pipeline's additional detections have a direct PanSTARRS DR1 counterpart, confirming they're real sources rather than artifacts

  • Pipeline tested with pure-noise input (no spurious structures created) and mock-source injection (correct faint-source recovery)

Setup: SkyWatcher Esprit 120ED, QHY268M Mono, Bortle 5 skies. Coma: 432 ×120s subs. Leo Triplet: 376×120s L after quality filtering.

For now I'd genuinely appreciate critical feedback. Especially:

  1. Anyone seeing issues in the comparison images I'm missing?

  2. Suggestions for additional validation targets ?

  3. Experiences with similar approaches?

Happy to discuss methodology in the thread.

Clear skies, Dirk

I read this with interest but you seem to compare apples with bananas - WBPP is most definitely not a gradient removal tool. That means your comparison is not a valid one. If you want to compare your tool with a gradient removal tool, then compare it with GraXpert or Multiscale Gradient Removal or something else.

Well written Concise Engaging
Dirk Bausch avatar

@Georg N. Nyman — completely fair point, and exactly the same critique that @andrea tasselli raised earlier in the thread. I edited the OP today with an UPDATE block at the very top retracting the WBPP-baseline claims and pointing to the proper comparisons (controlled gradient injection test against GraXpert / AutoDBE / GC / MARS at default settings, further down in the thread, plus an NGC 6888 stress test suggested by @Wei-Hao Wang).

Short version: pre-stack's advantage vs proper BG-removal tools is real at stressed conditions and dense fields, marginal at clean ones. Apologies for the framing in the original post — the UPDATE block at the top now reflects the corrected scope. Thanks for engaging.

Well written Respectful Supportive
Dirk Bausch avatar

Wei-Hao,

really appreciate the detailed reply.

Quick technical answer first: NGC 6888 was tested in specifically (Baader 3.5 nm UNB CMOS). Your point about R broadband being much harder is correct — the 3.5 nm filter is doing significant background suppression before the algorithm sees anything. In R, gradient amplitudes would push every sub well above the threshold where the "leave it alone" workflow makes sense, and into exactly the regime you describe where scale-mixed gradients and scale-mixed targets become indiscriminable.

The Dragonfly reference is the canonical professional answer to this whole class of problem — van Dokkum / Abraham et al. using Planck far-IR and HI 21 cm surveys as priors for galactic cirrus is conceptually the same architectural family as MARS, just chosen for the specific physical scale of cirrus emission. Architecturally elegant: the very thing that makes the in-frame problem ill-posed (cirrus is everywhere) makes the prior approach work, because you can borrow a wavelength where the cirrus is known from independent observations.

Your personal 2-decade practice of using wider-FoV imaging as your own external reference is the pragmatic amateur version of exactly that. It's what MARS-DR2+ should eventually make accessible to people who can't take the wide field themselves — though as you note, the current DR0.1 is Hα-only for narrowband, so the manual wide-field-prior approach you've been doing is in some ways more general than the present database. Has that workflow been written up anywhere? It's the kind of methodology that would be very useful to have as explicit amateur-readable documentation, and I haven't found it described in detail anywhere.

Cheers,

Dirk

Well written Helpful Insightful Respectful Engaging
Wei-Hao Wang avatar

Dirk Bausch · May 17, 2026 at 09:04 AM

Has that workflow been written up anywhere? It's the kind of methodology that would be very useful to have as explicit amateur-readable documentation, and I haven't found it described in detail anywhere.

Hi Dirk,

I wrote it some 20 years ago for my film images. It’s here. It was originally intended for vignetting correction for film, but it works equally for gradient removal. Basically, it is:

  1. Run gradient removal on the wide-field reference as good as possible.

  2. Register the reference to the narrow-field target, and match the color/brightness to the target (using linear fit, for example).

  3. Subtract the registered/color-matched reference from the target to form a difference image.

  4. Smooth out small-scale structures and PSF in the difference image, and this will be the large-scale gradient model.

  5. Subtract the gradient model from the target image.

So it’s really simple. In the subtraction, mismatched star PSF was a big problem, but no longer so. Now we have very good star removal tools. Everything above can be done on the starless images. So things are much easier now.

And I believe in many ways, this is exactly what the MGC tool of PI (plus MARS) or the photometric mosaic script is doing. So you don’t even need to write anything new. Just feed the wide-field reference image to MGC (plate solved and spectrophotometric flux cal first) to replace the MARS database, or to the photometric mosaic script (registered to the target first) and let them do the work. This is what I do in recent couple of years. I no longer rely on my own manual procedures (based on Registar and Photoshop).

Cheers,
Wei-Hao

Well written Helpful Insightful Respectful Engaging Supportive