Raw image format
A camera raw image file is a file that contains unprocessed data straight from a digital camera. Such data can later be changed into a photo, either within a digital camera itself or by usage of external tools. Raw files are so named because they are not yet processed, and contain large amounts of potentially redundant data. Normally, the image is processed by a raw converter, in a wide-gamut internal color space where precise adjustments can be made before conversion to a viewable photos for storage, printing, or further manipulation. There are dozens of raw formats in use by different manufacturers of digital image capture equipment.
Rationale
Raw image files are sometimes described as "digital negatives". Like transparency film and unlike negative film, raw image pixels contain positive exposure measurements. The raw datasets are more like undeveloped film: a raw image can be developed by software in a non-reversible manner to reach a complete image that resolves every pixel in an RGB or other viewable color space. Raw development adjustments include color, contrast, brightness and details recovery. A given raw dataset can be developed many times with different adjustments.In contrast, developing an exposed film transforms it irreversibly; thus, development cannot be repeated on the same exposed film. If the film is negative, the printing process must invert the image to a positive result.
Like negative photographic film, a raw digital image may have a wider dynamic range or color gamut than the positive print. Unlike physical film after development, the Raw file preserves the information captured at the time of exposure. The purpose of raw image formats is to save, with minimum loss of information, data obtained from the sensor.
Raw image formats are intended to capture the radiometric characteristics of the scene, that is, physical information about the light intensity and color of the scene, at the best of the camera sensor's performance. Most raw image file formats store information sensed according to the geometry of the sensor's individual photo-receptive elements rather than points in the expected final image: sensors with hexagonal element displacement, for example, record information for each of their hexagonally displaced cells, which a decoding software will eventually transform into the rectangular geometry during "digital developing".
File contents
Raw files contain the information required to produce a viewable image from the camera's sensor data. The structure of raw files often follows a common pattern:- A short file header which typically contains an indicator of the byte-ordering of the file, a file identifier and an offset into the main file data
- Camera sensor metadata which is required to interpret the sensor image data, including the size of the sensor, the attributes of the CFA and its color profile
- Image metadata which can be useful for inclusion in any CMS environment or database. These include the exposure settings, camera/scanner/lens model, date of shoot/scan, authoring information and other. Some raw files contain a standardized metadata section with data in Exif format.
- An image thumbnail
- Most raw files contain a full size JPEG conversion of the image, which is used to preview the file on the camera's LCD panel.
- In the case of motion picture film scans, either the timecode, keycode or frame number in the file sequence which represents the frame sequence in a scanned reel. This item allows the file to be ordered in a frame sequence.
- The sensor image data
DNG, the Adobe digital negative format, is an extension of the TIFF 6.0 format and is compatible with TIFF/EP, and uses various open formats and standards, including Exif metadata, XMP metadata, IPTC metadata, CIE XYZ coordinates, ICC profiles, and JPEG.
Sensor image data
In digital photography, the raw file plays the role that photographic film plays in film photography. Raw files thus contain the full dynamic range data as read out from each of the camera's image sensor pixels.The camera's sensor is almost invariably overlaid with a color filter array, usually a Bayer filter, consisting of a mosaic of a 2x2 matrix of red, green, blue and green filters.
One variation on the Bayer filter is the RGBE filter of the Sony Cyber-shot DSC-F828, which exchanged the green in the RG rows with "emerald"
. Other sensors, such as the Foveon X3 sensor, capture information directly in RGB form. This RGB raw data still needs to be processed to make an image file, because the raw RGB values correspond to the responses of the sensors, not to a standard color space like sRGB. As there is no color filter array, there is no need for demosaicing.
Flatbed and film scanner sensors are typically straight narrow RGB or RGBI strips that are swept across an image. The HDRi raw data format is able to store the infrared raw data, which can be used for infrared cleaning, as an additional 16-bit channel. The remainder of the discussion about raw files applies to them as well. Some scanners do not allow the host system access to the raw data at all, as a speed compromise. The raw data are processed very rapidly inside the scanner to select out the best part of the available dynamic range so only the result is passed to the computer for permanent storage, reducing the amount of data transferred and therefore the bandwidth requirement for any given speed of image throughput.
Raw converters
Panasonic's raw converter corrects geometric distortion and chromatic aberration on such cameras as the LX3, with necessary correction information presumably included in the raw. Phase One's raw converter Capture One also offers corrections for geometrical distortion, chromatic aberration, purple fringing and keystone correction emulating the shift capability of tilt-shift in software and specially designed hardware, on most raw files from over 100 different cameras. The same holds for Canon's DPP application, at least for all more expensive cameras like all EOS DSLRs and the G series of compact cameras.To obtain an image from a raw file, this mosaic of data must be converted into standard RGB form. This is often referred to as "raw development".
When converting from the four-sensor 2x2 Bayer-matrix raw form into RGB pixels, each pixel only contains partial colour data and so the remaining colour data is interpolated from the surrounding pixels. There are several algorithms used to achieve this. Simple algorithms such as linear interpolation result in colour artifacts and blurring.
If raw format data is available, it can be used in high-dynamic-range imaging conversion, as a simpler alternative to the multi-exposure HDI approach of capturing three separate images, one underexposed, one correct and one overexposed, and "overlaying" one on top of the other.
Standardization
Providing a detailed and concise description of the content of raw files is highly problematic. There is no single raw format; formats can be similar or radically different. Different manufacturers use their own proprietary and typically undocumented formats, which are collectively known as raw format. Often they also change the format from one camera model to the next. Several major camera manufacturers, including Nikon, Canon and Sony, encrypt portions of the file in an attempt to prevent third-party tools from accessing them.This industry-wide situation of inconsistent formatting has concerned many photographers who worry that their valuable raw photos may someday become inaccessible, as computer operating systems and software programs become obsolete and abandoned raw formats are dropped from new software. The availability of high-quality open source software which decodes raw image formats, particularly dcraw, has helped to alleviate these concerns. An essay by Michael Reichmann and Juergen Specht stated "here are two solutions – the adoption by the camera industry of A: Public documentation of RAW formats; past, present and future, or, more likely B: Adoption of a universal RAW format". "Planning for Library of Congress Collections" identifies generic raw-file formats as "less desirable file formats", and identifies DNG as a suggested alternative.
| Name | Date | Specification available? | Description |
| TIFF/EP | 2001 | Defines a basic framework for storing raw and processed images in TIFF. Is the basis of many other RAW formats: for example, Nikon NEF is essentially TIFF/EP, complete with a tag which identifies the version of TIFF/EP they are based on. | |
| Digital Negative | 2004 | Extension of TIFF/EP, adding information on camera characteristics. Is royalty-free. Progress on DNG has fed back into TIFF/EP: a TIFF/EP progress report from September 2009 states that "This format will be similar to DNG 1.3, which serves as the starting point for development." | |
| Canon Raw v2 | 2005 | Based on TIFF and lossless Jpeg ITU-T81. | |
| Canon Raw v3 | 2018 | Uses the ISO base media file format container with custom tags and a custom "crx" codec. | |
| Sony RAW | 2004 | Based on TIFF container, uses proprietary Makernote fields. May be uncompressed, proprietary lossy-compressed, or Jpeg lossless compressed depending on version. |
DNG is the only raw image format for which industry-wide buy-in is being sought. It is based upon, and compatible with, the ISO standard raw image format ISO 12234-2, TIFF/EP, and is being used by ISO in their revision of that standard. Makers of "niche" cameras who might otherwise have difficulty getting support from software companies frequently use DNG as their native raw image format. Pentax uses DNG as an optional alternative to their own raw image format. There are 15 or more such companies, even a few that specialize in movie cameras, including Leica, Samsung, Ricoh, Pentax, Hasselblad. In addition, most Canon point & shoot cameras can support DNG by using CHDK, and Better Light can export to DNG. Open-source developers also use DNG.