OpenersPrimaryExamplesSection(Spacer1)Examples  (31)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Import a Raw file:

Import["http://exampledata.wolfram.com/sample.orf"]

Summary of an image:

Import["http://exampledata.wolfram.com/sample.orf","Summary"]

OpenersExampleSection1(Spacer1)Scope  (2)

Show all (RefLink[Import, paclet:ref/Import]) elements available in the file:

Import["http://exampledata.wolfram.com/sample.orf","Elements"]

Import an image at a specified size:

Import["http://exampledata.wolfram.com/sample.orf",ImageSize->100]

OpenersExampleSection2(Spacer1)Import Elements  (23)

OpenersExampleSubsection0(Spacer1)Available Elements  (3)

List of all available elements:

Import["http://exampledata.wolfram.com/sample.orf","Elements"]

Import all elements as a list of rules:

Import["http://exampledata.wolfram.com/sample.orf","Rules"]//Short

Import some image options:

Import["http://exampledata.wolfram.com/sample.orf","Options"]

The "Options" element does not return all of the options that are present in the imported image:

Import["http://exampledata.wolfram.com/sample.orf"]//Options//Short

OpenersExampleSubsection1(Spacer1)Data Representation  (7)

OpenersExampleSubsubsection0(Spacer1)"Data"  (1)

Import the image data:

data=Import["http://exampledata.wolfram.com/sample.orf","Data"];

Inspect the first few elements:

data[[1,;;10]]

Create an image from data:

Image[data,"Bit16"]

OpenersExampleSubsubsection1(Spacer1)"EmbeddedThumbnail"  (1)

Import an embedded thumbnail of an image:

Import["http://exampledata.wolfram.com/sample.orf","EmbeddedThumbnail"]

OpenersExampleSubsubsection2(Spacer1)"Graphics"  (1)

Import as a (RefLink[Graphics, paclet:ref/Graphics]) object:

Import["http://exampledata.wolfram.com/sample.ARW","Graphics"]

Head[%]

OpenersExampleSubsubsection3(Spacer1)"Image"  (1)

Import as an (RefLink[Image, paclet:ref/Image]) object:

Import["http://exampledata.wolfram.com/sample.ARW","Image"]

Head[%]

This is the default import element for Raw:

Import["http://exampledata.wolfram.com/sample.ARW"]

OpenersExampleSubsubsection4(Spacer1)"RawData"  (1)

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

Import["http://exampledata.wolfram.com/sample.orf","RawData"][[100,;;100]]

OpenersExampleSubsubsection5(Spacer1)"RawImage"  (1)

Import the raw image:

Import["http://exampledata.wolfram.com/sample.orf","RawImage"]

OpenersExampleSubsubsection6(Spacer1)"Thumbnail"  (1)

Import a thumbnail of an image:

Import["http://exampledata.wolfram.com/sample.orf","Thumbnail"]

OpenersExampleSubsection2(Spacer1)Metadata  (13)

OpenersExampleSubsubsection7(Spacer1)"BitDepth"  (1)

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

Import["http://exampledata.wolfram.com/sample.orf","BitDepth"]

OpenersExampleSubsubsection8(Spacer1)"CameraTopOrientation"  (1)

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

Import["http://exampledata.wolfram.com/sample.orf","CameraTopOrientation"]

OpenersExampleSubsubsection9(Spacer1)"Channels"  (1)

Get the number of image channels:

Import["http://exampledata.wolfram.com/sample.orf","Channels"]

OpenersExampleSubsubsection10(Spacer1)"ColorSpace"  (1)

Get the color encoding used on export:

Import["http://exampledata.wolfram.com/sample.orf","ColorSpace"]

Use (RefLink[ImageColorSpace, paclet:ref/ImageColorSpace]) to get the color space of an imported image:

Import["http://exampledata.wolfram.com/sample.orf"]//ImageColorSpace

OpenersExampleSubsubsection11(Spacer1)"DateTime"  (1)

Get the date and time the image was captured:

Import["http://exampledata.wolfram.com/sample.orf","DateTime"]

OpenersExampleSubsubsection12(Spacer1)"Exif"  (3)

Get Exif metadata:

Import["http://exampledata.wolfram.com/sample.orf","Exif"]

