PixInsight Script · CosmeticCorrection

BB-Astro · CosmeticCorrection

Apply cosmetic correction (hot/cold pixel removal) directly on the active view instead of batch processing files. Perfect for quick fixes on single images or testing sigma values before batch processing.

Features automatic detection based on sigma thresholds, real-time validation, and process icon support.

PixInsight interface

A convenient interface to apply PixInsight's native CosmeticCorrection process directly on an open image.

CosmeticCorrection PixInsight module interface

Key Features

  • Direct View Processing: Apply corrections on open images without file export.
  • Auto-Detection: Automatic hot/cold pixel detection using sigma thresholds.
  • Real-time Validation: Visual feedback shows when values are outside typical ranges.
  • Process Icons: Save configurations for reuse (triangle button).
  • CFA Support: Works seamlessly with Bayer pattern images.

How It Works

Since PixInsight's CosmeticCorrection process normally only works in a global context (file-based), this script bridges the gap:

  1. Saves the active view to a temporary file.
  2. Runs CosmeticCorrection on that file.
  3. Loads the result back into the original view.
  4. Cleans up temporary files automatically.

Installation & Usage

Installation

Copy BB_CosmeticCorrection.js to your PixInsight scripts folder:

/Applications/PixInsight/src/scripts/

Or use Script > Feature Scripts... to add the folder containing the script.

Typical Values

  • Aggressive: Hot/Cold Sigma = 1.0-1.5
  • Moderate: Hot/Cold Sigma = 1.5-2.0 (recommended)
  • Conservative: Hot/Cold Sigma = 2.0-3.0