RAW (.cr2, .cr3, .nef, .arw, .dng, .raf, .orf, .rw2)
0
Upvotes
3
Views
0
Downloads
1,370
Words
Description
Explains RAW camera formats, sensor data, and processing workflows; useful for understanding format differences and RAW post-processing across manufacturers.
When to Use
Explain RAW formats and their variants | What are RAW sensor data and processing workflows? | Compare RAW formats by manufacturer | Describe DNG vs proprietary RAW formats
Use Cases
Identify RAW formats by extension and vendor | Plan RAW development workflows in post-processing | Compare RAW variants for color depth and Bayer types | Debug RAW conversions across editors and viewers
SKILL.md Content
---
name: raw
description: "Explains RAW camera formats, sensor data, and processing workflows; useful for understanding format differences and RAW post-processing across manufacturers."
metadata:
tags: "file-formats, raw-image, camera-format-variants, sensor-data, post-processing, manufacturer-differences, dng"
source: "https://skilldb.dev/skills/file-formats-skills/raw"
pack: "file-formats-skills"
category: "Technology & Engineering"
---
# RAW (.cr2, .cr3, .nef, .arw, .dng, .raf, .orf, .rw2)
## When to use this skill
Use when the user says things like:
- "Explain RAW formats and their variants"
- "What are RAW sensor data and processing workflows?"
- "Compare RAW formats by manufacturer"
- "Describe DNG vs proprietary RAW formats"
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.
## 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
| Platform | Support |
|----------|---------|
| Lightroom | All major camera RAW formats |
| Capture One | Most camera RAW formats |
| Photoshop | Via Camera Raw plugin |
| darktable | Most formats via LibRaw |
| GIMP | Limited (via UFRaw or darktable plugin) |
| Windows | Raw Image Extension (Microsoft Store) |
| macOS | Native for supported cameras |
| Web browsers | Not supported (embedded JPEG preview may display) |
| Mobile | iOS (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:
```bash
# 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:
```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
```
### Python RAW Processing
```python
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