Raw image format explained

Raw image file
Extension:.3fr,
.ari, .arw,
.bay,
.braw, .crw, .cr2, .cr3,
.cap,
.data, .dcs, .dcr, .dng,
.drf,
.eip, .erf,
.fff,
.gpr,
.iiq,
.k25, .kdc,
.mdc, .mef, .mos, .mrw,
.nef, .nrw,
.obm, .orf,
.pef, .ptx, .pxn,
.r3d, .raf, .raw, .rwl, .rw2, .rwz,
.sr2, .srf, .srw,
.tif,
.x3f
Genre:Image file formats

A camera raw image file contains unprocessed or minimally processed data from the image sensor of either a digital camera, a motion picture film scanner, or other image scanner.[1] [2] 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 file format such as JPEG or PNG 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 incorrectly described as "digital negatives". Rather, the raw datasets are more like exposed but undeveloped film which can be converted (electronically developed) in a non-destructive manner multiple times in observable, reversible steps to reach a visually desired image. (With exposed film, development is a single event that physically transforms the unexposed film irreversibly.)

Like undeveloped photographic film, a raw digital image may have a wider dynamic range or color gamut than the developed film or 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.[3] 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 the information required to produce a viewable image from the camera's sensor data. The structure of raw files often follows a common pattern:

Many raw file formats, including IIQ (Phase One), 3FR (Hasselblad), DCR, K25, KDC (Kodak), CRW, CR2, CR3 (Canon), ERF (Epson), MEF (Mamiya), MOS (Leaf), NEF NRW (Nikon), ORF (Olympus), PEF (Pentax), RW2 (Panasonic) and ARW, SRF, SR2 (Sony), are based on TIFF, the Tag Image File Format.[4] 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 tag 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/or standards, including Exif metadata, XMP metadata, IPTC metadata, CIE XYZ coordinates, ICC profiles, and JPEG.[5]

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 (typically 12- or 14-bit) 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 (CFA), usually a Bayer filter, consisting of a mosaic of a 2x2 matrix of red, green, blue and (second) 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"[6] (a blue-green[7] or cyan[8] color). Other sensors, such as the Foveon X3 sensor, capture information directly in RGB form (using three pixel sensors in each location). 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 (where "I" stands for the additional infrared channel for automatic dust removal) 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,[9] [10] [11] with necessary correction information presumably included in the raw.[12] 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.[13] [14] 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.[15]

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".[16] [17] [18] "Planning for [US] Library of Congress Collections" identifies generic raw-file formats as "less desirable file formats", and identifies DNG as a suggested alternative.[19]

Example raw image formats
Name Date Specification available? Description
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 NEF, complete with a tag which identifies the version of TIFF/EP they are based on.[20]
Digital Negative (DNG) 2004 Extension of TIFF/EP, adding information on camera characteristics.[21] Is royalty-free.[22] 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."[23]
Canon Raw v2 (CR2) 2005 Based on TIFF[24] and lossless Jpeg ITU-T81.[25]
Canon Raw v3 (CR3) 2018 Uses the ISO base media file format container with custom tags and a custom "crx" codec.[26]
Sony RAW (SRF, SR2, ARW and ARQ) 2004 Based on TIFF container, uses proprietary Makernote fields. May be uncompressed, proprietary lossy-compressed, or Jpeg lossless compressed depending on version.[27]

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.[28] 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.[28] [29] In addition, most Canon point & shoot cameras can support DNG by using CHDK, and Better Light can export to DNG.[29] Open-source developers also use DNG.[15]

Processing

See also: Color image pipeline.

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:[30] [31]

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 be removed before creating the file[36]). Some camera manufacturers do additional processing before saving raw files; for example, Nikon has been criticized by astrophotographers for applying noise reduction before saving the raw file.[37]

Some raw formats also allow nonlinear quantization. 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.

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 produce 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:

Drawbacks

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.

Operating system support

Apple macOS and iOS

In January 2005, Apple released iPhoto 5, which offered basic support for viewing and editing many raw file formats.

