Pipeline Overview

HeliosCam processes RAW sensor data through a rigorous, high-fidelity 4-stage pipeline. The architecture is explicitly split between scene-linear and display-referred stages to ensure physically accurate exposure, highlight retention, and natural filmic color response.

1

Neutral Develop

Transform raw sensor data into a calibrated linear-light image

Linearize sensor pixels
White balance mosaic
Chroma denoise (ISO≥400)
Demosaic (Bilinear / Quad)
DNG ForwardMatrix color transform
2

Scene-Linear Film Core

Apply exposure, tone mapping, and display encoding in linear light

Exposure scaling (2^EV)
Blown highlight desaturation
Hue-preserving Hable filmic tone map
Soft shoulder highlight rolloff
sRGB OETF display encoding
3

Display-Referred Creative

Apply film look, color grading, and creative adjustments

HSL hue/saturation warp
Color-Chrome saturation darkening
Per-channel film density curves
Inter-layer crosstalk matrix
Highlight chroma compression
4

Finishing & Output

Physical film effects and final output

Dual-pass bloom + halation scatter
Analytic density-scaled film grain
Film border/watermark
JPEG/HEIF encode

Stage 1 — Neutral Develop

The first stage aims to recover a clean, neutral representation of the scene in absolute linear light. This requires interpreting the raw mosaic of sensor values, correcting for sensor physics, and adapting to the scene's illuminant.

Sensor Linearization

Raw values are offset by the sensor's optical black level. We normalize these values into a floating-point range [0.0, 1.0].

White Balance & Pre-Denoise

Before demosaicing, white balance is applied directly to the bayer mosaic. The multipliers are derived from the DNG AsShotNeutral tags:

At ISO values ≥ 400, a fast Gaussian sub-grid filter suppresses chroma noise in the mosaic prior to demosaicing. This prevents color artifacts from being interpolated across neighboring pixels.

DNG Dual-Illuminant Interpolation

HeliosCam estimates the scene Correlated Color Temperature (CCT) using McCamy's formula. We interpolate between the two DNG calibration illuminants (typically Standard Light A and D65) in mired space (1/CCT).

The final color transform maps from camera sensor space directly to sRGB/Rec.709 working space:

XYZ(D50) to sRGB Matrix

3×3
X
Y
Z
[
R
 3.133900
-1.617000
-0.490600
G
-0.978500
 1.916000
 0.033300
B
 0.072000
-0.229000
 1.405500
]

The absolute transformation from D50-adapted XYZ space into the linear sRGB working color space.

Stage 2 — Scene-Linear Film Core

This stage operates exclusively in scene-linear light. Exposure control here perfectly mimics physical aperture and shutter adjustments. Tone mapping gently compresses dynamic range into standard display capabilities.

Exposure Scaling

Hue-Preserving Hable Filmic Tone Map

We employ an adaptation of John Hable's Uncharted 2 tone mapping operator. To maintain color integrity during intense highlight compression, we apply the curve to the maximum channel luminance, then scale all channels uniformly. This prevents color shifts towards secondary colors (e.g., fiery reds shifting to unnatural yellow).

Key Insight: By calculating scale = HableMap(max(R,G,B)) / max(R,G,B) and then setting RGB_mapped = RGB × scale, we preserve exact RGB ratios. Pure red stays pure red, even as it rolls off into white.

For extreme clipped highlights, we smoothly desaturate signals approaching the sensor's maximum white level (RGB > 0.55 × WhitePoint), yielding filmic, neutral highlight rolloff.

Soft Shoulder Rolloff

A soft shoulder provides a gentle ceiling (e.g., ~0.86 for vintage looks). Signals above the knee point are exponentially smoothed:

sRGB Display Encoding

Once tone-mapped, the linear signal is encoded into the standard display transfer function (OETF) for subsequent creative manipulation in a perceptual space.

(The reverse EOTF handles decoding back to linear when required):

We also support ACES workflow emulation via the Narkowicz approximation curve:

Stage 3 — Display-Referred Creative

With the image now safely mapped into display range, we apply non-linear, perceptual adjustments that define the character and "look" of specific film stocks.

Color-Chrome Saturation Darkening

Emulating Fuji's deeply saturated film rendering, the color-chrome effect selectively darkens highly saturated colors without affecting neutrals.

Film Tone & Crosstalk

Per-Channel Density Curves: We apply independent rCurve, gCurve, and bCurve lookup tables. This divergent contrast injects color casts into shadows and highlights characteristic of distinct film stocks.

Inter-Layer Crosstalk: In physical film, dye layers interact during development. We simulate this by momentarily linearizing the sRGB signal, passing it through a 3×3 subtractive crosstalk matrix, and re-encoding.

Highlight Chroma Compression: Bright pixels (Luma > 0.82) are pulled towards neutral to emulate the dye density exhaustion seen in overexposed negative film.

Stage 4 — Finishing

The final pass applies optical and physical media effects that tie the image together.

Bloom (Optical Scattering)

Neutral white veiling glare. Screen-blended over the image.

  • Threshold: 0.62
  • Radius Division: 11
  • Tint: White [1.0, 1.0, 1.0]

Halation (Backing Scatter)

Red-orange rim glow around high-contrast edges. Additive blend.

  • Threshold: 0.72
  • Radius Division: 25
  • Tint: Orange-Red [1.0, 0.45, 0.20]

Analytic Density-Scaled Film Grain

Grain is procedurally generated with organic clumping (roughly 1000 cells per image height). Its intensity is governed by a midtone-peaked envelope, so shadows and highlights stay relatively clean. It is blended using a soft-light Pegtop formula:

Film Border & Output Encode

A stylized border (35mm canister, minimalist black, or Helios white card) can be composited before the final buffer is flushed to disk via JPEG or 10-bit HEIF encoding.

Video Export Pipeline

For continuous RAW video capture, the pipeline is highly parallelized for GPU execution. The process skips heavy creative finishing steps (like halation) in favor of yielding a robust, high-fidelity log-encoded signal ready for professional grading.

ParameterCapabilities
Log CurvesCineon Log, ARRI LogC3 (AWG3), Sony S-Log3 (S-Gamut3.Cine), ACEScct (AP1), Rec.709
Supported CodecsApple ProRes, DNxHR, H.265 (HEVC), H.264 (AVC)
Color Depth10-bit YUV, 8-bit YUV
Maximum BitrateUp to 500 Mbps