Astrophotography Stacking

← Back to Computational Photography Guide

IN DEVELOPMENT

Astrophotography Stacking in ElectroSpotmatic and SpotmaticMagic

What It Does

Astrophotography Stacking automatically combines multiple light frames (astrophotography images) to reduce noise and improve signal-to-noise ratio. By averaging multiple exposures of the same celestial object, random noise is reduced while the signal (stars, nebula, etc.) is preserved and enhanced.

This feature is based on the OpenSkyStacker algorithm and supports optional calibration frames (bias, dark, flat) to correct sensor artifacts like readout noise, thermal noise, vignetting, and dust spots.

You can download test images for use with SpotmaticMagic from: Google Drive  

When to Use It

Use Astrophotography Stacking when:

Requirements:

How to Capture Astrophotography Sequences

  1. Enable Astrophotography Stacking:
    • Open ElectroSpotmatic camera
    • Tap the exposure control ring
    • Find and enable the "Astrophotography Stacking" button
    • The button will show the number of frames to capture
  2. Configure Capture Settings (optional):
    • Frame count: Number of light frames to capture (2-50+, recommended: 10-30)
    • Exposure time: Exposure time per frame (typically 30 seconds to 5 minutes)
    • ISO: ISO setting (keep consistent across all frames)
    • Use a tracking mount if available to prevent star trailing
  3. Set Up Your Shot:
    • Mount your camera on a tripod or tracking mount
    • Frame your celestial object
    • Ensure consistent settings (ISO, exposure time)
  4. Capture Light Frames:
    • Press the shutter button
    • ElectroSpotmatic will automatically capture the specified number of frames
    • Keep settings consistent across all frames
    • Use tracking mount to prevent star trailing (if available)
  5. Capture Calibration Frames (optional but recommended):
    • Bias Frames: Lens cap on, shortest possible exposure, same ISO — captures readout noise (20–50 frames)
    • Dark Frames: Lens cap on, same exposure time, ISO, and temperature as lights — captures thermal noise (15–30 frames)
    • Flat Frames: Even illumination source, same focus/aperture as lights — corrects vignetting and dust (15–25 frames)
    • Dark Flat Frames: Lens cap on, same exposure as flats — corrects noise in flat frames (15–25 frames)
    • See the Calibration Frame Capture section below for detailed instructions on each frame type.
  6. Processing:
    • After capture, processing begins automatically
    • Calibration frames are processed first (if provided)
    • Light frames are aligned using star detection
    • Frames are stacked to reduce noise
    • Progress is shown in the processing indicator
    • Final result is saved to your Photos library

Settings Configuration

Astrophotography stacking settings are configured in the iOS Settings app:

  1. Open Settings on your iPhone or iPad
  2. Scroll down and tap ElectroSpotmatic
  3. Find Star Detection Threshold:
    • Lower values (1-10): More stars detected
    • Medium values (15-25): Balanced (recommended, default: 20)
    • Higher values (30-100): Fewer stars detected
  4. Find Fallback Alignment Method (if star detection fails):
    • Vision Framework (Recommended): Fast and reliable
    • IC-LM: Alternative alignment method
    • Metal ECC: Experimental use only

How Astrophotography Stacking Works

  1. Capture Phase:
    • You capture 2-50+ light frames of the same celestial object
    • All frames use consistent settings (ISO, exposure time, temperature)
    • Optional calibration frames are captured separately
  2. Calibration Phase (if calibration frames provided):
    • Bias frames are combined into master bias
    • Dark frames are combined into master dark
    • Flat frames are combined into master flat
    • Dark flat frames are combined into master dark flat
    • Calibration frames correct sensor artifacts
  3. Star Detection Phase:
    • Stars are detected in each light frame
    • Star detection threshold controls sensitivity
    • Stars are used for alignment
  4. Alignment Phase:
    • Light frames are aligned using star positions (FOCAS algorithm)
    • If insufficient stars detected, falls back to standard alignment
    • Uses fallback alignment method from Settings
  5. Calibration Application (if provided):
    • Master calibration frames are applied to light frames
    • Bias correction removes readout noise
    • Dark correction removes thermal noise
    • Flat correction removes vignetting and dust
  6. Stacking Phase:
    • Aligned, calibrated light frames are averaged
    • Random noise is reduced
    • Signal is preserved and enhanced
  7. Result:
    • Final stacked image is saved to Photos library
    • Reduced noise, improved signal-to-noise ratio

Best Practices

Light Frame Capture

  1. Frame Count:
    • Minimum: 2 frames (required)
    • Recommended: 10-30 frames for good noise reduction
    • Excellent: 30-50+ frames for maximum noise reduction
  2. Consistent Settings: Keep ISO, exposure time, and temperature consistent
  3. Exposure Time:
    • Typical: 30 seconds to 5 minutes per frame
    • Longer = more signal but more thermal noise
    • Shorter = less thermal noise but need more frames
  4. Tracking: Use tracking mount to prevent star trailing in long exposures

