Camera RAW Image
RAW files contain unprocessed sensor data from digital cameras, preserving full 12-16 bit dynamic range and color information before in-camera processing. Each manufacturer uses proprietary variants (Canon CR2/CR3, Nikon NEF, Sony ARW). Develop RAW files with darktable, RawTherapee, or dcraw.
Camera RAW files use manufacturer-specific sensor data formats requiring proprietary demosaicing algorithms.
Looking to convert? Try a related format:
Common questions
How do I open and inspect a camera RAW file?
Use darktable or RawTherapee (both free) for full development. For quick viewing, IrfanView (Windows) or macOS Preview handle most RAW formats. For metadata-only inspection, use exiftool -a -G1 input.raw to see all EXIF, MakerNote, and XMP fields without loading pixel data.
What is the difference between RAW and DNG?
RAW is a generic term for vendor-specific sensor data formats (CR2, NEF, ARW). DNG is Adobe's open standard that wraps raw sensor data in a documented TIFF-based container. DNG ensures long-term readability and can embed the original RAW file for safety.
Does converting RAW to JPEG lose quality?
Yes. RAW to JPEG applies demosaicing, white balance, tone curves, and lossy JPEG compression — all irreversible. The resulting 8-bit JPEG has 2-4 fewer stops of dynamic range. For archival, convert to 16-bit TIFF or DNG instead.
Why do different cameras use different RAW formats?
Each manufacturer designs their RAW format around their specific sensor layout (Bayer, X-Trans), bit depth (12/14/16), compression codec, and proprietary metadata (autofocus data, lens corrections). There is no industry-wide standard despite Adobe's DNG effort.
What makes .RAW special
What is a RAW file?
RAW files contain minimally processed image data directly from a digital camera or scanner sensor. Unlike JPEG, which applies compression and processing in-camera, RAW preserves the full dynamic range and color information captured by the sensor. Each camera manufacturer uses their own RAW variant (CR2, NEF, ARW, etc.).
Continue reading — full technical deep dive
How to open RAW files
- Adobe Lightroom (Windows, macOS) — Industry standard
- Adobe Camera Raw (Windows, macOS) — Photoshop plugin
- Capture One (Windows, macOS) — Professional
- darktable (Windows, macOS, Linux) — Free, open-source
- RawTherapee (Windows, macOS, Linux) — Free
Technical specifications
| Property | Value |
|---|---|
| Compression | None or lossless |
| Bit Depth | 12-16 bit per channel |
| Color Space | Sensor-native (Bayer, X-Trans) |
| Metadata | EXIF, GPS, camera settings |
| Variants | CR2/CR3 (Canon), NEF (Nikon), ARW (Sony) |
Common use cases
- Professional photography: Maximum post-processing flexibility.
- Landscape photography: Preserving highlight and shadow detail.
- Archiving: Highest quality preservation of photographs.
- HDR imaging: Merging exposures from RAW data.
.RAW compared to alternatives
| Formats | Criteria | Winner |
|---|---|---|
| .RAW vs .JPEG | Dynamic range and editing flexibility RAW preserves 12-16 bits of sensor data per channel (4,096-65,536 levels) versus JPEG's 8 bits (256 levels). This provides 2-4 extra stops of shadow/highlight recovery in post-processing. JPEG applies destructive compression and tone curves in-camera. | RAW wins |
| .RAW vs .DNG | Long-term archival DNG is Adobe's open standard for RAW data, eliminating dependency on proprietary vendor software for future access. DNG embeds the original RAW data (optionally) plus standardized metadata. Vendor RAW formats risk becoming unreadable as camera companies discontinue support. | DNG wins |
| .RAW vs .HEIF | File size and quality HEIF produces smaller files than JPEG with better quality, but it still applies lossy compression and in-camera processing. RAW retains the unprocessed sensor data for maximum editing latitude, at the cost of 3-5x larger file sizes. | RAW wins |
Technical reference
- MIME Type
image/x-dcraw- Developer
- Various camera manufacturers
- Year Introduced
- 1990
- Open Standard
- No
Binary Structure
Most camera RAW formats use a TIFF-based wrapper structure. The file begins with a TIFF header: bytes 0-1 are the byte order marker (49 49 for little-endian / Intel, 4D 4D for big-endian / Motorola), bytes 2-3 are the magic number (2A 00 for standard TIFF, used by CR2 and NEF; OR 52 for Sony ARW/Panasonic RW2). Bytes 4-7 contain the offset to the first IFD (Image File Directory). Each IFD is a sequence of 12-byte entries: 2-byte tag ID, 2-byte data type, 4-byte count, and 4-byte value/offset. The first IFD (IFD0) typically contains EXIF metadata, a thumbnail JPEG, and pointers to the main image data. Canon CR2 files store the raw sensor data in IFD3 as a lossless JPEG (Huffman-coded) strip; the CR2-specific tag at offset 0x10 in the TIFF header points to CR2 slice information. Nikon NEF stores compressed or uncompressed sensor data in a sub-IFD, with a MakerNote IFD containing Nikon-specific white balance, lens, and focus data. Sony ARW files use a modified TIFF structure with the sensor data compressed using Sony's proprietary lossy or lossless codec. The actual sensor data is a mosaic of single-color photosites arranged in a Color Filter Array (CFA) pattern — most commonly the Bayer pattern (RGGB, GRBG, GBRG, or BGGR) or Fujifilm's X-Trans 6x6 pattern. Each photosite stores a single luminance value at 12-14 bits (consumer) or 14-16 bits (professional cameras). RAW development software demosaics this CFA data into full-color RGB pixels, applies white balance, gamma curves, noise reduction, and lens corrections. The embedded JPEG preview (usually in IFD0 or IFD1) provides a camera-processed thumbnail for quick display without full RAW decoding.
| Offset | Length | Field | Example | Description |
|---|---|---|---|---|
0x00 | 2 bytes | Byte order | 49 49 | 49 49 (II) = little-endian / Intel. 4D 4D (MM) = big-endian / Motorola. Determines byte order for all subsequent multi-byte fields. |
0x02 | 2 bytes | TIFF magic | 2A 00 | 0x002A = standard TIFF (CR2, NEF, DNG). Sony ARW uses 0x0052. Identifies the file as TIFF-based. |
0x04 | 4 bytes | IFD0 offset | 08 00 00 00 | Byte offset to the first Image File Directory. Usually 0x08 (immediately after the header). |
IFD0 | 2 + N*12 bytes | IFD entries | varies | 2-byte entry count followed by 12-byte tag entries. Contains EXIF, thumbnail, and sensor data pointers. |
IFD entry | 12 bytes | IFD tag entry | 0F 01 02 00 ... | Tag ID (2B), data type (2B), count (4B), value/offset (4B). Tag 0x010F = Make, 0x0110 = Model. |
varies | varies | Sensor data (CFA) | compressed or raw | Bayer mosaic pixel data: 12-16 bits per photosite. Compressed (lossless JPEG, Sony codec) or uncompressed depending on camera settings. |
Attack Vectors
- Malformed TIFF IFD entries can trigger integer overflows or buffer overflows in RAW decoders that do not validate tag lengths
- Crafted MakerNote data targeting specific vendor parsers can exploit vendor-specific decoding logic in LibRaw and dcraw
Mitigation: FileDex does not open, execute, or parse RAW files. Reference page only.