TIFF (.tiff, .tif)

Background & Context

-
- Registered MIME type: image/tiff
- TIFF raster image format.
- Commonly used in image manipulation applications, page layout applications, scanners and other imaging devices, and for the archiving of images.
- Suitable for high-color-depth images.
- TIFF is an acronym for Tagged Image File Format.
- Binary format.
- Supports multiple color resolutions, color encodings, color palettes, and compression methods.
- Supports floating-point images with 32 and 64 bits per channel.
- Can store multiple images.
- Supports alpha channels.
- Introduced in 1986 by Aldus.
Import & Export

- Import["file.tiff"] imports a TIFF file, returning a single Image object or a list of images.
- Import["file.tiff",elem] imports the specified element from a TIFF file.
- The import format can be specified with Import["file","TIFF"] or Import["file",{"TIFF",elem,…}].
- Export["file.tiff",expr] exports an image, graphics, or any other expression as an image to a TIFF file.
- Export["file.tiff",{expr1,expr2,…}] exports a list of expressions as a multi-image TIFF file.
- Export["file.tiff",Manipulate[…]] exports a list of frames from an animated demonstration of a Manipulate object.
- Image objects are by default exported at their full raster size. Graphics and other arbitrary expressions are exported using the same raster size as their displayed form.
- See the following reference pages for full general information:
-
Import, Export import from or export to a file CloudImport, CloudExport import from or export to a cloud object ImportString, ExportString import from or export to a string ImportByteArray, ExportByteArray import from or export to a byte array
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:
-
"ColorMap" color reduction palette "Data" array of pixel values "Graphics" the first image in the file, given as graphics "Image" first image in the file, represented as an Image object "RawData" array of color map indices {"Thumbnail",size} thumbnail of the first image (default size = Small) - Data representation elements for multi-image TIFF files:
-
"Animation" multi-image TIFF represented as an animation object "Image3D" images in the file, represented as an Image3D object {"GraphicsList",frames} images as a list of graphics (default frames=All) {"ImageList",frames} a list of images (default frames=All) {"ThumbnailList",frames,size} a list of thumbnails (default frames=All, size=Small) - Import by default uses "Image" for single-frame TIFF files and "ImageList" for multi-frame TIFF files.
- Import of a multi-image TIFF with element "Graphics" or "Image" gives the first image.
- Export by default generates a multi-image TIFF if the expression supplied is a list of Graphics or Image objects.
- Export with element "Graphics" or "Image" always generates a single-image TIFF.
- Advanced Import elements:
-
"BitDepth" bits used to represent each color channel 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
"GeoPosition" - latitude and longitude represented as GeoPosition object
"GPSDateTime" - image creation date and time registered by GPS
"ImageCount" number of images in the file "ImageEncoding" how images are compressed in the file "ImageResolution" image resolution specified in the file "RasterSize" raster dimensions "Summary" - summary of the file
"SummarySlideView" slide view summary of all frames - Metadata elements:
-
"Exif" formatted Exif (Exchange image file format) "IPTC" formatted IPTC (International Press Telecommunications Council) "XMP" formatted XMP (Extensible metadata platform) "MetaInformation" combination of all formatted metadata present in the file - Raw metadata, as stored in the file, can be imported using "RawExif", "RawXMP", and "RawIPTC" elements, returned as an association.
- All Exif and IPTC tags can be imported individually. Common tags include:
-
"ApertureValue" lens aperture "DateTime" image creation date and time "ExposureTime" exposure time, given in seconds "FNumber" F number "FocalLength" actual focal length of the lens, given in millimeters "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 - For multi-image TIFF files, the above data representation and metadata elements are taken to be lists of the respective expressions.
Options



- Import and Export options:
-
ImageResolution Automatic resolution used for rendering the graphics IncludeMetaInformation All metadata types to import and export "ImageTopOrientation" Automatic orientation of the image as stored in the file RasterSize Automatic dimensions of the image - Import option:
-
"TakeRows" {1,-1} rows to import - Export options:
-
ByteOrdering -1 ordering of bytes in the file "BitDepth" Automatic bit depth per channel used to store image data "ColorMapLength" Automatic number of colors to use for quantization "ColorSeparation" False whether to store color channels in separate planes ColorSpace Automatic color encoding to be used in the file CompressionLevel Automatic compression level, given as a number between 0 and 1 Dithering "FloydSteinberg" dithering algorithm used for generating the color-reduction table "DifferencingPredictor" False whether to use horizontal differencing when using LZW or ZIP compression "ImageEncoding" "ZIP" how images are compressed in the file "QuantizationMethod" Automatic a method to use for quantization - Export["file.tiff",expr] creates a TIFF image with the same image size as the displayed form of expr.
- Supported "ColorSpace" settings are: "Grayscale", "RGB", "CMYK", and "LAB".
- Supported "BitDepth" settings are: Automatic, 1, 8, 16, 32, and 64.
- By default, "Bit" images are exported to 1-bit, "Byte" images are exported to 8-bit, and other types are exported to 16-bit TIFF files.
- The following settings for "ImageEncoding" are supported:
-
None no compression "JPEG" lossy JPEG compression "LZW" lossless LZW compression "PackBits" PackBits run-length encoding method "ZIP" lossless ZIP image data compression - Detailed properties and settings for exporting a Manipulate:
-
"ControlAppearance" Automatic how Manipulate control elements are rendered in the exported file - The following settings can be given for "ControlAppearance":
-
Automatic captures user controls exactly as seen in the notebook interface, using the style elements of the local computer system "Generic" renders graphical controls in a generic style None excludes control elements when exporting an animation
Examples
open allclose allBasic Examples (5)Summary of the most common use cases
This imports a TIFF example file, rendering it as an Image:

