TL;DR

A camera sensor captures linear, per-pixel light values that initially appear gray and dark. Converting that raw data into a familiar color photo requires demosaicing, dynamic-range mapping (gamma/sRGB), and white-balance adjustments — many of which cameras already perform for JPEGs.

What happened

The source walks through a raw image of a Christmas tree as recorded by a camera sensor. The sensor’s 14-bit analog-to-digital converter produces numeric luminance readings that, before processing, render as a monotone image because each pixel records only intensity through a color filter. The raw values occupy a limited portion of the ADC’s theoretical range, so the author first rescales black and white points to expand contrast. A Bayer filter gives each pixel a single color component, which the author recoveres into full RGB by averaging neighbors (demosaicing). The linear brightness data looks very dark on typical displays because displays and human vision use non-linear encodings (e.g., sRGB), so a curve is applied to brighten shadows. A green bias from sensor sensitivity and a doubled-green Bayer pattern is corrected by white-balance multipliers applied in a linear stage; reapplying the non-linear curve yields a visually plausible photo. The result is similar to the camera’s in-camera JPEG, illustrating the math cameras use behind the scenes.

Why it matters

  • Raw sensor output is not a finished photo — substantial math is needed to produce what we expect to see.
  • Display limits and human perception force non-linear mapping (gamma) that changes how linear sensor data must be rendered.
  • Color artifacts can come from both sensor physics (green sensitivity, Bayer layout) and demosaicing choices.
  • Adjustments commonly called "editing" are often the same operations cameras already perform automatically for JPEGs.

Key facts

  • The camera uses a 14-bit ADC; the theoretical output range cited is 0–16382.
  • The author reports observed raw ADC values roughly between ~2110 and ~136000 and rescales those as black/white points.
  • A Bayer color filter array gives each pixel one color sample; twice as many green pixels are present in the pattern.
  • Demosaicing here was implemented by averaging neighboring pixel values to produce full RGB at each pixel.
  • Linear sensor data appears dark on displays because most color spaces allocate more precision to darker tones (sRGB curve), and monitors have less dynamic range than sensors or the human eye.
  • White balance was applied by multiplying color channels in the linear stage to remove a green cast.
  • Applying a non-linear curve per channel can desaturate highlights; separate luminance processing preserves color better.
  • The camera’s in-camera JPEG is the result of automated processing steps similar to those demonstrated, so an "unedited" JPEG is not truly raw.

What to watch next

  • Green casts from sensor sensitivity or demosaicing — they may require linear white-balance correction.
  • Noise and the need for denoising or color calibration before final output (source notes these were not addressed in detail).
  • not confirmed in the source: exact denoising and color-calibration steps the author would apply next.

Quick glossary

  • ADC (Analog-to-Digital Converter): A component that measures analog light intensity at each sensor pixel and converts it into digital numeric values.
  • Bayer filter (Bayer matrix): A color filter array placed over the sensor where each pixel is filtered to record only red, green, or blue light; typically contains twice as many green filters.
  • Demosaicing: A process that reconstructs full RGB color for each pixel from the single-color samples produced by a Bayer filter.
  • White balance: An adjustment that scales the red, green, and blue channels so neutral tones (like white) appear neutral under different lighting.
  • Gamma / sRGB curve: A non-linear mapping applied to linear brightness values so images look correct on displays and to match human brightness perception.

Reader FAQ

Is a raw image from the sensor already a color photo?
No. Sensor pixels record intensity through color filters and require demosaicing, color scaling, and tone mapping to become a color image.

Why does raw linear data look very dark?
Because displays and human vision use non-linear encodings (like sRGB) and sensors capture a wider, linear dynamic range that must be remapped to appear correctly on screens.

Does the camera already perform these steps?
Yes. The source shows the camera’s in-camera JPEG is produced by automated math akin to the demonstrated processing, so JPEGs are processed renditions rather than untouched images.

Will applying a curve to each color channel always improve the image?
Not always. Applying curves per channel can desaturate highlights; separating luminance processing from color can preserve better color fidelity.

What an unprocessed photo looks like: Dec 27, 2025 (Photography) Here’s a photo of a Christmas tree, as my camera’s sensor sees it: Sensor data with the 14 bit ADC…

Sources

Related posts

By

Leave a Reply

Your email address will not be published. Required fields are marked *