Extract an individual tag from the association:

Import["http://exampledata.wolfram.com/sample.orf","Exif"]["FNumber"]

Individual Exif tags can also be imported directly:

Import["http://exampledata.wolfram.com/sample.orf","FNumber"]

Some Exif tags are processed to give more detailed information:

Import["http://exampledata.wolfram.com/sample.orf", "FlashInfo"]

Compare with the raw "FlashInfo" tag:

Import["http://exampledata.wolfram.com/sample.orf","RawExif"]["FlashInfo"]

OpenersExampleSubsubsection13(Spacer1)"FilterPattern"  (1)

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

Import["http://exampledata.wolfram.com/sample.orf","FilterPattern"]

OpenersExampleSubsubsection14(Spacer1)"FlashUsed"  (1)

Import a tag that shows whether the flash fired:

Import["http://exampledata.wolfram.com/sample.orf","FlashUsed"]

OpenersExampleSubsubsection15(Spacer1)"ImageSize"  (1)

Get the dimensions of the image stored in the file:

Import["http://exampledata.wolfram.com/sample.orf","ImageSize"]

Use (RefLink[ImageDimensions, paclet:ref/ImageDimensions]) on an imported image gives the same result:

Import["http://exampledata.wolfram.com/sample.orf"]//ImageDimensions

OpenersExampleSubsubsection16(Spacer1)"RawExif"  (1)

Import raw Exif data:

Import["http://exampledata.wolfram.com/sample.orf","RawExif"]

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

Import["http://exampledata.wolfram.com/sample.orf","RawExif"]["FocalLength"]

When importing "Exif", most tags are processed:

Import["http://exampledata.wolfram.com/sample.orf","Exif"]["FocalLength"]

OpenersExampleSubsubsection17(Spacer1)"Summary"  (1)

Get the image summary:

Import["http://exampledata.wolfram.com/sample.orf","Summary"]

OpenersExampleSection3(Spacer1)Import Options  (4)

OpenersExampleSubsection3(Spacer1)ImageResolution  (1)

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

Options[Import["http://exampledata.wolfram.com/sample.orf"], ImageResolution]

Specify the resolution of the imported image:

Options[Import["http://exampledata.wolfram.com/sample.orf",ImageResolution->72], ImageResolution]

Specify different resolutions in the x and y directions:

Options[Import["http://exampledata.wolfram.com/sample.orf",ImageResolution->{72,144}], ImageResolution]

OpenersExampleSubsection4(Spacer1)ImageSize  (1)

By default, the original-size image is imported:

file=URLSave["http://exampledata.wolfram.com/sample.orf", "sample.orf"]

Import[file,"ImageSize"]

Import[file]//ImageDimensions

Specify a custom image size:

Import[file,ImageSize->320]

OpenersExampleSubsection5(Spacer1)"ImageTopOrientation"  (1)

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

Import["http://exampledata.wolfram.com/sample.orf"]

Specify the orientation of the image:

Import["http://exampledata.wolfram.com/sample.orf", "ImageTopOrientation"-> Left]

OpenersExampleSubsection6(Spacer1)IncludeMetaInformation  (1)

By default, all available metadata is imported:

file=URLSave["http://exampledata.wolfram.com/sample.orf", "sample.orf"];

Import[file]//Options

Import the image with no metadata:

Import[file,IncludeMetaInformation->None]//Options

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {Related Formats:  (RefLink[JPEG, paclet:ref/format/JPEG])  ▪  (RefLink[TIFF, paclet:ref/format/TIFF])  ▪  (RefLink[PNG, paclet:ref/format/PNG])  ▪  (RefLink[WebP, paclet:ref/format/WebP])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Image Processing, paclet:guide/ImageProcessing])}, {▪(RefLinkPlain[Raster Image Formats, paclet:guide/RasterImageFormats])}, {▪(RefLinkPlain[Importing & Exporting, paclet:guide/ImportingAndExporting])}, {▪(RefLinkPlain[Graphics Importing & Exporting, paclet:guide/GraphicsImportingAndExporting])}, {▪(RefLinkPlain[Listing of All Formats, paclet:guide/ListingOfAllFormats])}})}})