ImageGear .NET v24.12 - Updated
TIFF
User Guide > File Formats and Compressions > File Formats > File Formats Reference > TIFF
Full Name TIFF (Tagged Image File Format)
Format ID ImGearFormats.TIF
File Extension(s) *.tif, *.tiff
Data Type Raster Image
Data Encoding Binary
Multi-Page Support Yes
Alpha Channel Support Yes
Metadata Update Support Page
ImageGear Platforms Support WIN32, WIN64, Unix, Unix64, .NET, .NET64, MAC

ImageGear Supported Versions

ImageGear Supported Features

ImageGear Read Support

To use LZW (Lempel-Ziv-Welch) Compression compression scheme ImageGear.Formats Namespace should be attached.

ImageGear Write Support

TIFF writer requires read/write access to the output stream.

ImageGear Filter Control Parameters

Filter Control Parameter Type Default Value Available Values Description
BigEndian bool false false,

true
If true , big endian order is used for write operation ("MM"), in other case little endian is used("II").
BitonalPaletteMode ImGearTIFFBitonalPaletteMode Enumeration LEGACY An ImGearTIFFBitonalPaletteMode Enumeration value Specifies whether ImageGear shall fix strange looking palettes when reading bitonal TIFF images.
FillOrder ImGearFillOrder Enumeration MSB An ImGearFillOrder Enumeration value Specifies fill order to use for writing the TIFF file. Should always be set to MSB (default); LSB is okay only for special circumstances and only for ImGearCompressions CCITT_G3, CCITT_G4, CCITT_C32D, HUFFMAN, and NONE.
ImageBeforeIFD bool false false, true This flag specifies physical location of raster data inside TIFF file relatively to IFD record. If this value is true then image data is to be written before IFD record.
IncludePageNumber bool true false, true If this parameter is true then include tag 297 into TIFF image with real value of page number.
LoadFirstUnknownChannelAsPAlpha bool true true, false This parameter specifies how to load first extra channel if ExtraSamples tag is missing. If LoadFirstUnknownChannelAsPAlpha is True, IG loads first extra channel as Premultiplied Alpha channel. This mode provides support for RGBPA TIFF images written by earlier versions of ImageGear. If LoadFirstUnknownChannelAsPAlpha is False, IG loads all extra channels as extra channels.
MissingCompression ImGearCompressions Enumeration AUTO An ImGearCompressions Enumeration value Compression to use for image loading, if compression tag is missing in the image.
Save70 bool true false, true If this value is true then output TIFF-JPEG image will be produced in TIFF 7.0 compatible format but in other case it will be compatible with TIFF 6.0.
SaveClassF bool false false, true If this value is true then image to be written in TIFF format compatible with class F requirements.
SaveEXIFMetadata bool false true, false If this parameter is true EXIF metadata is saved with TIFF file.
SaveExistingEXIFMetadata bool true true, false This parameter controls the saving of existing EXIF metadata.

By default (SaveEXIFMetadata = False, SaveExistingEXIFMetadata = True), ImageGear saves EXIF metadata if it exists in the source page, and does not save EXIF metadata if it does not exist in the source page.
SavePlanar bool false false, true Specifies tag value 284 for output image.
SaveUsingDiffPredictor bool false false, true If this parameter is true, then output TIFF-LZW image will be produced using the horizontal differencing predictor.
StripBufferSize int 32768 Any positive value If StripMode equals ImGearStripModes Enumeration.FIXED_BUFFER, specifies the buffer size to be used for writing of each strip.
StripCount int 1 Any positive int value, not greater than image height If StripMode equals ImGearStripModes Enumeration.FIXED_COUNT, specifies the number of strips for saving the TIFF image.
StripMode ImGearStripModes Enumeration FIXED_COUNT An ImGearStripModes Enumeration value Specifies strip or tile saving mode for the TIFF image. By default, ImageGear saves TIFF files with one strip.
SubIFDpath string Empty string Any string value Path of the SubIFD to load the image from. If set to empty string (default), load image from root IFD. See "Camera Raw Image support" section for more detail.
TileHCount int 10 Any positive int value, not greater than image width If StripMode equals ImGearStripModes Enumeration.TILED_FIXED_COUNT, specifies the number of tiles in horizontal dimension.
TileHeight int 64 Any positive int value, not greater than image height If StripMode equals ImGearStripModes Enumeration.TILED_FIXED_SIZE, specifies the height of each tile.
TileVCount int 10 Any positive int value, not greater than image height If StripMode equals ImGearStripModes Enumeration.TILED_FIXED_COUNT, specifies the number of tiles in vertical dimension.
TileWidth int 64 Any positive int value, not greater than image width If StripMode equals ImGearStripModes Enumeration.TILED_FIXED_SIZE, specifies the width of each tile.
TreatThumbnailsAsPages bool false false, true If this parameter is true, ImageGear considers the pages marked with 'NewSubfileType tag is 1' as regular pages. Otherwise, pages with 'NewSubfileType is 1' are considered thumbnails and are not loaded and not taken into account in page count calculation.

SaveExistingEXIFMetadata works in combination with SaveEXIFMetadata parameter, as shown in the table below:

