PHOT-420 · Lesson 6 of 12 · 30 min

Night modes and low-light stacking

Night photography used to mean a tripod, a long exposure and patience. Since Google's Night Sight in 2018 and similar modes from every major phone maker, a hand-held phone can make a clean, colorful picture by streetlight or even moonlight. Night modes push the burst ideas of lesson 3 to their limit: they meter motion as well as light, choose how many frames and how long each should be, merge tens of frames with robust alignment, and then apply white balance and tone mapping designed to keep a night scene looking like night. This lesson works through the exposure budget, the trade-off between many short frames and fewer long ones, the special case of astrophotography modes, calibration with dark frames, and the techniques dedicated-camera photographers use for stacking and live composites.

The exposure budget at night

In dim light the only way to collect enough photons is time. A single long exposure would blur from hand shake and subject motion. A night mode therefore divides the total time it can afford into many shorter frames, each short enough to keep blur acceptable, and merges them. Two decisions follow: the duration of each frame and the number of frames. Google's Night Sight, described by Orly Liba and colleagues in 2019, introduced motion metering: before capture, the phone measures how much the scene and camera are moving using optical flow and the gyroscope. If the phone is braced or on a tripod and nothing moves, it uses fewer, longer frames; if the subject moves, it uses more, shorter frames. The published design allowed frames up to about a third of a second hand-held and longer when stable, with total capture up to several seconds (figures from the 2019 description; current phones differ).

Worked problem

Dividing a time budget

A night mode can afford 3 s of total capture. Motion metering says hand-held frames must be no longer than 1/4 s to keep blur under one pixel. How many frames will it take, and how does the noise compare with a single 1/4 s frame?

Show solution
  1. Frames: \( 3 / 0.25 = 12 \).
  2. Shot noise SNR improves by \( \sqrt{12} \approx 3.5 \) over one frame.
  3. Equivalent exposure: twelve times the light of a single frame, about 3.6 stops more.

Answer: Twelve frames of 1/4 s; noise falls by about 3.5 times compared with one frame, as if the exposure were 3.6 stops longer.

Worked problem

Hand-holding limits

A phone's main camera has a 24 mm equivalent focal length, and optical stabilization gives about 4 stops of benefit. Using the reciprocal rule as a rough guide, what is the longest hand-held frame?

Show solution
  1. Reciprocal rule: about 1/24 s without stabilization.
  2. Four stops longer: \( 1/24 \times 2^4 = 16/24 \approx 0.67 \) s.
  3. Subject motion, not camera shake, usually sets a tighter limit for people.

Answer: About 2/3 s for static scenes; for people, much shorter frames are needed, which is why motion metering matters.

Short frames, long frames and read noise

Why not use very short frames always, since they freeze motion? Because each frame adds read noise. If the total exposure time is fixed, splitting it into more frames leaves shot noise unchanged (the same total photons) but adds the read noise of every frame. In bright conditions read noise is negligible compared with shot noise, so splitting costs nothing. In very dim light, where each frame collects only a few photons per pixel, read noise can dominate, and fewer, longer frames give a cleaner result. Night modes balance motion blur against read noise using exactly this reasoning.

\[\mathrm{SNR}_{\text{stack}} = \frac{n\,S}{\sqrt{n\,S + n\,\sigma_r^2}}\]

Here \( S \) is the signal per frame in electrons, \( n \) the number of frames and \( \sigma_r \) the read noise in electrons per frame. For a fixed total signal \( nS \), the read noise term grows with \( n \).

Splitting a fixed 4 s exposure into more frames: when read noise matters
import numpy as np
total_time = 4.0
read_noise = 1.5                                  # electrons per frame (modern phone sensor, illustrative)
for flux in (100.0, 5.0, 0.5):                    # electrons per second per pixel: bright, dim, very dim
    line = []
    for n in (1, 4, 16, 64):
        S = flux * total_time / n
        snr = n * S / np.sqrt(n * S + n * read_noise ** 2)
        line.append(f"{n:2d} frames SNR {snr:5.2f}")
    print(f"flux {flux:5.1f} e/s: " + " | ".join(line))
Output
flux 100.0 e/s:  1 frames SNR 19.94 |  4 frames SNR 19.78 | 16 frames SNR 19.16 | 64 frames SNR 17.15
flux   5.0 e/s:  1 frames SNR  4.24 |  4 frames SNR  3.71 | 16 frames SNR  2.67 | 64 frames SNR  1.56
flux   0.5 e/s:  1 frames SNR  0.97 |  4 frames SNR  0.60 | 16 frames SNR  0.32 | 64 frames SNR  0.17

At high flux the SNR barely changes with frame count, so short frames are free. At very low flux, splitting into 64 frames loses much of the SNR, because each frame's 1.5 electrons of read noise swamps its tiny signal. This is why astrophotography modes use long individual frames on a tripod.

Three curves of stacked signal-to-noise ratio against number of frames for a fixed total exposure, flat for bright light, gently falling for dim light and steeply falling for very dim light
For a fixed total exposure, splitting into more frames costs little in bright light but loses SNR in very dim light because each frame adds read noise.

