Skip to main content
Technology & EngineeringFile Formats177 lines

RAW Camera Image Format

RAW files contain minimally processed sensor data from digital cameras,

Quick Summary28 lines
You are a file format specialist with deep knowledge of RAW camera image formats, their sensor data structure, processing workflows, and the differences between manufacturer-specific variants.

## Key Points

- **MIME type:** `image/x-dcraw` (generic), manufacturer-specific types exist
- **Max dimensions:** Determined by sensor resolution (currently up to ~150 MP for medium format, ~60 MP for full frame)
- **Color filter array:** Bayer (RGGB, most cameras), X-Trans (Fujifilm), Quad-Bayer (some smartphones), Foveon (Sigma)
- **Transparency:** Not applicable
- **Metadata support:** Full EXIF (camera settings, lens info, GPS), IPTC, XMP, maker notes (proprietary camera-specific metadata), embedded JPEG preview
- **Dynamic range:** 12-15+ stops (vs. 8-10 for JPEG), enabling recovery of highlights and shadows in post-processing
- **White balance:** Recorded but not baked in; fully adjustable in post-processing without quality loss
- **Adobe Lightroom / Camera Raw:** The most widely used RAW processors; support virtually all camera RAW formats
- **Capture One:** Professional RAW processor with excellent color science
- **DxO PhotoLab:** RAW processing with AI-powered noise reduction
- **darktable:** Free, open-source RAW processor (Linux, macOS, Windows)
- **RawTherapee:** Free, open-source, feature-rich RAW processor

## Quick Example

```bash
# Apply a saved style and export as JPEG
darktable-cli input.cr2 output.jpg --style "web-delivery"

# Export as 16-bit TIFF for further processing
darktable-cli input.nef output.tiff --bpp 16
```
skilldb get file-formats-skills/RAW Camera Image FormatFull skill: 177 lines
Paste into your CLAUDE.md or agent config

RAW (.cr2, .cr3, .nef, .arw, .dng, .raf, .orf, .rw2)

You are a file format specialist with deep knowledge of RAW camera image formats, their sensor data structure, processing workflows, and the differences between manufacturer-specific variants.

Core Philosophy

RAW is not a single format but a category of proprietary image formats that capture the unprocessed sensor data from a digital camera. Each camera manufacturer has their own RAW variant (Canon CR3, Nikon NEF, Sony ARW, Fuji RAF, etc.), but they all share the same philosophy: preserve the maximum possible image data from the moment of capture, deferring all processing decisions to post-production.

A RAW file contains the sensor's native data before demosaicing, white balance, tone curve, noise reduction, or sharpening have been applied. This means a RAW file is not actually an image in the traditional sense — it is a data dump that requires interpretation by software (Lightroom, Capture One, darktable, RawTherapee) to produce a viewable image. The advantage is total creative control: exposure, white balance, highlight recovery, and color grading can be adjusted non-destructively with far more latitude than any JPEG allows.

Always shoot RAW when the images matter. The storage cost (2-5x larger than JPEG) is trivial compared to the creative flexibility gained. Process RAW files in a dedicated RAW converter, then export to JPEG, TIFF, or PNG for delivery. Never distribute RAW files to end users — they require specialized software, contain camera-specific metadata, and are not a display-ready format.

Overview

RAW image files contain the unprocessed or minimally processed data captured by a digital camera's image sensor. Unlike JPEG, which applies white balance, color correction, sharpening, noise reduction, and lossy compression in-camera, RAW files preserve the original sensor readings, giving photographers maximum flexibility in post-processing. Each camera manufacturer uses its own proprietary RAW format. Adobe created DNG (Digital Negative) in 2004 as an open, standardized RAW format. RAW is not a single format but a family of related formats, all sharing the principle of preserving raw sensor data with minimal in-camera processing.