SaveEXIFMetadata SaveExistingEXIFMetadata Source Page has EXIF metadata ImageGear Action
False False No Does not save EXIF metadata
False False Yes Does not save EXIF metadata
False True No Does not save EXIF metadata
False True Yes Saves existing EXIF metadata
True False No Saves default EXIF metadata
True False Yes Ignores existing and saves default EXIF metadata
True True No Saves default EXIF metadata
True True Yes Saves existing EXIF metadata

Comments

TIFF was developed for use in storing black-and-white images from scanners and desktop publishing applications. Now, in its fourth release (version 6.0), it is one of the most detailed and versatile bitmap formats in use. It is supported by most art, imaging, and word-processing applications. It supports several compression schemes. Aside from saving image data in bitmap form, it can also contain vector or text-based images.

Containing just three fields, the TIFF header is simple and one of the shortest of all the graphics file format headers. But, the structure of a TIFF is complicated, with variable length fields, variable number of fields, and the ability to store information (other than the header) in any order desired.

The other two major components of the TIFF format are "Image File Directories" (IFDs) and the image or images themselves. There is one IFD per image stored. The combination of an IFD and an image is referred to as a "subfile". The header contains an offset pointer to the first IFD. If there are multiple IFDs, each contains an offset to the next. The last IFD contains a value that signifies the end of the file.

IFDs closely resemble a header structure, and the information stored in them is often referred to as "TIFF Header Information". Unlike a header, however, they contain a variable number of "tags" (pointers or fields). In addition, each tag can point to data with a variable length. TIFFs are notorious for the number of tags that they can contain, up to a maximum of 65,535 tags of nearly 100 different types (version 6.0). Tags are listed in order by code number so that a TIFF reader can easily determine what fields are present. While ImageGear reads and stores all TIFF tags, it utilizes a subset of all of the possible tags. See note on previous page.

In version 5.0, the presence of certain subgroups of tags determined what "class" the TIFF belonged to. The classes are: TIFF-B-monochrome, TIFF-F-fascimile, TIFF-G-grayscale, TIFF-P-palette based, TIFF-R-RGB color, TIFF-X-any class, TIFF-Y-can use JPEG compression. Version 6.0 uses tags to divide the TIFF type into different file configurations, leaving behind the class concept. Version 6.0 configurations are: Bilevel, palette color, RGB, grayscale, YCbCr, and Class F (facsimile).

TIFF bitmap data can be stored in one of two configurations: strips or tiles. Strips are groups of adjoining rows of bitmap data, and can be found in version 5.0 and 6.0 files. Tiles were new to TIFF version 6.0. They are rectangular or square sections of bitmap data. The method of storage is determined in part by what kind of compression (if any) is used. JPEG compression can handle tiled images. Due to the need for padding with tile storage, tiling is not usually efficient for small images.

ImageGear supports the following compression schemes for TIFF:

See the ImageGear Supported Compressions Reference for descriptions of these compression types. The compression tag of the IFD tells whether the image is compressed, and by what method. (Not all TIFF files can use JPEG compression. It is supported by version 6.0, but in version 5.0, only a "Y" class TIFF can use JPEG).

TIFF/EP

TIFF/EP format was designed to provide a means for storing "raw" (unprocessed) image from digital camera's sensor.

TIFF/EP allows you to store several versions of the same image in one file. Typically, TIFF/EP image includes a small preview and a raw image. It can also include a larger or full-size preview, or some other variations of the image.

TIFF/EP uses IFD trees for storing different versions of image. This is different from IFD chains that are used in baseline TIFF to store multiple pages.

ImageGear does not detect TIFF/EP as a separate file format. If Raw detection is enabled, and ImageGear can recognize TIFF/EP file as a known Raw format, it detects and loads the file as DCRAW. Otherwise it detects TIFF/EP as TIFF. One of well known extensions to TIFF/EP is Adobe DNG format. ImageGear detects it as a separate file format.

Most of digital cameras store pixels in "mosaic" format. At a given pixel location either a Red, Green, Blue, Cyan, or some other color sample value is recorded. Such images are referred to as "Color Filter Array" type. TIFF/EP format uses a two-dimensional matrix called "Color Filter Array pattern" to describe positions of pixels of particular color in the mosaic image. In order to recreate the full color values in each pixel, it is necessary to interpolate intensities of neighboring pixels.

To enable loading images from TIFF SubIFDs, a new control parameter is added to TIFF filter: "SUBIFD_PATH". This parameter has the type of String, and its default value is "" (empty string). By default, ImageGear loads the image in the root IFD (thumbnail). If "SUBIFD_PATH" string begins with a number, then ImageGear loads the image from the corresponding SubIFD of the root IFD. For example, if SUBIFD_PATH is set to "3", ImageGear will load the image from the 3rd SubIFD.

SUBIFD_PATH parameter also affects metadata reading. Metadata is loaded starting from the IFD specified by SUBIFD_PATH.

ImageGear does not support color reconstruction of TIFF/EP images, unless they are detected to be a DNG or a DCRAW image supported by ImageGear.

References Used

Brown, C. Wayne, and Barry J. Shepherd. Graphics File Formats: Reference and Guide. Greenwich, CT.: Manning Publications, 1992.

Kay, David C. and John R. Levine. Graphics File Formats. Windcrest Books, 1992.

Murray, James D. "Graphic Image Format FAQ 3-4". James D. Murray, 1994-1996.

Murray, James D. and William vanRyper. Encyclopedia of Graphics File Formats. Sebastopol, CA: O'Reilly & Associates, Inc., 1994.