TIFF (.tiff, .tif)

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 and ExportImport and Export

  • Import["file.tiff"] imports a TIFF file, returning a single Image object or a list of images.
  • Export["file.tiff",expr] exports graphics or any other expression as an image to a TIFF file.
  • Export["file.tiff",{g1,g2,}] exports a list of graphics as a multi-image TIFF file.
  • Export["file.tiff",expr] creates a TIFF image with the same image size as the displayed form of expr.
  • When exporting Wolfram Language graphics or arbitrary expressions to TIFF, the resulting image has the same raster size as its displayed form.
  • Image objects are by default exported at their full raster size.
  • Because TIFF is a raster image format, all fonts are rasterized on export.
  • When exporting an image of type , , and , Export creates a 16-bit TIFF file by default. images are exported to 8-bit and images are exported to 1-bit TIFF files.
  • Import["file.tiff",elem] imports the specified element from a TIFF file.
  • Import["file.tiff",{elem,suba,subb,}] imports a subelement.
  • Import["file.tiff",{{elem1,elem2,}}] imports multiple elements.
  • The import format can be specified with Import["file","TIFF"] or Import["file",{"TIFF",elem,}].
  • Export["file.tiff",expr,elem] creates a TIFF file by treating expr as specifying element elem.
  • Export["file.tiff",{expr1,expr2,},{{elem1,elem2,}}] treats each as specifying the corresponding .
  • Export["file.tiff",expr,opt1->val1,] exports expr with the specified option elements taken to have the specified values.
  • Export["file.tiff",{elem1->expr1,elem2->expr2,},"Rules"] uses rules to specify the elements to be exported.
  • See the reference pages for full general information on Import and Export.
  • ImportString and ExportString support the TIFF format.

Notebook InterfaceNotebook Interface

  • In the notebook front end, Insert Picture and the Open menu allow import of a TIFF file into a cell.
  • Save Selection As exports the selected part of a notebook as a TIFF file.

ElementsElements

  • General Import elements:
  • "Elements"list of elements and options available in this file
    "Rules"full list of rules for each element and option
    "Options"list of rules for options, properties, and settings
  • Data representation elements:
  • "Animation"multi-image TIFF represented as an animation object
    "Graphics"the first image in the file, given as graphics
    "GrayLevels"array of normalized gray-level values
    "GraphicsList"all images as a list of graphics
    "Image"first image in the file, represented as an Image object
    "Image3D"images in the file, represented as an Image3D object
    "ImageList"all images, given as a list of Image objects
  • Import by default uses for simple TIFF files and for multi-image TIFF files.
  • Import of a multi-image TIFF with element or 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 or always generates a single-image TIFF.
  • Advanced Import elements:
  • "Background"background color shown in transparent image regions
    "BitDepth"bits used to represent each color channel in the file
    "ColorProfileData"embedded color profile, given as a ColorProfileData object
    "ColorSpace"color encoding used in the file
    "ImageCount"number of images in the file
    "ImageEncoding"how images are compressed in the file
    "ImageResolution"image resolution specified in the file
    "ImageSize"raster dimensions
  • Data representation elements:
  • "ColorMap"color-reduction palette
    "Data"array of pixel values
    "RawData"array of color map indices
    "RGBColorArray"array of RGBColor objects
  • Metadata elements:
  • "Author"creator name
    "CameraTopOrientation"orientation of the camera when the picture was taken
    "Comments"user comments
    "CopyrightNotice"copyright information as a string
    "Device"model specification of the camera or input device
    "DeviceManufacturer"maker of the camera or input device
    "ImageCreationDate"date and time the original picture was taken, given as a DateList specification
    "RowsPerStrip"number of rows per strip for a striped TIFF file
    "TileSize"size of tiles for a tiled TIFF file
  • For multi-image TIFFs, the above data representation and metadata elements are taken to be lists of the respective expressions.

OptionsOptions

  • General options:
  • ImageResolutionAutomaticresolution used for rendering the graphics
    ImageSizeAutomaticoverall image size
  • Import and Export option:
  • "ImageTopOrientation"Toporientation of the image as stored in the file
  • Import options:
  • "TakeRows"{1,-1}rows to import
  • Export options:
  • ByteOrdering-1ordering of bytes in the file
    "BitDepth"Automaticbit depth per channel used to store image data
    "ColorSeparation"Falsewhether to store color channels in separate planes
    "ColorSpace"Automaticcolor encoding to be used in the file
    "CompressionLevel"Automaticcompression level, given as a number between 0 and 1
    "DifferencingPredictor"Falsewhether to use horizontal differencing when using LZW or ZIP compression
    "ImageEncoding"Nonehow images are compressed in the file
  • Export to TIFF supports GrayLevel, RGBColor, CMYKColor, and LABColor color spaces.
  • The following settings for are supported: Automatic, 1, 8, 16, 32, and 64.
  • With the setting "BitDepth"->Automatic, Export reduces floating-point images to a 16-bit representation.
  • The following settings for are supported:
  • Noneno compression
    "JPEG"lossy JPEG compression
    "LZW"lossless LZW compression
    "PackBits"PackBits run-length encoding method
    "ZIP"lossless ZIP image data compression

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

This imports a TIFF example file, rendering it as an Image:

In[1]:=
Click for copyable input
Out[1]=

Show the Import elements available in this file:

In[2]:=
Click for copyable input
Out[2]=

Export an image object to TIFF:

In[1]:=
Click for copyable input
Out[1]=

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

In[1]:=
Click for copyable input
Out[1]=

Export a binary image:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=

Export a real-valued RGB image:

In[1]:=
Click for copyable input
Out[1]=

Export a Lab image:

In[1]:=
Click for copyable input
Out[1]=

Generate a TIFF file with meta-information:

In[1]:=
Click for copyable input
Out[1]=

Create a TIFF file from data representation elements:

In[1]:=
Click for copyable input
Out[1]=

Use a TIFF file to store floating-point data:

In[1]:=
Click for copyable input
Out[1]=

Extract the number of frames in a multi-frame TIFF file:

In[1]:=
Click for copyable input
Out[1]=

Import a single frame:

In[2]:=
Click for copyable input
Out[2]=

Import a subset of frames:

In[3]:=
Click for copyable input
Out[3]=

Import only the specified rows:

In[1]:=
Click for copyable input
Out[1]=

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

In[1]:=
Click for copyable input
Out[1]=
Introduced in 1999
(4.0)
| Updated in 2014
(10.0)