Detects and repairs hot and cold pixels by comparing each pixel to its neighbours, with a structure guard that keeps star and nebula cores from being clipped. GPU-accelerated (CUDA/MPS) with a transparent CPU fallback; works on single images or in batch.
Dial in the detection sigmas while watching the before/after preview, then Apply. The preview shows a tile of the frame, always autostretched, so you can see whether your settings are eating real detail. The two panes are pan/zoom-linked — move one and the other follows.
| Control | What it does |
|---|---|
| Hot pixels σ (0.5–10, default 3) | Threshold for flagging a pixel as too bright vs its neighbours. Lower = more aggressive. |
| Cold pixels σ (0.5–10, default 3) | Same, for pixels too dark vs their neighbours. |
| Protect structure σ (2–50, default 5) | The anti-core guard. A region whose local median sits this many σ above the global background is treated as real signal (star / nebula core) and left untouched by the hot pass. Lower = protect more; set very high to disable. |
| Correct hot / Correct cold | Enable each pass independently. |
| Bayer pattern | Auto-detect (reads BAYERPAT from the FITS header, only for a raw 2-D mosaic), None (mono / already-debayered), or force RGGB/BGGR/GRBG/GBRG — see §2.3. |
| Push σ to Stacking Suite | Copies the current Hot/Cold/Protect σ into the Stacking Suite settings, so per-frame cosmetic correction during light calibration uses the same numbers you just tuned. |
A two-pass neighbour-median comparison flags and replaces outliers, gated by a structure test so real detail survives. The detection kernel runs on GPU when available and on CPU otherwise.
Each pixel x is compared to the median m of its
orthogonal neighbours; if it deviates by more than the chosen number of noise
sigmas it is flagged and replaced by that median. The two passes run
independently:
Replacing with the neighbour median (rather than the mean) means a corrected pixel takes on a value its surroundings actually support, and a single bad pixel can't drag the estimate. Turning a pass off pushes its threshold out of reach so it contributes nothing:
The danger with hot-pixel removal is clipping the bright peak of a tight star or nebula core. The guard compares each region's local median to the global background: if it stands too many sigmas above it, the region is real signal and the hot pass skips it.
The key insight: a lone hot pixel can't shift a median, so it is still corrected even inside a bright area — only genuine structure (which does move the local median) is protected. Lower Protect σ shields more; higher corrects more aggressively.
On a raw, undebayered mosaic the orthogonal neighbours are different colours, so a stride-1 comparison would be meaningless. When a Bayer pattern applies (auto-detected from BAYERPAT only for a 2-D image, or forced), the comparison uses stride-2 same-colour neighbours instead. For mono or already-debayered RGB, standard stride-1 neighbours are used.
source − corrected cleanly separates hot
(>0) from cold (<0) — the same test that
drives the pixel map.torch_rejection.cosmetic_correction_gpu)
picks GPU (CUDA/MPS) or CPU automatically; the batch path preserves each
file's bit depth and adds a HISTORY note to FITS headers.