When professional photographers capture images on digital mirrorless or DSLR cameras, they rarely set the camera to save standard JPEG or HEIC files. Instead, they capture files ending in extensions like .dng, .cr3 (Canon), .nef (Nikon), or .arw (Sony)—collectively known as RAW image files.
Why are RAW files four to five times larger than JPEGs? Why can’t standard web browsers display them, and what makes a RAW file fundamentally different from an ordinary digital picture?
What Is a RAW File? The “Digital Negative”
The most important technical concept to understand is that a RAW file is not actually an image yet.
When an ordinary camera captures a JPEG:
- The camera’s digital sensor records light intensity.
- The camera’s internal computer permanently applies white balance, sharpens edges, boosts color saturation, compresses the dynamic range down to 8 bits, and discards all discarded sensor data forever.
A RAW file, by contrast, is a direct, unadulterated dump of the raw electrical voltages recorded by every individual photosite (pixel) on the camera’s image sensor. It represents the modern digital equivalent of an undeveloped photographic negative.
The Physics: The Bayer Color Filter Array
Camera sensor photosites are completely colorblind. They are silicon diodes that only measure the intensity of light photons, not their wavelength (color).
To capture color photography, manufacturers cover the sensor with a mosaic of colored microscopic filters known as the Bayer Filter Array (RGGB pattern):
- 50% of the pixels are covered by Green filters (matching the human eye’s peak sensitivity to luminance).
- 25% are covered by Red filters.
- 25% are covered by Blue filters.
[ THE BAYER FILTER MOSAIC ]
┌───┬───┬───┬───┐
│ R │ G │ R │ G │
├───┼───┼───┼───┤
│ G │ B │ G │ B │
├───┼───┼───┼───┤
│ R │ G │ R │ G │
└───┴───┴───┴───┘
In a RAW file, each pixel coordinate stores only a single color channel (either Red, Green, or Blue) alongside a massive bit-depth integer.
The Transformation: The Demosaicing Algorithm
Because a RAW file contains single-channel mosaic values, it cannot be rendered directly onto an RGB computer screen. It must undergo Demosaicing (or de-Bayering) inside software like Adobe Lightroom, Camera Raw, or open-source darktable:
- The software analyzes neighboring photosites using complex mathematical interpolation (such as the AHD (Adaptive Homogeneity-Directed) or AMaZE algorithms).
- It calculates the missing two color values for every single pixel, reconstructing a full, three-channel RGB raster image.
- Crucially, white balance is not permanent. Because color temperatures have not been baked in, an editor can adjust a photo from 3200K (candlelight) to 6500K (daylight) with zero image degradation or noise introduction!
Bit Depth & Dynamic Range: RAW vs. JPEG
| Attribute | Standard JPEG | Camera RAW |
|---|---|---|
| Color Bit Depth | 8-bit (256 tonal steps per channel) | 14-bit or 16-bit (16,384+ tonal steps per channel) |
| Total Colors Possible | 16.7 Million | Over 4.3 Trillion |
| Shadow & Highlight Recovery | Severely limited (Highlights clip to pure white) | Massive (Can recover 3 to 4 stops of blown highlights) |
| White Balance Setting | Permanently burned into pixel data | Completely adjustable metadata tag |
| Compression | Lossy DCT (Discarded data) | Lossless or uncompressed raw data |
| Typical File Size (24MP) | 5 MB – 8 MB | 25 MB – 45 MB |
| Web Browser Display | Universal native support | Cannot be displayed natively in browsers |
Proprietary RAW vs. Adobe DNG (Digital Negative)
Every camera manufacturer uses a proprietary, closed-source RAW format:
- Canon:
.cr2,.cr3 - Nikon:
.nef - Sony:
.arw - Fujifilm:
.raf
Because these formats are proprietary, new camera models frequently cannot be opened by editing software until the software vendor releases a specific camera profile update.
To solve this long-term preservation risk, Adobe created the DNG (Digital Negative) format in 2004, releasing it as a publicly documented open standard. DNG wraps raw sensor data, Bayer mosaic metadata, and color matrices inside a documented TIFF 6.0 compatible container, ensuring that raw photos taken today can still be developed by software fifty years from now.