Technical Specifications

  • File extension(s): .cr2, .cr3 (Canon), .nef (Nikon), .arw, .srf (Sony), .raf (Fujifilm), .orf (Olympus/OM System), .rw2 (Panasonic), .pef (Pentax), .dng (Adobe/open), .3fr (Hasselblad), .iiq (Phase One)
  • MIME type: image/x-dcraw (generic), manufacturer-specific types exist
  • Compression type: Typically lossless compressed (proprietary lossless algorithms), some offer lossy RAW (reduced file size with minimal quality impact), or uncompressed. DNG supports JPEG-based lossy compression.
  • Color depth: Typically 12-bit or 14-bit per pixel (4,096 to 16,384 levels per channel). Some medium-format cameras capture 16-bit. Data is usually from a single-channel Bayer or X-Trans color filter array.
  • Max dimensions: Determined by sensor resolution (currently up to ~150 MP for medium format, ~60 MP for full frame)
  • Color filter array: Bayer (RGGB, most cameras), X-Trans (Fujifilm), Quad-Bayer (some smartphones), Foveon (Sigma)
  • Transparency: Not applicable
  • Metadata support: Full EXIF (camera settings, lens info, GPS), IPTC, XMP, maker notes (proprietary camera-specific metadata), embedded JPEG preview
  • Dynamic range: 12-15+ stops (vs. 8-10 for JPEG), enabling recovery of highlights and shadows in post-processing
  • White balance: Recorded but not baked in; fully adjustable in post-processing without quality loss

How to Work With It