https://wolfram.com/xid/0qn747ak6-ge4


https://wolfram.com/xid/0qn747ak6-pyg532


https://wolfram.com/xid/0qn747ak6-9sfral

Import a multi-frame TIFF file as an animation:

https://wolfram.com/xid/0qn747ak6-1gp0s7

Create a multi-frame TIFF file from a list of images:

https://wolfram.com/xid/0qn747ak6-cdd4s

Scope (8)Survey of the scope of standard use cases
Show all elements available in the file:

https://wolfram.com/xid/0qn747ak6-yikq5c


https://wolfram.com/xid/0qn747ak6-e619fh


https://wolfram.com/xid/0qn747ak6-txorq8


https://wolfram.com/xid/0qn747ak6-xpmhcz


https://wolfram.com/xid/0qn747ak6-ea0u9q


https://wolfram.com/xid/0qn747ak6-hcke4u

Export a real-valued RGB image:

https://wolfram.com/xid/0qn747ak6-jmwxdo


https://wolfram.com/xid/0qn747ak6-eoi8zv

Create a TIFF file from data representation elements:

https://wolfram.com/xid/0qn747ak6-bxykpl

Create a multi-frame TIFF file from a list of RGB images:

https://wolfram.com/xid/0qn747ak6-etmd6y

Create a multi-frame TIFF from a Manipulate:

https://wolfram.com/xid/0qn747ak6-cl6l7a


https://wolfram.com/xid/0qn747ak6-d9qrq9

Read the number of exported frames:

https://wolfram.com/xid/0qn747ak6-f8yi4g

Import Elements (36)
Available Elements (4)

https://wolfram.com/xid/0qn747ak6-1g2ndh

List of available Exif elements:

https://wolfram.com/xid/0qn747ak6-mi3omu

List of available IPTC elements:

https://wolfram.com/xid/0qn747ak6-g8cf3x

Get image-related information as list of rules:

https://wolfram.com/xid/0qn747ak6-myzd73

Data Representation (10)
"Animation" (1)
"Data" (1)
"Graphics" (1)
Import as a Graphics object:

https://wolfram.com/xid/0qn747ak6-oxk5kn


https://wolfram.com/xid/0qn747ak6-oxk2tw

"Image" (2)
"Image3D" (1)
Multi-frame TIFF files with commensurate properties can get imported as an Image3D:

https://wolfram.com/xid/0qn747ak6-qytb82

"ImageList" (2)
Get the data as a list of Image objects:

https://wolfram.com/xid/0qn747ak6-dhcq0v

This is the default import element for TIFF:

https://wolfram.com/xid/0qn747ak6-fuijbd


https://wolfram.com/xid/0qn747ak6-c1n8ix

"Thumbnail" (1)
Metadata (22)
"BitDepth" (1)
"CameraTopOrientation" (1)
"Channels" (1)
"ColorProfileData" (1)
Get the embedded color profile, given as a ColorProfileData object:

https://wolfram.com/xid/0qn747ak6-1xdwml

The color profile is stored in the ColorSpace option of the imported image:

https://wolfram.com/xid/0qn747ak6-mpv214

"ColorSpace" (1)
Get the color encoding used on export:

https://wolfram.com/xid/0qn747ak6-wb968h

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

https://wolfram.com/xid/0qn747ak6-ca8qqr

"DateTime" (1)
"Exif" (3)

https://wolfram.com/xid/0qn747ak6-f0526s

Extract an individual tag from the association:

https://wolfram.com/xid/0qn747ak6-omm9zg

Individual Exif tags can also be imported directly:

https://wolfram.com/xid/0qn747ak6-55ozsh

Some Exif tags are processed to give more detailed information:

https://wolfram.com/xid/0qn747ak6-srkr1f

Compare with the raw "Orientation" tag:

https://wolfram.com/xid/0qn747ak6-3h2d51

"GeoPosition" (1)
"GPSDateTime" (1)
"ImageCount" (1)
"ImageEncoding" (1)
"MetaInformation" (1)
"RasterSize" (1)
Get the dimensions of the image stored in the file:

https://wolfram.com/xid/0qn747ak6-ib2ng3

Using ImageDimensions on an imported image gives the same result:

https://wolfram.com/xid/0qn747ak6-ms87qe

"RedEyeCorrection" (1)
"RawExif" (1)
"RowsPerStrip" (1)
"SummarySlideView" (1)
Import Options (7)
ImageResolution (1)
By default, the image resolution is extracted from the file:

https://wolfram.com/xid/0qn747ak6-kux3uu

Specify the resolution of the imported image:

https://wolfram.com/xid/0qn747ak6-f98eh7

Specify different resolutions in and
directions:

https://wolfram.com/xid/0qn747ak6-rc4e7v

"ImageTopOrientation" (1)
By default, images are imported with the native orientation stored in the file:

https://wolfram.com/xid/0qn747ak6-qpx1rr

Specify the side that is supposed to be on the top:

https://wolfram.com/xid/0qn747ak6-f2hain

The correct orientation can also be achieved by rotating the image after import:

https://wolfram.com/xid/0qn747ak6-y94tbh

IncludeMetaInformation (3)
By default, all available metadata is imported:

https://wolfram.com/xid/0qn747ak6-fdv13j

All imported classes of metadata:

https://wolfram.com/xid/0qn747ak6-kz0w78

Import the image with no metadata:

https://wolfram.com/xid/0qn747ak6-inmgwp

Import the image with Exif metadata only:

https://wolfram.com/xid/0qn747ak6-fpx9h0

RasterSize (1)
By default, images are imported in their full resolution:

https://wolfram.com/xid/0qn747ak6-ty3hak

Specify the raster size of the imported JPEG image:

https://wolfram.com/xid/0qn747ak6-df7mw1


https://wolfram.com/xid/0qn747ak6-d5h5xu

Specify both width and height of the imported image:

https://wolfram.com/xid/0qn747ak6-obfbkq


https://wolfram.com/xid/0qn747ak6-ztsyua

Export Options (12)
"BitDepth" (2)
By default, the exported TIFF file has a bit depth of 16:

https://wolfram.com/xid/0qn747ak6-2jzvj3


https://wolfram.com/xid/0qn747ak6-19ehwm

Specify a different bit depth:

https://wolfram.com/xid/0qn747ak6-lcy12t


https://wolfram.com/xid/0qn747ak6-pv5rhj

Export real valued lists to TIFF:

https://wolfram.com/xid/0qn747ak6-48eaoj


https://wolfram.com/xid/0qn747ak6-fd9lqn

ColorSpace (1)
By default, the native color space of the image is used for export:

https://wolfram.com/xid/0qn747ak6-umqnom

https://wolfram.com/xid/0qn747ak6-cd7oot


https://wolfram.com/xid/0qn747ak6-dky0tw


https://wolfram.com/xid/0qn747ak6-zxgis3


https://wolfram.com/xid/0qn747ak6-6mo35w

CompressionLevel (1)
By default, with some image encodings, an automatic compression level is used:

https://wolfram.com/xid/0qn747ak6-0tbu4a

https://wolfram.com/xid/0qn747ak6-l4besk


https://wolfram.com/xid/0qn747ak6-1j0scd

Specify the compression level:

https://wolfram.com/xid/0qn747ak6-xaxuyg

Compare the file size for different compression levels:

https://wolfram.com/xid/0qn747ak6-ljy6n8

"ControlAppearance" (1)
Control the appearance of a multi-frame TIFF from a Manipulate:

https://wolfram.com/xid/0qn747ak6-0j1ijb

By default, the controls are also included:

https://wolfram.com/xid/0qn747ak6-khkz4l


https://wolfram.com/xid/0qn747ak6-8bfx2x

"ColorMapLength" (1)
Dithering (1)
"ImageEncoding" (1)
"ImageTopOrientation" (1)
By default, the upright image is exported using "ImageTopOrientation"->Top:

https://wolfram.com/xid/0qn747ak6-kje3az

https://wolfram.com/xid/0qn747ak6-9ogv7d


https://wolfram.com/xid/0qn747ak6-oj40fq


https://wolfram.com/xid/0qn747ak6-i70bei


https://wolfram.com/xid/0qn747ak6-olrxst

Import using the original orientation:

https://wolfram.com/xid/0qn747ak6-s4jg2y

IncludeMetaInformation (1)
By default, all available metadata is exported:

https://wolfram.com/xid/0qn747ak6-hbtrv0

https://wolfram.com/xid/0qn747ak6-d26knl


https://wolfram.com/xid/0qn747ak6-kiahes

Specify the metadata to include:

https://wolfram.com/xid/0qn747ak6-lyrps1


https://wolfram.com/xid/0qn747ak6-7rv0o4


https://wolfram.com/xid/0qn747ak6-yynblo

Some metadata may automatically get generated:

https://wolfram.com/xid/0qn747ak6-keryjm

"QuantizationMethod" (1)
RasterSize (1)
By default, the image is exported in the full resolution:

https://wolfram.com/xid/0qn747ak6-lszysm

https://wolfram.com/xid/0qn747ak6-bhjnpf


https://wolfram.com/xid/0qn747ak6-t9ntr8


https://wolfram.com/xid/0qn747ak6-7p8hv4

Specify the raster size of the exported image:

https://wolfram.com/xid/0qn747ak6-3ie1wu


https://wolfram.com/xid/0qn747ak6-ss5jdi
