Jump to content

Raw image format: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Schngrg (talk | contribs)
Line 64: Line 64:
* The sensor image data
* The sensor image data


Many raw file formats (including 3FR (Hasselblad), DCR, K25, KDC(Kodak), CR2 (Canon), ERF (Epson), MEF (Mamiya), MOS (Leaf), NEF (Nikon), ORF (Olympus), PEF (Pentax), RAW, RW2 (Panasonic) and ARW, SRF, SR2 (Sony)) are based on the TIFF file format.<ref>{{cite web | title=Exif Tool, Supported File Types | url=http://www.sno.phy.queensu.ca/~phil/exiftool/#supported}}</ref> These files may deviate from the TIFF standard in a number of ways, including: the use of a non-standard file header, the inclusion of additional image tags and the encryption of some of the tagged data.
Many raw file formats (including 3FR (Hasselblad), DCR, K25, KDC(Kodak), CR2 (Canon), ERF (Epson), MEF (Mamiya), MOS (Leaf), NEF (Nikon), ORF (Olympus), PEF (Pentax), RAW, RW2 (Panasonic) and ARW, SRF, SR2 (Sony)) are based on the TIFF file format.<ref>{{cite web | title=Exif Tool, Supported File Types | url=http://www.sno.phy.queensu.ca/~phil/exiftool/#supported}}</ref> These files may deviate from the TIFF standard in a number of ways, including the use of a non-standard file header, the inclusion of additional image tags and the encryption of some of the tagged data.


Panasonic's raw converter corrects geometric distortion and [[chromatic aberration]] on such cameras as the LX3,<ref>[http://theonlinephotographer.typepad.com/the_online_photographer/2008/12/panasonic-lx3-b.html The Online Photographer: Panasonic LX3 Barrel Distortion Controversy]</ref><ref>[http://www.imaging-resource.com/PRODS/LX3/LX3A4.HTM Panasonic LX3 Lens Distortion]</ref><ref>[http://www.seriouscompacts.com/2008/10/panasonic-lx3-lens-distortion.html ]</ref> with necessary correction information presumably included in the raw.{{Fact|date=May 2009}}
Panasonic's raw converter corrects geometric distortion and [[chromatic aberration]] on such cameras as the LX3,<ref>[http://theonlinephotographer.typepad.com/the_online_photographer/2008/12/panasonic-lx3-b.html The Online Photographer: Panasonic LX3 Barrel Distortion Controversy]</ref><ref>[http://www.imaging-resource.com/PRODS/LX3/LX3A4.HTM Panasonic LX3 Lens Distortion]</ref><ref>[http://www.seriouscompacts.com/2008/10/panasonic-lx3-lens-distortion.html ]</ref> with necessary correction information presumably included in the raw.{{Fact|date=May 2009}}

Revision as of 09:19, 29 May 2009

Raw image file
Filename extension

.3fr (Hasselblad)
.arw .srf .sr2
 (Sony)
.bay (Casio)
.crw .cr2 (Canon)
.cap .tif .iiq .eip
 (Phase_One)
.dng (Adobe)
.erf (Epson)
.fff (Imacon)
.mef (Mamiya)
.mos (Leaf)
.mrw (Minolta)
.nef .nrw (Nikon)
.orf (Olympus)
.ptx .pef (Pentax)
.pxn (Logitech)
.r3d (Red)
.raf (Fuji)
.raw .rw2 (Panasonic)
.rwz (Rawzor) .tif .k25 .kdc .dcs
.dcr .drf
(Kodak)

.x3f (Sigma)
Type of formatImage file formats

A raw image file contains minimally processed data from the image sensor of either a digital camera, image or motion picture film scanner. Raw files are so named because they are not yet processed and therefore are not ready to be used with a bitmap graphics editor or printed. Normally, the image is processed by a raw converter in a wide-gamut internal colorspace where precise adjustments can be made before conversion to a "positive" file format such as TIFF or JPEG for storage, printing, or further manipulation, which often encodes the image in a device-dependent colorspace. These images are often described as "RAW image files" based on the erroneous belief that they represent a single file format. In fact there are dozens if not hundreds of raw image formats in use by different models of digital equipment (like cameras or film scanners).[1]

Raw image files are sometimes called digital negatives, as they fulfill the same role as negatives in film photography: that is, the negative is not directly usable as an image, but has all of the information needed to create an image. Likewise, the process of converting a raw image file into a viewable format is sometimes called developing a raw image, by analogy with the film development process used to convert photographic film into viewable prints. The selection of the final choice of image rendering is part of the process of white balancing and color grading.

Like a photographic negative, a raw digital image may have a wider dynamic range or color gamut than the eventual final image format, and is usually the one "closest" to the real picture in the sense that it preserves most of its details. Raw image formats' purpose is to faithfully record both 100% of exactly what the sensor "saw" or "sensed" (the data), and the conditions surrounding the recording of the image (the metadata).

Rationale

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.[2]

This industry-wide situation of inconsistent formatting has concerned many photographers who worry that their valuable raw photos may someday become inaccessible, as operating systems and applications 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.

There are several would-be standards competing for digital camera industry buy-in. (See the "Standardization section, below.)

Raw image formats are intended to reproduce as closely as possible (i.e. at the best of the specific sensor's performance) the sensitometry of the image, that is, physical information about the light intensity and color of the scene.

Most raw image file formats store information sensed according to the geometry of the sensor's individual photo-receptive elements (sometimes called pixels), 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, by necessity, the information required to produce a viewable image from the camera's sensor data. Although there is no standard raw file format, the structure of raw files often follows a common pattern, that is:

  • 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. This includes the size of the sensor, the attributes of the CFA and its color profile
  • Image metadata which is required for inclusion in any CMS environment or database. These include the exposure settings, camera/scanner/lens model, date (and, optionally, place) of shoot/scan, authoring information and other. Some raw files contain a standardized metadata section with data in EXIF format.
  • An image thumbnail
  • Optionally a reduced-size image in JPEG format, which can be used for a quick and less computing-intensive preview.
  • 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 is a most important metadata item, because it allows the file to be ordered in a frame sequence (without relying on its filename).
  • The sensor image data

Many raw file formats (including 3FR (Hasselblad), DCR, K25, KDC(Kodak), CR2 (Canon), ERF (Epson), MEF (Mamiya), MOS (Leaf), NEF (Nikon), ORF (Olympus), PEF (Pentax), RAW, RW2 (Panasonic) and ARW, SRF, SR2 (Sony)) are based on the TIFF file format.[3] These files may deviate from the TIFF standard in a number of ways, including the use of a non-standard file header, the inclusion of additional image tags and the encryption of some of the tagged data.

Panasonic's raw converter corrects geometric distortion and chromatic aberration on such cameras as the LX3,[4][5][6] with necessary correction information presumably included in the raw.[citation needed]

The Adobe digital negative format is an extension of the TIFF 6.0 format.[7]

Sensor image data

Digital camera raw files contain the pixel data from a rectangular image sensor, the digital equivalent of photographic film, usually at 12 or 14 bits per pixel. The sensor is almost invariably overlaid with a color filter array, usually a Bayer filter, consisting of a mosaic of red, blue and green filters. Given that three colors fit uncomfortably in a rectangular grid, green was chosen to be doubly present, since the human eye is more sensitive to it. Green also often serves as the luminance channel, and as the dominant channel for in-camera black-and-white conversions. To retrieve an image from a raw file, this mosaic of data must be converted into a full RGB image. This is often referred to as digital development.

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"[8] (a blue-green[9] or cyan[10] color). Other sensors, such as the Foveon X3 sensor capture information directly in RGB form, having three pixel sensors in each location, one for each color component; these camera RGB raw data still need to be processed to make an image file, as the RGB values correspond to the responses of the sensors, not to a standard color space like sRGB, though they do not need to be demosaiced.

Flatbed and film scanner sensors are typically straight narrow RGB or RGBI (where "I" is infrared) strips that are swept across an image; other than that, 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.)

Benefits

Nearly all digital cameras can process the image from the sensor into a JPEG file using settings for white balance, color saturation, contrast, and sharpness that are either selected automatically or entered by the photographer before taking the picture. Cameras that support raw files save these settings in the file, but defer the processing. This results in an extra step for the photographer, so raw is normally only used when additional computer processing is intended. However, raw has numerous advantages over JPEG such as:

  • Higher image quality. Because all the calculations (such as applying the gamma curve, demosaicing, white balance, brightness, contrast, etc...) used to generate pixel values (in RGB format for most images) are performed in one step on the base data, the resultant pixel values will be more accurate and exhibit less posterization.
  • Bypassing of undesired steps in the camera's processing, including sharpening and noise reduction
  • JPEG images are typically saved using a lossy compression format (though a lossless JPEG compression is now available). Raw formats are typically either uncompressed or use lossless compression, so the maximum amount of image detail is always kept within the raw file.
  • Finer control. Raw conversion software allows users to manipulate more parameters (such as lightness, white balance, hue, saturation, etc...) and do so with greater variability. For example, the white point can be set to any value, not just discrete preset values like "daylight" or "incandescent".
  • Camera raw files have 12 or 14 bits of intensity information, not the gamma-compressed 8 bits stored in JPEG files (and typically stored in processed TIFF files); since the data is not yet rendered and clipped to a color space gamut, more precision may be available in highlights, shadows, and saturated colors.
  • The color space can be set to whatever is desired.
  • Different demosaicing algorithms can be used, not just the one coded into the camera.
  • The contents of raw files include more information, and potentially higher quality, than the converted results, in which the rendering parameters are fixed, the color gamut is clipped, and there may be quantization and compression artifacts.
  • Large transformations of the data, such as increasing the exposure of a dramatically under-exposed photo, result in less visible artifacts when done from raw data than when done from already rendered image files. Raw data leave more scope for both corrections and artistic manipulations, without resulting in images with visible flaws such as posterization.

Drawbacks

  • Camera raw files are typically 2–6 times larger than JPEG files.[11] While use of raw formats avoids the compression artifacts inherent in JPEG, fewer images can fit on a given memory card. However, software like Rawzor can do lossless compression of camera raw images, reducing the disk space needed to store them without loosing any quality or meta-information.[12]
  • It takes longer for the camera to write raw image files to the card, since they are larger, so fewer pictures can be taken in quick succession (affecting the ability to shoot, for example, a sports sequence).
  • Most raw formats do not use compression or implement light lossless data compression to reduce the size of the files without affecting image quality. But some others use lossy data compression where quantization and filtering is performed on the image data[13][14]. Many recent cameras let photographers choose between no compression, lossless compression or lossy compression for their raw images.
  • There is still no widely accepted standard raw format. Three potential candidates for a standard format have been put forward, but none has been adopted by many major camera companies. Numerous different raw formats are currently in use and new raw formats keep appearing, while others are abandoned.[15].
  • Because of the lack of a standard raw format, more specialized software may be required to open raw files than for standardized formats like JPEG or TIFF. Software developers have to frequently update their products to support the raw formats of the latest cameras but open source implementations like dcraw make it easy.
  • The time taken in the image workflow is an important factor when choosing between raw and ready-to-use image formats. With modern photo editing software the additional time needed to process raw images has been greatly reduced but it still requires an extra step in workflow.

Software support

Cameras that support raw files typically come with proprietary software for conversion of their raw image data into standard RGB images. Other processing and conversion programs and plugins are available from vendors that have either licensed the technology from the camera manufacturer or reverse-engineered the particular raw format and provided their own processing algorithms.

Raw file formats are proprietary, and differ greatly from one manufacturer to another, and sometimes between cameras made by one manufacturer. Adobe Photoshop CS2 and CS3 (and most recently, CS4) contain extensive support of raw formats as does Adobe Photoshop Lightroom. In addition, Adobe has proposed its own Digital Negative file format (DNG). As of 2006, several camera manufacturers have started to announce support for DNG in newer camera models, including Leica, Samsung, Ricoh, Pentax (native camera support) and Hasselblad (export). The Leica Digital-Modul-R (DMR) was first to use DNG as its native format.

Microsoft's Digital Image 2006 recognizes and organizes raw image formats such as .crw, .cr2, and .nef, which are file formats produced by Canon and Nikon,[citation needed] but that product was discontinued in 2007.[16]

For Windows XP, there is a free download available that integrates viewing and printing into other included photo tools, but it is not supported by Microsoft.[17]

Windows XP and Vista both support the WIC codec standard. Products such as Windows Photo Gallery, Windows Live Photo Gallery and FastPictureViewer Professional[18] can view raw formats for which the necessary WIC codecs are installed. Camera manufacturers Canon, Nikon, Sony, Olympus and Pentax have released WIC codecs although some manufactures are only providing codec support for the 32bit versions of Vista.[19] A commercial DNG codec is also available from Ardfry Imaging.[20]

In 2005, Apple Computer introduced several products which offered raw file support. In January, Apple released iPhoto 5, which offered basic support for viewing and editing many raw file formats. In April, Apple introduced a new version of its operating system, Mac OS X v10.4, which added raw support directly to the operating system, as part of the ImageIO framework, which adds raw support automatically to the majority of Mac OS X applications both from Apple (such as Preview, Mac OS X's PDF and image viewing application and Aperture, a photo post-production software package for professionals) as well as all third party applications which make use of the ImageIO frameworks. Semi-regular updates to OS X generally include updated support for new raw file formats introduced in the intervening months by camera makers.

There are many other "raw workflow applications" designed to provide efficient processing and post-processing of raw images, including Helicon Filter, Phase One's Capture One and Bibble Labs' Bibble Pro. Like Apple Aperture, Adobe Photoshop and Lightroom, LaserSoft Imaging's SilverFast, and PhotoLine, these programs provide sophisticated controls for processing the information stored in the raw file and converting raw files to JPEG or TIFF. Picasa, a free image editing and cataloguing program from Google, can read and display many raw formats, but like iPhoto, Picasa provides only limited tools for processing the data in a raw file.

A portable open source program, dcraw, supports most raw formats and can be made to run on operating systems not supported by most commercial software (such as Unix). Libraw is an API library based on dcraw, offering more convenient interface for reading and converting RAW files. HDR PhotoStudio is one of commercial applications that uses Libraw.

RawTherapee is a freeware RAW converter supporting the Windows and Linux operating systems.

UFRaw is free software based on dcraw. It can be used as a GIMP plugin and is available for most operating systems.

The latest version GIMP, a free open source photo editing package imports many RAW formats.

Raw Photo Processor (RPP) is a raw converter for Mac OS X (10.4 or 10.5 only), supporting almost all available digital raw formats. RPP is not a full featured photo processing package, rather it supports some carefully chosen photographic operations.

ExifTool supports the reading, writing and editing of metadata in raw image files. ExifTool supports many different types of metadata including EXIF, GPS, IPTC, XMP, JFIF, GeoTIFF, ICC Profile, Photoshop IRB, FlashPix, AFCP and ID3, as well as the maker notes of many digital cameras.

Light Crafts' LightZone photo editing software provides the ability to edit many raw formats natively. Most tools are raw converters, but LightZone allows a user to edit a raw file as if it were TIFF or JPEG.

Standardization

In 2004, Adobe Systems developed and promoted a standardized raw image format called DNG (Digital Negative); this has been received enthusiastically by open-source developers[2] but has received little support from major camera makers other than Pentax and Samsung; their Pentax K20D/Samsung GX-20 and Pentax K200D digital single-lens reflex cameras can shoot directly into DNG format, as could the now-discontinued Pentax K10D/Samsung GX-10.

Two other would-be standards for digital negatives in the digital cinema industry are the OpenEXR and the SMPTE DPX formats. The much newer OpenEXR format has good metadata support and offers more effective compression (both lossless as well as lossy) than the DNG format. Using OpenEXR to store RAW camera data has been discussed on the OpenEXR mailing list[21].

Microsoft has submitted its HD Photo specification for ratification as JPEG XR for use as a raw format.[clarification needed]

Processing

To be viewed or printed, the output from a camera's image sensor has to be processed, that is, converted to a photographic rendering of the scene, and then stored in a standard raster graphics format such as JPEG. This processing, whether done in-camera or later in a raw file converter, involves a number of operations, typically including:[22][23]

Note that demosaicing is only performed for CFA sensors; it is not required for 3CCD or Foveon X3 sensors.

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

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 before creating the file[24]). 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.[25]

Some raw formats also allow nonlinear quantization.[26][27] This nonlinearity allows the compression of the raw data without visible degradation of the image by removing invisible and irrelevant information from the image. Although noise is discarded this has nothing to do with (visible) noise reduction.[citation needed]

See also

References

  1. ^ Decoding raw digital photos in Linux
  2. ^ a b "Raw storm in a teacup?". Dpreview.com. 2005-04-27. Retrieved 2007-12-09. Dave Coffin, creator of the dcraw program, discusses some of his successful reverse-engineering in this interview, and mentions his enthusiasm for the DNG format.
  3. ^ "Exif Tool, Supported File Types".
  4. ^ The Online Photographer: Panasonic LX3 Barrel Distortion Controversy
  5. ^ Panasonic LX3 Lens Distortion
  6. ^ [1]
  7. ^ "Digital Negative (DNG) Specification" (PDF). 1.2.0.0. Adobe Systems. 2008-04: p. x. {{cite journal}}: |pages= has extra text (help); Check date values in: |date= (help); Cite journal requires |journal= (help)
  8. ^ "Sony 4 colour (RGB-E) filter on DSC-F828 sensor".
  9. ^ "Sony Japan announces new RGB+E image sensors". imaging-resource.com. July 16, 2003.
  10. ^ "Sony announce new RGBE CCD". dpreview.com. 15 July 2003.
  11. ^ "Understanding Camera RAW".
  12. ^ "Rawzor - Lossless compression software for camera raw images".
  13. ^ "Digital Negative (DNG) Specification" (PDF): p. 61. {{cite journal}}: |pages= has extra text (help); Cite journal requires |journal= (help)
  14. ^ "Is the Nikon D70 NEF (RAW) format truly lossless?".
  15. ^ Larry Strunk (2006-03-19). "The RAW Problem". OpenRAW.
  16. ^ Microsoft Digital Image Home page
  17. ^ Microsoft RAW Image Thumbnailer and Viewer for Windows XP
  18. ^ FastPictureViewer's Image Formats Compatibility Chart
  19. ^ Understanding RAW Image Support in Windows Vista: Windows Vista team blog
  20. ^ DNG Thumbnail and Preview Support for Windows Photo Gallery and Windows Live Photo Gallery
  21. ^ "Discussion about OpenEXR as a container for camera RAW data on the OpenEXR developers mailing list".
  22. ^ R. Ramanath , W.E. Snyder, Y. Yoo, M.S. Drew. "Color Image Processing Pipeline in Digital Still Cameras" (PDF). {{cite journal}}: Cite journal requires |journal= (help)CS1 maint: multiple names: authors list (link)
  23. ^ Keigo Hirakawa. "Color Imaging Pipeline for Digital Still & Video Cameras Part 1: Pipeline and Color Processing" (PDF).
  24. ^ "Digital Negative (DNG) Specification" (PDF): p. 14. {{cite journal}}: |pages= has extra text (help); Cite journal requires |journal= (help)
  25. ^ "Comparative test: Canon 10D / Nikon D70 in the field of deep-sky astronomy".
  26. ^ "Digital Negative (DNG) Specification" (PDF): p. 61. {{cite journal}}: |pages= has extra text (help); Cite journal requires |journal= (help)
  27. ^ "Is the Nikon D70 NEF (RAW) format truly lossless?".