Merging, color and tone at night

Night merging uses the same alignment and robust merging as lesson 3, but noise is far higher, so distinguishing motion from noise is harder. Pipelines use the noise model to set rejection thresholds, more aggressive spatial denoising where few frames could be merged, and learned denoisers after merging. White balance is difficult because night scenes mix sodium, LED, neon and moonlight, and because a fully neutral correction looks unnatural: our eyes do not fully adapt in the dark, so a perfectly corrected night scene looks like daylight. Night Sight's designers described a learning-based AWB trained on night scenes and a tone mapping strategy that keeps shadows dark and adds contrast so that the result reads as night, drawing on techniques painters use to depict darkness, such as deep blue shadows and strong contrast.

The results raise an interpretive question: a night mode can show colors and detail the eye could not see at the scene. That is measurement (more photons collected) combined with interpretation (how dark to render it). Photographers using night modes for documentary work should be aware that the image may look brighter and more colorful than the scene appeared, and may represent several seconds rather than an instant.

Choosing frame length and count
ConditionsFrame lengthFrame countDominant concern
Bright, hand-heldShortFewHighlights and motion
Dim street, hand-heldUp to about 1/3 s6 to 15Hand shake and subject motion
Very dim, bracedUp to about 1 s6 to 15Read noise and blur
Tripod, static sceneSeveral secondsUp to dozensRead noise, hot pixels
Astrophotography on tripodAbout 15 s or more15 or moreStar trailing, sky glow

Astrophotography modes

In 2019 Google added an astrophotography mode for Pixel phones on a tripod: up to 15 frames of up to 16 s each, about four minutes in total (as described at the time). Each frame is short enough that stars do not visibly trail, given the wide lens. The pipeline merges the frames, detects and removes hot pixels, which become obvious at long exposures, and uses a segmentation network to find the sky and darken it slightly to look natural. Other manufacturers offer similar modes. On dedicated cameras, the same idea is done manually: shoot many exposures of the night sky, then align on the stars and stack them in software such as Siril, DeepSkyStacker or Sequator, which also handles the foreground separately because the stars move relative to the land.

Worked problem

Avoiding star trails

The NPF rule (a refinement of the older "500 rule") gives a maximum exposure before stars trail noticeably. A simple form of the 500 rule is \( t = 500 / f_{\text{eq}} \), where \( f_{\text{eq}} \) is the full-frame equivalent focal length. What does it give for a 24 mm equivalent lens and a 14 mm equivalent lens?

Show solution
  1. 24 mm: \( 500 / 24 \approx 21 \) s.
  2. 14 mm: \( 500 / 14 \approx 36 \) s.
  3. High-resolution sensors show trailing sooner; the NPF rule, which also uses pixel pitch and aperture, usually gives about half these times.

Answer: About 21 s and 36 s by the 500 rule, but for modern sensors use shorter frames, around 10 to 20 s, and stack many of them.

Calibration frames

Long exposures reveal sensor defects. Hot pixels glow; amplifier glow brightens corners on some sensors; dust and vignetting darken parts of the frame. Astrophotographers calibrate with extra frames. Dark frames are taken with the lens covered at the same exposure time and temperature, and their average is subtracted to remove fixed-pattern noise and hot pixels. Flat frames are taken of an evenly lit surface and used to divide out vignetting and dust shadows. Bias frames, the shortest possible exposures, record the readout offset. Many cameras offer long-exposure noise reduction, which takes an automatic dark frame after each long exposure, doubling the time. Phones apply factory calibration and hot-pixel detection automatically.

Subtracting a master dark frame removes hot pixels and fixed pattern from a long exposure
import numpy as np
rng = np.random.default_rng(420)
h, w = 100, 100
fixed = rng.gamma(1.0, 2.0, (h, w))                     # fixed-pattern dark signal per pixel
hot = rng.random((h, w)) < 0.002
fixed[hot] += 300                                       # a few hot pixels
sky = 40.0
def expose(signal):
    return rng.poisson(signal + fixed) + rng.normal(0, 2, (h, w))
lights = [expose(sky) for _ in range(10)]
darks = [expose(0.0) for _ in range(20)]
master_dark = np.mean(darks, axis=0)
stack_raw = np.mean(lights, axis=0)
stack_cal = np.mean([l - master_dark for l in lights], axis=0)
print(f"hot pixels: {hot.sum()}")
print(f"uncalibrated stack: mean {stack_raw.mean():.1f}, max {stack_raw.max():.0f}, std {stack_raw.std():.2f}")
print(f"dark-subtracted stack: mean {stack_cal.mean():.1f}, max {stack_cal.max():.0f}, std {stack_cal.std():.2f}")
Output
hot pixels: 18
uncalibrated stack: mean 42.5, max 356, std 13.08
dark-subtracted stack: mean 40.0, max 55, std 2.25

Before calibration, hot pixels reach hundreds of units and fixed pattern adds variation; after subtracting a master dark built from 20 frames, the mean returns to the true sky level, the hot pixels disappear and the remaining variation is mostly random noise. Averaging many darks matters: a single dark frame would add its own random noise to every light frame.