Calibration Frame Capture

Calibration frames are additional images captured alongside your light frames that correct for sensor artifacts. While optional, they significantly improve the quality of your final stacked image by removing noise patterns, hot pixels, vignetting, and dust spots. Each type of calibration frame isolates a specific source of image degradation so it can be subtracted during processing.

You typically only need three types of calibration frames per session. If you are using an iPhone or DSLR/mirrorless camera, use Darks, Flats, and Bias frames. If you are using a cooled CMOS astronomy camera, use Darks, Flats, and Dark Flats instead of Bias.

Bias Frames

Bias frames capture the readout noise of your camera sensor — the small, fixed electrical signal that every pixel records even when no light or thermal energy has reached it. Every time your camera reads data off the sensor, slight pixel-to-pixel variations are introduced. Bias frames isolate this signal so it can be subtracted from your light frames.

How to capture bias frames:

  1. Place the lens cap on your camera or telescope to block all light from reaching the sensor.
  2. Set your exposure to the shortest (fastest) shutter speed your camera allows. The goal is to capture only the readout signal with no time for thermal noise to accumulate.
  3. Keep the same ISO (or gain) setting as your light frames.
  4. Capture 20–50 bias frames.

Matching requirements:

Tips:

Dark Frames

Dark frames capture thermal noise — the signal generated by the sensor itself as it warms up during long exposures. This noise manifests as hot pixels (bright dots), amp glow (a faint gradient, usually in a corner), and a general pattern of thermal current that varies from pixel to pixel. Because thermal noise depends on exposure time and temperature, dark frames must precisely match the conditions of your light frames.

How to capture dark frames:

  1. Place the lens cap on your camera or telescope to block all light from reaching the sensor.
  2. Use the same exposure time as your light frames.
  3. Use the same ISO (or gain) setting as your light frames.
  4. Keep the sensor at the same temperature as during your light frame capture. For cooled cameras, set the same cooling temperature. For DSLR/mirrorless cameras, capture darks immediately after your imaging session while the camera is still at ambient temperature.
  5. Capture 15–30 dark frames.

Matching requirements:

Tips:

Flat Frames

Flat frames correct for uneven illumination across the sensor. They address three problems: vignetting (darkening around the edges and corners caused by the optical path), dust spots (shadows cast by dust particles on the sensor or optical elements), and pixel sensitivity variation (slight differences in how each pixel responds to light). By capturing an image of a perfectly uniform light source, the stacking software can calculate and correct these artifacts.

How to capture flat frames:

  1. Do not change focus, aperture, or camera rotation from your light frame setup — the optical path must be identical.
  2. Point your camera or telescope at a source of even, uniform illumination. Common methods:
    • Light panel: Place a flat LED panel over the end of the telescope tube. This is the most consistent method.
    • Twilight sky: Point the telescope at the evenly lit sky just after sunset or before sunrise ("sky flats").
    • White T-shirt method: Stretch a plain white T-shirt over the telescope opening and point it at a diffuse light source.
  3. Adjust the exposure time so that the image histogram peaks near the center (roughly 50% brightness). This is usually a short exposure — start with 1 second and adjust. The goal is a well-exposed, evenly lit frame without saturating any pixels.
  4. Use the same ISO (or gain) as your light frames.
  5. Capture 15–25 flat frames.

Matching requirements:

Tips:

Dark Flat Frames

Dark flat frames are the dark frame equivalent for your flat frames. They capture the thermal noise and readout signal present during your flat frame exposures, allowing the stacking software to cleanly subtract sensor noise from your flats before the flats are applied to your light frames. Dark flat frames are particularly useful with cooled astronomy cameras, where they serve the same purpose as bias frames do for DSLR/mirrorless cameras.

How to capture dark flat frames:

  1. Place the lens cap on your camera or telescope to block all light.
  2. Use the same exposure time as your flat frames (not your light frames).
  3. Use the same ISO (or gain) as your flat frames.
  4. Capture 15–25 dark flat frames.

Matching requirements:

Tips:

Settings

  1. Star Detection Threshold:
    • Start with default (20)
    • Lower if not enough stars detected
    • Higher if too many false detections
  2. Fallback Alignment: Leave on Vision Framework unless star detection consistently fails

Use Cases

Deep Sky Objects (Nebulae, Galaxies)

Star Fields

Milky Way Wide-Field

Troubleshooting

Star detection fails:

Alignment fails:

Noise not reduced enough:

Hot pixels or amp glow:

Vignetting or dust spots:

Processing takes a long time:

Result looks over-processed:

Settings Location

To configure astrophotography stacking:

  1. Open iOS Settings app
  2. Tap ElectroSpotmatic
  3. Find Star Detection Threshold and Fallback Alignment Method
  4. Adjust as needed

Changes take effect for all future astrophotography captures.

Technical Details