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:
- Deep Sky Objects: Nebulae, galaxies, star clusters
- Star Fields: Wide-field astrophotography
- Noise Reduction: Reducing noise in long-exposure astro images
- Signal Enhancement: Improving faint object visibility
- Professional Astro Workflows: When you need calibration frame support
Requirements:
- Minimum 2 light frames (more frames = better noise reduction)
- Light frames should be captured with the same settings (ISO, exposure time, temperature)
- Optional calibration frames for best results
How to Capture Astrophotography Sequences
- 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
- 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
- Set Up Your Shot:
- Mount your camera on a tripod or tracking mount
- Frame your celestial object
- Ensure consistent settings (ISO, exposure time)
- 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)
- 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.
- 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:
- Open Settings on your iPhone or iPad
- Scroll down and tap ElectroSpotmatic
- 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
- 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
- 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
- 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
- Star Detection Phase:
- Stars are detected in each light frame
- Star detection threshold controls sensitivity
- Stars are used for alignment
- 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
- 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
- Stacking Phase:
- Aligned, calibrated light frames are averaged
- Random noise is reduced
- Signal is preserved and enhanced
- Result:
- Final stacked image is saved to Photos library
- Reduced noise, improved signal-to-noise ratio
Best Practices
Light Frame Capture
- Frame Count:
- Minimum: 2 frames (required)
- Recommended: 10-30 frames for good noise reduction
- Excellent: 30-50+ frames for maximum noise reduction
- Consistent Settings: Keep ISO, exposure time, and temperature consistent
- 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
- 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:
- Place the lens cap on your camera or telescope to block all light from reaching the sensor.
- 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.
- Keep the same ISO (or gain) setting as your light frames.
- Capture 20–50 bias frames.
Matching requirements:
- ISO/Gain: Must match your light frames.
- Temperature: Should be close to your light frames, but less critical than for darks.
- Exposure time: Always the shortest possible — this is what distinguishes bias frames from dark frames.
- Filters: Do not matter for bias frames.
Tips:
- Bias frames are very quick to capture since the exposure is nearly instantaneous — an entire set takes only a few seconds.
- You can reuse bias frames for several months. Consider building a "Bias Library" with sets for each ISO/gain setting you commonly use, and re-capture them once a year or when you get a new camera.
- Bias frames are most useful with DSLR and mirrorless cameras. If you use a cooled astronomy camera, dark flat frames are generally preferred over bias frames.
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:
- Place the lens cap on your camera or telescope to block all light from reaching the sensor.
- Use the same exposure time as your light frames.
- Use the same ISO (or gain) setting as your light frames.
- 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.
- Capture 15–30 dark frames.
Matching requirements:
- Exposure time: Must exactly match your light frames.
- ISO/Gain: Must match your light frames.
- Temperature: Must match your light frames — this is critical. Thermal noise changes significantly with temperature.
- Filters: Do not matter for dark frames.
Tips:
- Dark frames are especially important for long exposures (30 seconds or more) where thermal noise has time to accumulate.
- With cooled cameras, you can capture darks at home by setting the same cooling temperature. With uncooled cameras, capture darks on-site right after your imaging session.
- You can reuse dark frames for several months. Build a "Darks Library" organized by ISO/gain, exposure time, and temperature. Re-capture once a year or when you get a new camera.
- Modern camera sensors have very low thermal noise, so darks are becoming less critical — but they still help, especially for long exposures.
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:
- Do not change focus, aperture, or camera rotation from your light frame setup — the optical path must be identical.
- 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.
- 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.
- Use the same ISO (or gain) as your light frames.
- Capture 15–25 flat frames.
Matching requirements:
- Focus position: Must match your light frames — do not refocus.
- Aperture: Must match your light frames.
- Camera rotation: Must match your light frames — do not remove or rotate the camera.
- ISO/Gain: Must match your light frames.
- Exposure time: Adjusted independently for proper histogram placement — does not need to match light frames.
- Temperature: Does not matter.
- Filters: Must match — if you use filters, capture a separate set of flats for each filter.
Tips:
- Flat frames are best captured right after your imaging session, before you disturb the optical setup.
- Flats are especially important for wide-field astrophotography where vignetting is most visible.
- You can only reuse flat frames if nothing in your imaging train has been moved or rotated since the last session. In practice, most astrophotographers recapture flats for each session.
- If your light panel is too bright or unevenly lit, try placing a white T-shirt over the telescope opening to diffuse the light.
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:
- Place the lens cap on your camera or telescope to block all light.
- Use the same exposure time as your flat frames (not your light frames).
- Use the same ISO (or gain) as your flat frames.
- Capture 15–25 dark flat frames.
Matching requirements:
- Exposure time: Must match your flat frames.
- ISO/Gain: Must match your flat frames.
- Temperature: Does not matter.
- Filters: Do not matter for dark flat frames.
Tips:
- Dark flat frames are typically captured immediately after your flat frames.
- Since flat frame exposures are usually very short (around 1 second), dark flat frames are quick to capture.
- You can only reuse dark flat frames if you are using the same set of flat frames (same exposure time and conditions).
- If you use a DSLR or mirrorless camera, bias frames generally serve the same purpose as dark flat frames. You typically use one or the other, not both.
Settings
- Star Detection Threshold:
- Start with default (20)
- Lower if not enough stars detected
- Higher if too many false detections
- Fallback Alignment: Leave on Vision Framework unless star detection consistently fails
Use Cases
Deep Sky Objects (Nebulae, Galaxies)
- Capture 20-50 light frames
- Use calibration frames (bias, dark, flat)
- Star detection threshold: 20-25
- Result: Reduced noise, enhanced faint details
Star Fields
- Capture 10-30 light frames
- Use calibration frames (bias, dark)
- Star detection threshold: 15-20
- Result: Clean star field with reduced noise
Milky Way Wide-Field
- Capture 10-20 light frames
- Use calibration frames (bias, dark, flat - flat important for vignetting)
- Star detection threshold: 20-25
- Result: Clean wide-field with reduced noise and corrected vignetting
Troubleshooting
Star detection fails:
- Lower star detection threshold in Settings (try 10-15)
- Ensure images have visible stars
- Check that images are properly exposed (not too dark or too bright)
Alignment fails:
- Check that fallback alignment method is set correctly in Settings
- Ensure images have sufficient overlap
- Try different fallback alignment method (IC-LM for complex scenes)
Noise not reduced enough:
- Capture more light frames (20-30+ recommended)
- Use calibration frames (especially dark frames for long exposures)
- Ensure consistent settings across all frames
Hot pixels or amp glow:
- Use dark frames to correct thermal noise
- Ensure dark frames match light frame temperature and exposure time
- Capture more dark frames (20-30 recommended)
Vignetting or dust spots:
- Use flat frames to correct vignetting and dust
- Ensure flat frames have even illumination
- Capture flats with same focus and aperture as lights
Processing takes a long time:
- Processing time increases with frame count
- 10 frames: ~3-5 minutes
- 30 frames: ~10-15 minutes
- 50+ frames: ~20-30 minutes
- This is normal for astrophotography stacking
Result looks over-processed:
- Check calibration frame application
- Ensure light frames are properly exposed
- Too many calibration frames or incorrect calibration can cause issues
Settings Location
To configure astrophotography stacking:
- Open iOS Settings app
- Tap ElectroSpotmatic
- Find Star Detection Threshold and Fallback Alignment Method
- Adjust as needed
Changes take effect for all future astrophotography captures.
Technical Details
- Minimum light frame count: 2 images
- Recommended: 10-30 light frames
- Maximum: 50+ frames (diminishing returns beyond 50-100)
- Star-based alignment using FOCAS algorithm
- Supports calibration frames (bias, dark, flat, dark flat)
- Processing time: ~3-15 minutes for 10-30 frames
- Memory usage: High (depends on frame count and resolution)