Raw (.raw, .arw, .crw, .nef, .nrw, .dng, ...)

Background & Context

    • MIME types: image/x-raw-canon, image/x-raw-nikon, image/x-raw-sony, ...
    • Typically store not-processed sensor data.
    • Typically store uncompressed or lossless compressed data.

Import

  • Import["file.raw"] imports a raw file and returns a viewable image.
  • Import["file.raw",elem] imports the specified element from a raw file.
  • The import format can be specified with Import["file","Raw"] or Import["file",{"Raw",elem,}].
  • See the following reference pages for full general information:
  • Importimport from a file
    CloudImportimport from a cloud object
    ImportStringimport from a string
    ImportByteArrayimport from a byte array

Notebook Interface

  • In the notebook front end, Insert Picture and the Open menu allow the import of a raw file into a cell.

Import Elements

  • General Import elements:
  • "Elements" list of elements and options available in this file
    "Summary"summary of the file
    "Rules"list of rules for all available elements
  • Data representation elements:
  • "Data"array of color values
    "Graphics"Graphics object representing an image
    "Image"raster image, given as an Image object
    "RawData"array of intensity values captured by the sensor
    "RawImage"image representing raw captured sensor data
    "EmbeddedThumbnail"thumbnail stored in the file, if available
    {"Thumbnail",size}thumbnail of a given size (default size = Small)
  • Import by default uses the "Image" element for raw image formats.
  • Advanced Import elements:
  • "BitDepth"bits used to represent raw pixels in the file
    "CameraTopOrientation"orientation of the camera when the picture was taken
    "Channels"the number of color channels used in the file
    "ColorProfileData"embedded color profile, given as a ColorProfileData object
    "ColorSpace"color encoding used in the file
    "FlashUsed"
  • whether the flash was fired
  • "FilterPattern"color filter array (cfa) used for demosaicing
    "GeoPosition"latitude and longitude represented as a GeoPosition object
    "GPSDateTime"
  • image creation date and time registered by GPS
  • "RasterSize"raster dimensions
    "RedEyeCorrection"whether a red-eye correction was performed
    "Summary"
  • summary of the file
  • Metadata elements:
  • "Exif"formatted Exif (Exchange image file format)
    "MetaInformation"combination of all formatted metadata present in the file
  • Raw Exif, as stored in the file, can be imported using "RawExif" elements, returned as an association.
  • All Exif tags can be imported individually. Common tags include:
  • "ApertureValue"lens aperture
    "Artist"photographer or image creator
    "DateTime"image creation date and time
    "ExposureTime"exposure time, given in seconds
    "FlashInfo"
  • flash information: flash fired, red-eye correction, etc.
  • "FNumber"F number
    "FocalLength"actual focal length of the lens, given in millimeters
    "GPSAltitude"altitude of the GPS position
    "GPSLatitude"latitude of the GPS position
    "GPSLongitude"longitude of the GPS position
    "Make"manufacturer of the recording equipment
    "Model"model name or model number of the equipment
    "Software"name and version of the software or firmware of the camera or image input device used to generate the image

Options

Examples

open allclose all

Basic Examples  (2)

Import a Raw file:

Summary of an image:

Scope  (2)

Show all Import elements available in the file:

Import an image at a specified size:

Import Elements  (22)

Available Elements  (2)

List of all available elements:

Import all elements as a list of rules:

Data Representation  (7)

"Data"  (1)

Import the image data:

Inspect the first few elements:

Create an image from data:

"EmbeddedThumbnail"  (1)

Import an embedded thumbnail of an image:

"Graphics"  (1)

Import as a Graphics object:

"Image"  (1)

Import as an Image object:

This is the default import element for Raw:

"RawData"  (1)

Raw image sensor data can be imported using "RawData":

"RawImage"  (1)

Import the raw image:

"Thumbnail"  (1)

Import a thumbnail of an image:

Metadata  (13)

"BitDepth"  (1)

Get the number of bits used for representing each color channel:

"CameraTopOrientation"  (1)

Get the orientation of the camera when the picture was taken:

"Channels"  (1)

Get the number of image channels:

"ColorSpace"  (1)

Get the color encoding used on export:

Use ImageColorSpace to get the color space of an imported image:

"DateTime"  (1)

Get the date and time the image was captured:

"Exif"  (3)

Get Exif metadata:

Extract an individual tag from the association:

Individual Exif tags can also be imported directly:

Some Exif tags are processed to give more detailed information:

Compare with the raw "FlashInfo" tag:

"FilterPattern"  (1)

Get the color filter array (cfa) used for demosaicing:

"FlashUsed"  (1)

Import a tag that shows whether the flash fired:

"RasterSize"  (1)

Get the dimensions of the image stored in the file:

Use ImageDimensions on an imported image gives the same result:

"RawExif"  (1)

Import raw Exif data:

Raw Exif tags return the actual values stored in the file:

When importing "Exif", most tags are processed:

"Summary"  (1)

Get the image summary:

Import Options  (4)

ImageResolution  (1)

By default, the image resolution is extracted from the file:

Specify the resolution of the imported image:

Specify different resolutions in the and directions:

"ImageTopOrientation"  (1)

By default, the image is imported at the orientation registered at the capture time:

Specify the orientation of the image:

IncludeMetaInformation  (1)

By default, all available metadata is imported:

Import the image with no metadata:

RasterSize  (1)

By default, the original-size image is imported:

Specify a custom raster size: