Skip to content

Debayering Guide

Stéphane Pilloy edited this page Nov 4, 2026 · 2 revisions
Language: English | Français 🇫🇷

Debayering Guide (RAW Color Demosaicing)

Single-shot color (OSC) astronomical cameras (ZWO ASI, QHY, Player One, Svbony) use sensors covered with a Bayer color filter array (CFA). To produce full RGB images, the missing color channels must be interpolated.


Bayer Matrices Supported

CassiniFlow supports all 4 standard 2×2 Bayer arrangements:

  • RGGB (Most common on Sony IMX sensors: IMX585, IMX662, IMX678, IMX462, IMX178)
  • BGGR (Common on older Aptina/Sony sensors)
  • GBRG
  • GRBG

Tip

If your planet appears strongly tinted green or purple, the selected Bayer matrix does not match your camera driver. Switch between RGGB and BGGR to restore natural planetary colors.


Comparison of Demosaicing Algorithms

Algorithm Computational Cost Edge Sharpness Color Artifacts (Zippers) Best For
Bilinear Lowest ($\approx 1\times$) Moderate Prone to slight fringing on sharp limbs Fast previews, real-time scrubbing, rapid sorting.
HQ Linear Medium ($\approx 1.8\times$) High Reduced artifacts Excellent all-rounder for general planetary use.
Malvar-He-Cutler Higher ($\approx 2.4\times$) Very High (gradient-corrected) Minimal edge fringing Fine detail work: Jupiter's GRS whorls, Saturn's Encke/Cassini rings, lunar rilles.

Bayer Pattern Protection (ProtectBayerPattern)

In certain advanced workflows, astrophotographers prefer keeping RAW Bayer data intact throughout cropping and centering, deferring demosaicing directly to the final stacking phase.

CassiniFlow includes a Protect Bayer Pattern mode:

  • Ensures all crop boundaries and centroid shifts align to even $2 \times 2$ pixel steps.
  • Guarantees that the underlying RGGB matrix order is never scrambled during cropping or stabilization.

Clone this wiki locally