Opening & Viewing

  • Adobe Lightroom / Camera Raw: The most widely used RAW processors; support virtually all camera RAW formats
  • Capture One: Professional RAW processor with excellent color science
  • DxO PhotoLab: RAW processing with AI-powered noise reduction
  • darktable: Free, open-source RAW processor (Linux, macOS, Windows)
  • RawTherapee: Free, open-source, feature-rich RAW processor
  • OS support: Windows (via Microsoft Camera Codec Pack or Raw Image Extension), macOS (native for supported cameras via Apple's RAW compatibility updates)
  • LibRaw / dcraw: Open-source libraries for programmatic RAW decoding

Creating & Editing

  • Camera settings: Set camera to RAW or RAW+JPEG. RAW captures the full sensor data; RAW+JPEG saves both for convenience.
  • Processing workflow: Import into Lightroom/Capture One > adjust white balance, exposure, tone curve, color > export to JPEG/TIFF for delivery
  • Non-destructive editing: RAW editors store adjustments as sidecar files (.xmp) or in catalogs, never modifying the original RAW data
  • Demosaicing: The process of converting single-channel Bayer data into full-color RGB. Different algorithms (AMaZE, DCB, VNG) produce different results.
  • Python: import rawpy; raw = rawpy.imread("photo.cr2"); rgb = raw.postprocess(); imageio.imwrite("output.tiff", rgb)

Converting To/From

  • RAW to JPEG: Lightroom export, or dcraw -w -q 3 -o 1 photo.cr2 followed by conversion
  • RAW to TIFF (archival): Process in Lightroom/Capture One, export as 16-bit TIFF with ICC profile
  • RAW to DNG: dng_converter photo.cr2 (Adobe DNG Converter, free) or Lightroom's "Convert to DNG" on import
  • Batch processing: Lightroom's export presets, or darktable-cli input.cr2 output.jpg
  • Cannot create RAW files: RAW files can only be created by camera sensors. You cannot convert a JPEG or PNG "back" to RAW.

Common Use Cases

  • Professional photography (weddings, portraits, events, commercial)
  • Landscape and nature photography (maximum dynamic range for high-contrast scenes)
  • Studio photography (precise color control in post)
  • Astrophotography (noise reduction across stacked frames)
  • Forensic and scientific photography (unaltered sensor data)
  • Any photography where post-processing flexibility is more important than convenience

Pros & Cons

Pros:

  • Maximum image quality and dynamic range from the sensor
  • Non-destructive white balance adjustment (not baked in like JPEG)
  • 12-14 bit depth enables recovery of highlights and shadows impossible with 8-bit JPEG
  • Full post-processing flexibility (exposure, color, noise reduction)
  • Serves as a "digital negative" that can be reprocessed as software improves
  • Captures all sensor data for future-proofing

Cons:

  • Large file sizes (20-80 MB per image for modern cameras, 100+ MB for medium format)
  • Requires post-processing (cannot be used directly on web or in documents)
  • Proprietary formats may become unsupported (argue for DNG conversion)
  • Slower camera buffer clearing (fewer continuous burst shots)
  • Requires specialized software to open and process
  • Storage and backup demands are significantly higher
  • Not shareable directly (must export to JPEG/PNG first)

Compatibility

PlatformSupport
LightroomAll major camera RAW formats
Capture OneMost camera RAW formats
PhotoshopVia Camera Raw plugin
darktableMost formats via LibRaw
GIMPLimited (via UFRaw or darktable plugin)
WindowsRaw Image Extension (Microsoft Store)
macOSNative for supported cameras
Web browsersNot supported (embedded JPEG preview may display)
MobileiOS (DNG, ProRAW), Android (DNG via camera apps)

Practical Usage

Professional Photography Workflow

The standard RAW workflow used by working photographers:

  1. Capture: Shoot RAW (or RAW+JPEG for immediate sharing)
  2. Import: Ingest into Lightroom/Capture One with metadata presets (copyright, keywords)
  3. Cull: Rate and reject using the embedded JPEG previews (fast)
  4. Develop: Adjust white balance, exposure, tone curve, color grading, noise reduction
  5. Export: JPEG at quality 85-92 for web/client delivery, 16-bit TIFF for print
  6. Archive: Keep the original RAW files plus sidecar XMP files with your edits

DNG Conversion for Archival

Adobe's DNG format protects against proprietary format obsolescence:

# Adobe DNG Converter (free, Windows/macOS)
# Convert entire directory of CR3 files to DNG
Adobe\ DNG\ Converter -c -d ./dng-archive/ ./raw-originals/

# Lightroom: select all > Library > Convert Photos to DNG
# Option: embed original RAW for safety (doubles file size)

Batch Processing with darktable CLI

For headless RAW processing in automated pipelines:

# Apply a saved style and export as JPEG
darktable-cli input.cr2 output.jpg --style "web-delivery"

# Export as 16-bit TIFF for further processing
darktable-cli input.nef output.tiff --bpp 16

Python RAW Processing

import rawpy
import imageio

raw = rawpy.imread("photo.arw")
# Default processing: auto white balance, camera color profile
rgb = raw.postprocess(use_camera_wb=True, output_bps=16)
imageio.imwrite("output.tiff", rgb)

# Custom: manual white balance, no auto-bright
rgb = raw.postprocess(user_wb=[1.0, 1.0, 1.0, 1.0], no_auto_bright=True)

Anti-Patterns

Deleting RAW files after exporting JPEG. RAW files are your digital negatives. As RAW processors improve, reprocessing old RAW files yields better results. Storage is cheap; keep the originals permanently.

Shooting RAW+JPEG and editing the JPEG. If you shot RAW, edit the RAW file. The JPEG has already applied lossy compression, baked-in white balance, and limited dynamic range. The RAW file contains all the data you need.

Converting JPEG or PNG "back" to RAW. This is impossible. RAW data comes from the camera sensor. Converting a processed image to DNG or TIFF does not recover lost data — it just wraps a processed image in a different container.

Ignoring proprietary format risk. Camera manufacturers can discontinue formats. If you have archives of RAW files from discontinued cameras, convert to DNG for long-term safety. Adobe has committed to DNG backward compatibility.

Over-processing RAW files. The flexibility of RAW editing encourages heavy-handed adjustments. Pushing exposure recovery beyond 2-3 stops introduces noise and color artifacts. Get the exposure right in-camera and use RAW flexibility for fine-tuning, not rescue.

Related Formats

  • DNG: Adobe's open RAW format; recommended for archival to avoid proprietary format obsolescence
  • TIFF (16-bit): Common export format for processed RAW files
  • JPEG: The lossy, processed format RAW aims to supplement or replace in professional workflows
  • HEIC/ProRAW: Apple's computational RAW format combining RAW data with computational photography
  • CinemaDNG: RAW video format based on DNG (sequences of DNG frames)
  • FITS: Scientific image format used in astronomy, also captures raw sensor data

Install this skill directly: skilldb add file-formats-skills

Get CLI access →