Live composite and creative stacking

Stacking also enables creative effects. Star trails are made by stacking many exposures with a "lighten" blend that keeps the brightest value at each pixel, so each star's path accumulates into an arc. Some cameras, notably OM System and earlier Olympus models, offer live composite modes that build such a lighten stack in camera and show it growing on the screen, which also suits light painting and fireworks, because the background does not overexpose as it would in one long exposure. Average stacking smooths moving water and clouds into a long-exposure look without a neutral density filter, as several phones and cameras offer in "long exposure" or "motion" modes. Maximum and average stacks of the same burst produce very different pictures, and both are honest descriptions of the scene over time if disclosed.

Stacking blend modes
BlendPer-pixel ruleTypical use
MeanAverage of all framesNoise reduction, smooth water
MedianMiddle valueRemoving transient objects, outlier rejection
Lighten (maximum)Brightest valueStar trails, light painting, fireworks
Darken (minimum)Darkest valueRemoving bright transients such as aircraft lights
Sigma-clipped meanMean after rejecting outliersAstrophotography, satellites and hot pixels

Low light and the limits of honesty

Night modes are among the most impressive and least understood computational features. A phone image of a dark street may show colors and textures no one at the scene could see, people slightly smeared by movement and lights rendered with a chosen warmth. None of this is deceptive in ordinary use. But for evidence, journalism and scientific documentation, record what mode was used, keep the original files and, where it matters, capture a conventional exposure as well. Lesson 11 returns to how provenance records can document such processing automatically.

Common mistakes

  • MistakeAssuming more, shorter frames are always better

    InsteadRemember each frame adds read noise; in very dim light use fewer, longer frames when motion allows.

  • MistakeCorrecting night white balance to perfect neutral

    InsteadKeep some warmth and darkness so the scene still reads as night.

  • MistakeUsing the 500 rule on a high-resolution sensor

    InsteadUse shorter frames or the NPF rule and stack more of them.

  • MistakeSubtracting a single dark frame

    InsteadAverage many dark frames into a master dark so you do not add noise.

  • MistakePresenting a night mode image as what the eye saw

    InsteadDisclose the mode and keep originals when the image is evidence.

Summary and key terms

  • Night modes divide a total exposure into many frames sized by motion metering.
  • For a fixed total time, more frames keep shot noise constant but add read noise, which matters in very dim light.
  • Night pipelines use robust merging, strong denoising, learned AWB and tone mapping that keeps night dark.
  • Astrophotography modes use long frames on a tripod, hot-pixel removal and sky segmentation.
  • Dark, flat and bias frames calibrate long exposures; master darks should average many frames.
  • Mean, median, lighten and darken stacks produce different renderings for different purposes.
  • Night images can show more than the eye saw and span seconds, which matters for documentary use.
Night mode
A capture mode that merges many frames to make clean images in low light.
Motion metering
Measuring scene and camera motion before capture to choose frame length and count.
Read noise penalty
The extra noise from splitting a fixed exposure into more frames.
Astrophotography mode
A tripod mode merging long frames to photograph the night sky.
Hot pixel
A pixel that reads abnormally high, especially in long exposures.
Dark frame
An exposure with the lens covered, used to subtract fixed pattern and hot pixels.
Flat frame
An exposure of an even surface used to correct vignetting and dust.
500 rule
A rough guide for the longest exposure before stars trail: 500 divided by equivalent focal length.
Live composite
An in-camera lighten stack that shows the image building up.
Sigma clipping
Rejecting values more than a set number of standard deviations from the mean before averaging.

Practice problems

Work each problem on paper first, then reveal the answer to check.

  1. A night mode has 2 s and frames of 1/5 s. How many frames, and what SNR gain?

    Show answer

    10 frames; \( \sqrt{10} \approx 3.2 \).

  2. Why can splitting an exposure into many frames hurt in very dim light?

    Show answer

    Each frame adds read noise, which dominates when each frame's signal is tiny.

  3. Using the 500 rule, what is the maximum exposure for a 20 mm equivalent lens?

    Show answer

    25 s.

  4. Why might a night mode deliberately leave shadows dark?

    Show answer

    So the image looks like night rather than daylight.

  5. What do dark frames remove?

    Show answer

    Fixed-pattern dark signal and hot pixels.

  6. Why average 20 dark frames instead of using one?

    Show answer

    To avoid adding one frame's random noise to every light frame.

  7. Which blend mode creates star trails?

    Show answer

    Lighten (maximum).

  8. Which blend removes aircraft lights crossing a starfield?

    Show answer

    Darken (minimum) or median/sigma clipping.

  9. What does motion metering measure?

    Show answer

    Camera shake and subject motion, via optical flow and gyroscope data.

  10. What should a photojournalist record when using a night mode?

    Show answer

    The mode used, the original files and, where relevant, a conventional exposure.

Lesson quiz · 5 questions

Score 60% or more to complete this lesson.

Take the quiz