In April 2005, Apple's OS X 10.4 brought raw support to the operating system's ImageIO framework, enabling raw support automatically in the majority of macOS applications both from Apple (such as Preview, macOS'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 macOS generally include updated support for new raw formats introduced in the intervening months by camera manufacturers.

In 2016, Apple announced that iOS 10 would allow capturing raw images on selected hardware, and third party applications will be able to edit raw images through the operating system's Core Image framework.[44]

In 2020, Apple released the iPhone 12 Pro and iPhone 12 Pro Max. Both of these devices support Apple ProRAW (as of iOS 16.0.3) output and viewing. The later Pro and Pro Max models also provide ProRAW output.[45] Two raw options are in fact available for capture: a traditional "Bayer RAW" and Apple's "ProRAW" both in 12-bit DNG.[46] The ProRAW option is demosaiced and partially processed. It can be used with HDR, Deep Fusion, or Night mode, which is not possible with Bayer RAW. The data inside remain scene-referred like "true" RAW images.[47]

Microsoft Windows

Windows Camera Codec Pack

Microsoft supplies the free Windows Camera Codec Pack for Windows XP and later versions of Microsoft Windows, to integrate raw file viewing and printing into some Microsoft Windows tools.[48] The codecs allow native viewing of raw files from a variety of specific cameras in Windows Explorer / File Explorer and Windows Live Photo Gallery / Windows Photo Gallery, in Windows Vista and Windows 7.[49] As of October 2016, Microsoft had not released an updated version since April 2014, which supported some specific cameras by the following manufacturers: Canon, Casio, Epson, Fujifilm, Kodak, Konica Minolta, Leica, Nikon, Olympus, Panasonic, Pentax, Samsung, and Sony. For windows 10 this was essentially replaced in 2019 by Microsoft Raw Image Extension.

Raw Image Extension

Microsoft as of 2019 supplies the free Raw Image Extension for Windows 10 and later versions of Microsoft Windows, to integrate raw file viewing and printing into some Microsoft Windows tools.[50] The Extension allows native viewing of raw files from many mid- to high-end digital cameras in Windows Explorer / File Explorer and Microsoft Photos.

Windows Imaging Component (WIC)

See main article: Windows Imaging Component. Microsoft Windows supports the Windows Imaging Component (WIC) codec standard. WIC was available as a stand-alone downloadable program for Windows XP Service Pack 2, and built into Windows XP Service Pack 3, Windows Vista, and later versions. Windows Explorer / File Explorer, and Windows Live Photo Gallery / Windows Photo Gallery can view raw formats for which the necessary WIC codecs are installed. Canon, Nikon, Sony, Olympus and Pentax have released WIC codecs for their cameras, although some manufactures only provide codec support for the 32-bit versions of Microsoft Windows.[51]

Commercial DNG WIC codecs are also available from Ardfry Imaging,[52] and others; and FastPictureViewer Professional installs a set of WIC-enabled image decoders.[53] [54]

Android

Android Lollipop 5.0, introduced in late 2014, can allow smartphones to take raw images, useful in low-light situations.[55]

Free and open source software

Proprietary software

In addition to those listed under operating system support, above, the commercial software described below support raw formats.

Dedicated raw converters

The following products were launched as raw processing software to process a wide range of raw files, and have this as their main purpose:

Others

Raw filename extensions and respective camera manufacturers or standard

Raw bitmap files

Less commonly, raw may also refer to a generic image file format containing only pixel color values. For example, "Photoshop Raw" files (.raw) contain a pure array of bytes top-to-bottom, left-to-right pixel order. Dimensions must be input manually when such files are re-opened, or a square image is assumed. Also the channel size and bit-depth per channel has to be provided when opening this format, as the ambiguities of whether the bytes are to be decoded as single channels at high precision, or multiple channels at lower precision, is not determinable from the byte array itself. Due to its simplicity, this format is very open and compatible, though limited by its lack of metadata and run-length encoding. Especially in photography and graphic design, where color management and extended gamuts are important, and large images are common.

See also

External links

Notes and References

  1. Web site: Understanding RAW Files Explained. 2 March 2011. Luminous Landscape.
  2. Web site: Camera Raw Formats. Library of Congress. Digital Preservation. 2006-10-04. 2014-03-11.
  3. IEEE. 10.1109/ICIP.2006.312569. 978-1-4244-0480-3. 2006 International Conference on Image Processing. 1509–1512. Buzzi. Jerome. Guichard. Frederic. A Measure of Color Sensitivity for Imaging Devices. 2006 International Conference on Image Processing. Atlanta, GA. 2023-07-27. October 2006.
  4. Web site: Exif Tool, Supported File Types .
  5. Adobe: DNG Specification
  6. Web site: Realization of natural color reproduction in Digital Still Cameras, closer to the natural sight perception of the human eye.
  7. Web site: Sony Japan announces new RGB+E image sensors . imaging-resource.com . July 16, 2003 .
  8. Web site: Sony announce new RGBE CCD . dpreview.com . 15 July 2003 .
  9. Web site: Panasonic LX3 Barrel Distortion Controversy. The Online Photographer.
  10. Web site: Panasonic DMC-LX3 Review – Optics. Imaging Resource.
  11. Web site: Panasonic LX3 Lens Distortion . Seriouscompacts.com . 2011-12-11 . dead . https://web.archive.org/web/20081024142050/http://www.seriouscompacts.com/2008/10/panasonic-lx3-lens-distortion.html . 2008-10-24 .
  12. http://www.imaging-resource.com/PRODS/panasonic-lx7/panasonic-lx7A4.HTM Panasonic Lumix LX7 Review
  13. Web site: Review: Capture One 6 Pro. IT Enquirer. 5 October 2011.
  14. Web site: Phase One Capture One 6 Pro Review. ePhotoZine. 5 October 2011.
  15. Web site: Raw storm in a teacup? . Dpreview.com . 2007-12-09 . 2005-04-27 . 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.
  16. Web site: The RAW Flaw (at The Luminous Landscape) . Michael . Reichmann . Michael Reichmann . Juergen . Specht . May 2005 . 2009-09-23 . 2010-01-08 . https://web.archive.org/web/20100108012720/http://www.luminous-landscape.com/essays/raw-flaw.shtml . dead .
  17. Web site: The RAW Flaw (at The Luminous Landscape) . Michael . Reichmann . Michael Reichmann . Juergen . Specht . May 2005 . DOC . dead . https://web.archive.org/web/20120920220220/http://www.luminous-landscape.com/TheRawFlaw.doc . 2012-09-20 .
  18. Web site: The RAW Flaw (at The Luminous Landscape) . Michael . Reichmann . Michael Reichmann . Juergen . Specht . May 2005 . dead . https://web.archive.org/web/20110106132544/http://www.luminous-landscape.com/TheRawFlaw.pdf . 2011-01-06 .
  19. Planning for US Library of Congress Collections: Preferences in Summary
  20. Barry Pearson: What is in a raw file?
  21. Adobe: DNG 1.3.0.0 Specification (June 2009) (scroll down a bit)
  22. Adobe Labs: CinemaDNG (final bullet point)
  23. NPES: Minutes of ISO/TC 130/WG2, 39th Meeting, see 14f
  24. https://github.com/lclevy/libcraw2/blob/master/docs/cr2_poster.pdf TIFF structure of Canon CR2
  25. https://github.com/lclevy/libcraw2/blob/master/docs/cr2_lossless.pdf Lossless ITU-T81 jpeg compression of Canon CR2
  26. https://github.com/lclevy/canon_cr3 Describing the Canon Raw v3 (CR3) file format
  27. Web site: Description of Sony RAW file formats (SRF, SR2, ARW and ARQ) . . 4 June 2022 .
  28. Barry Pearson: Products from Camera Manufacturers that use DNG in some way
  29. Barry Pearson: DNG support, to end-September 2006
  30. Color Image Processing Pipeline in Digital Still Cameras . R. Ramanath . W.E. Snyder . Y. Yoo . M.S. Drew . 2009-01-04 . 2011-01-13 . https://web.archive.org/web/20110113005334/http://mysite.verizon.net/rajeevramanath/Research/pipeline-SPM-05.pdf . dead .
  31. Web site: Color Imaging Pipeline for Digital Still & Video Cameras Part 1: Pipeline and Color Processing . Keigo Hirakawa . 2009-01-04 . 2011-10-07 . https://web.archive.org/web/20111007204115/http://www.accidentalmark.com/research/tutorial/ICIP2008/Hirakawa08ICIPTutorial_Handout.pdf . dead .
  32. Web site: Inside the Canon RAW format version 2, understanding .CR2 file format and files produced by Canon EOS Digital Camera. lclevy.free.fr.
  33. Ron Day. Understanding & Using the RAW File Format
  34. Book: Salvaggio, Nanette . Basic Photographic Materials and Processes . 3rd . Focal Press . 2008 . 978-0-240-80984-7 . 206 .
  35. Book: Kasdorf, William E. . The Columbia guide to digital publishing . Columbia University Press . 2003 . 978-0-231-12499-7 . 270 .
  36. Digital Negative (DNG) Specification . 14.
  37. Web site: Comparative test: Canon 10D / Nikon D70 in the field of deep-sky astronomy . dead . https://web.archive.org/web/20040708033757/http://astrosurf.com/buil/d70v10d/eval . 2004-07-08.
  38. Web site: Understanding Camera Raw. 7 December 2011 .
  39. Digital Negative (DNG) Specification . 61.
  40. Web site: Is the Nikon D70 NEF (RAW) format truly lossless? .
  41. Web site: RawDigger: detecting posterization in SONY cRAW/ARW2 files – RawDigger. www.rawdigger.com. 6 March 2014.
  42. Web site: RED Epic Dragon review: First camera to break the 100-point DxOMark sensor score barrier . Kevin Carter . March 3, 2014 . March 15, 2014 . March 15, 2014 . https://web.archive.org/web/20140315102940/http://www.dxomark.com/Reviews/RED-Epic-Dragon-review-First-camera-to-break-the-100-point-DxOMark-sensor-score-barrier/Specification . dead .
  43. Web site: The RAW Problem. OpenRAW. Larry Strunk. 2006-03-19. dead. https://web.archive.org/web/20071210090847/http://www.openraw.org/info. 2007-12-10.
  44. Web site: Advances in iOS Photography . Apple . 14 June 2016 . 16 June 2016.
  45. Web site: About Apple ProRAW . Apple Support . en.
  46. Web site: Capturing Photos in RAW and Apple ProRAW Formats . Apple Developer Documentation.
  47. Web site: isAppleProRAWEnabled . Apple Developer Documentation . Compared to photos taken in Bayer RAW format, the system demosaics and partially processes Apple ProRAW photos. They’re still scene-referred, however, and allow capturing RAW photos in modes that don’t have a traditional Bayer RAW format available, such as modes that rely on fusing multiple captures..
  48. Web site: Microsoft RAW Image Thumbnailer and Viewer for Windows XP. .
  49. Web site: Windows Camera Codec Pack . 2014-04-22. Microsoft. 2015-02-18.
  50. url=https://www.microsoft.com/en-us/p/raw-image-extension/9nctdw2w1bh8#activetab=pivot:overviewtab
  51. http://windowsvistablog.com/blogs/windowsvista/archive/2007/02/15/understanding-raw-image-support-in-windows-vista.aspx Understanding RAW Image Support in Windows Vista: Windows Vista team blog
  52. Web site: File extension dng support – DNG CODEC for Windows 8 and Windows 7 – Windows Imaging Component CODEC for Adobe Digital Negative files. www.ardfry.com.
  53. Web site: FastPictureViewer Professional – Image File Formats Compatibility Chart. Axel. Rietschin. www.fastpictureviewer.com.
  54. Web site: FastPictureViewer Imaging Products. Axel. Rietschin. FastPictureViewer Imaging Products by Axel Rietschin Software Developments.
  55. Web site: Android 5.0 Camera Tests Show Update Instantly Improves Every Smartphone . Paul Monckton . . December 27, 2014.
  56. Web site: Libraw.
  57. Web site: AZImage.
  58. Web site: ImageMagick Image Formats.
  59. Web site: About – LightZone. lightzombie.org.
  60. Web site: Adobe Camera Raw . Adobe . 19 July 2021 . en-US.
  61. Web site: Capture One. dead . https://web.archive.org/web/20111114201744/http://www.phaseone.com/en/Software/Capture-One-Pro-6/Additional/PRO-FAQ.aspx . 2011-11-14.
  62. Web site: Raw Power by Gentlemen Coders.
  63. Web site: ACDSystems Supported RAW Formats.
  64. ideaMK: DNG Viewer
  65. Web site: List of Supported Cameras (RAW formats) – FastRawViewer. www.fastrawviewer.com. 17 March 2016.
  66. Web site: Silver Black and White Photo Converter.
  67. Web site: Wild Media Server (UPnP, DLNA, HTTP). www.wildmediaserver.com. 2017-09-01.
  68. Web site: Supported Formats and Codecs. transloadit.com.