User:Martin.Budden/Raw

To be viewed or printed a RAW image is typically converted to a Raster graphics format. This processing involves a number of operations:

http://www.cambridgeincolour.com/tutorials/RAW-file-format.htm

Raw image format Color filter array tone mapping

Processing
To be viewed or printed, the output from a camera sensor is typically converted to a Raster graphics format such as JPEG. This processing involves a number of operations:


 * defective pixel removal
 * demosaicing, that is interpolating the the partial raw data received from the color-filtered image sensor into a matrix of colored pixels.
 * noise reduction
 * color balancing, that is accounting for the fact that the pigments used in the camera sensor are different from the pigments in the cone cells of the human eye. Typically this involves converting from the camera sensor color space to an internal working color space such as CIE XYZ
 * white balancing, that is accounting for color temperature of the light that was used to take the photograph
 * gamma correction, that is accounting for the fact that the camera sensor has a linear response to light, whereas the human eye has a nonlinear response
 * color space transformation, conversion from the internal working color space to the output color space (sRGB for JPEG)
 * bit-depth reduction, for example for JPEG files the 10 or more bits per pixel of sensor data is reduced to 8 bits per pixel
 * compression, for example JPEG compression

Note that demosaicing is only performed for CFA sensors, it is not required for 3CCD or foveon sensors.

Cameras and image processing software may also perform additional processing to improve image quality, for example:


 * removal of systematic noise (bias frame subtraction and flat-field correction)
 * dark frame subtraction
 * optical correction, for example: lens distortion correction, vignetting correction and color fringing correction
 * contrast enhancement

When a camera saves a raw file it defers most of this processing, typically the only processing performed is the removal of defective pixels (the DNG specification requires that defective pixels are removed ). Some camera manufacturers do additional processing before saving raw file, for example Nikon has been criticized by astrophotographers for applying noise reduction before saving the raw file.

Some raw formats also allow nonlinear quantization.

File contents
Raw files contain, by necessity, the information required to produce a RGB format file from the camera's sensor data. Although there is no standard raw file format, the structure of raw files often follows a standard pattern, that is:


 * a short file header which typically contains the byte-ordering of the file, a file identifier and an offset into the main file data
 * camera sensor metadata including the size of the sensor, and its color profile
 * image metadata including the exposure time and other EXIF data
 * an image thumbnail
 * optionally a reduced size image in JPEG format
 * the sensor data

Additionally many raw formats (including 3FR(Hasselblad), DCR,K25,KDC(Kodak), CR2(Canon), ERF(Epson), MEF,MOS(Mamiya), NEF(Nikon), ORF(Olympus), PEF(Pentax), RAW,RW2(Panasonic) and ARW,SRF,SR2(Sony)) are TIFF-based

Adobe digital negative format is an extension of the TIFF 6.0 format.

http://www.exif.org/Exif2-2.PDF