Tagged Image File Format (TIFF and BigTIFF)

TIFF is a tag-based file format designed to promote universal interchanges of digital image data. Because TIFF files do not have a single way to store image data, there are many versions of TIFF. LEADTOOLS supports the most common TIFF formats.

The usual file extension is TIFF or TIF.

TIFF files use 32-bit offsets, so they are limited to 4GB. A newer version of this file format, BigTIFF, uses 64-bit offsets and can create files larger than 4GB. Not all TIFF readers support BigTIFF files. TIFF and BigTIFF pages cannot be mixed within the same file: all the pages in the file must be either TIFF or BigTIFF. However, you can use L_CompactFile to convert between TIFF and BigTIFF files without recompressing the image data.

You can identify BigTIFF files by examining the FILEINFO.Flags and checking whether the FILEINFO_BIGTIFF flag is set.

Save BigTIFF files by setting ESO2_BIGTIFF in SAVEFILEOPTION.Flags2. The file format returned in FILEINFO.Format is the same for TIFF and BigTIFF files.

The distinction is made using the ESO2_BIGTIFF flag:

BigTIFF and TIFF files have the same capabilities. For simplicity, for the rest of this document both TIFF and BigTIFF files will be referred to as "TIFF".

TIFF files can contain many comment fields of various types. Use the L_ReadFileComment function to read comments in an existing file. Before writing a file, use the L_SetComment function to create an array of comments to be saved in the file. Use the L_DeleteComment function to delete a comment field from a file. 

NOTE: TIFF is one of the very few file formats that can contain regions. The region is saved automatically when you save a bitmap with a region as TIFF. To do so, you must have an unlocked Document or Medical Imaging license.

LEADTOOLS also supports the ability to save a vector image as a DXF within a TIFF.

LEADTOOLS supports loading and saving multi-page files in this format.

LEADTOOLS can read and write TIFF files that use RGB, CMYK, YCbCr, or CieLAB color spaces. LEADTOOLS can also read and write files with many compression types.

See the table below to see which compressions, color spaces, and bits/pixel can be saved with LEADTOOLS. Note that not all combinations of compressions and color spaces are possible.

For files with CieLAB color space, FILEINFO.Format is set to FILE_TIF and FILEINFO.ColorSpace is set to COLORSPACE_CIELAB.

NOTE: LEADTOOLS can read TIFF files with CieLAB color space, but does not support saving such files.

LEADTOOLS can also read and write files with Lossless JPEG Compression for 8-, 12-, and 16-bit grayscale and 24-bit color spaces.

LEADTOOLS can read and write 12-, 16-, and 32-bit grayscale. (Document or Medical Imaging toolkits)

The following file constants are associated with this file format:

Constant Read Support BPP Write Support BPP Description
FILE_TIF 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, [3] Tagged Image File Format (TIFF), with
8, 16, 24, 32, 48, 64 8, 24, 48, 64 no compression and RGB color space.
12 (Grayscale)
16, 32 (Color and Grayscale)
FILE_TIF_ABIC 1, 4 1, 4 [186] TIFF, with ABIC Compression.
(Supports multi-page) Supported in
Document or Medical Imaging toolkits.
FILE_TIF_CMYK 24, 32 24, 32 [85] TIFF, with no compression and
CMYK color space.
FILE_TIF_YCC 24 24 [93] TIFF, with no compression and
YCbCr color space.
FILE_TIF_PACKBITS 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, [87] TIFF, with PackBits Compression and
8, 16, 24, 32 8, 16, 24, 32 RGB color space.
FILE_TIF_PACKBITS_CMYK 24, 32 24, 32 [88] TIFF, with PackBits Compression and
CMYK color space.
FILE_TIF_PACKBITS_YCC 24 24 [95] TIFF, with PackBits Compression and
YCbCr color space.
FILE_TIFLZW 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, [17] TIFF, with LZW Compression and
8, 16, 24, 32, 48, 64 8, 16, 24, 32, 48, 64 RGB color space.
FILE_TIFLZW_CMYK 24, 32 24, 32 [86] TIFF, with LZW Compression and
CMYK color space
FILE_TIFLZW_YCC 24 24 [94] TIFF, with LZW Compression and
YCbCr color space.
FILE_TIF_JPEG 8, 24 8, 24 [11] TIFF, with JPEG Compression and
12, 16 (Grayscale) 12, 16 (Grayscale) 4:4:4 color space or Lossless Compression
with RGB color space.
FILE_TIF_JPEG_422 24 24 [24] TIFF, with JPEG Compression and
YUV 4:2:2 color space.
FILE_TIF_JPEG_411 24 24 [22] TIFF, with JPEG Compression and
YUV 4:1:1 color space.
FILE_TIF_JPEG_CMYK 24 24 [394] TIFF, with JPEG Compression and
CMYK 4:4:4 color space.
FILE_TIF_JPEG_CMYK_422 24 24 [396] TIFF, with JPEG Compression and
CMYK 4:2:2 color space.
FILE_TIF_JPEG_CMYK_411 24 24 [395] TIFF, with JPEG Compression and
CMYK 4:1:1 color space.
FILE_TIF_CMP 24 24 [138] TIFF, with CMP Compression.
8 (Grayscale) 8 (Grayscale)
FILE_TIF_JBIG 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, [139] TIFF, with JBIG Compression.
8, 16, 24, 32 8, 16, 24, 32
12 (Grayscale) 12 (Grayscale)
FILE_TIF_JBIG2 1 1 [187] TIFF, with JBIG2 Compression
(Supports multi-page) (JBIG2 or
Raster PDF support is required.)
FILE_TIF_DXF_R12 8 8 [176] TIFF, with a vector
image saved as a DXF Release 12.
FILE_TIF_DXF_R13 8 8 [140] TIFF, with a vector
image saved as a DXF Release 13.
FILE_TIF_J2K 8, 24 8, 24 [166] TIFF, with JPEG 2000 Compression.
12, 16 (Grayscale) 12, 16 (Grayscale) This file format contains only a
stream of image data.
FILE_TIF_CMW 8, 24 8, 24 [167] TIFF, with Wavelet
12, 16 (Grayscale) 12, 16 (Grayscale) CMP Compression.
FILE_GEOTIFF 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, [174] GeoTIFF file format.
8, 24, 32, 48, 64 8, 24, 32, 48, 64
16 (Grayscale) 16 (Grayscale)
FILE_EXIF 24 24 [96] Exif file containing a TIFF image, with
no compression and with RGB color space.
FILE_EXIF_YCC 24 24 [97] Exif file containing a TIFF image, with
no compression and with YCbCr color space.
FILE_EXIF_JPEG_422 24 24 [98] Exif file containing a
JPEG-compressed image.
FILE_EXIF_JPEG_411 24 24 [101] Exif 2.0 file containing a
JPEG-compressed image.
FILE_CCITT 1 1 [25] TIFF, compressed using CCITT.
FILE_CCITT_GROUP3_1DIM 1 1 [27] TIFF, compressed using CCITT,
group 3, 1-dimensional.
FILE_CCITT_GROUP3_2DIM 1 1 [28] TIFF, compressed using CCITT,
group 3, 2-dimensional.
FILE_CCITT_GROUP4 1 1 [29] TIFF, compressed using CCITT,
group 4.
FILE_TIF_UNKNOWN NA NA [141] TIFF, with unknown compression.
FILE_TIF_ABC 1 1 [180] TIFF, with ABC Compression.
FILE_TIF_MRC 1 1 [177] TIFF, with MRC Compression.
FILE_TIF_LEAD_MRC 1 1 [315] TIFF, with LEAD MRC Compression.
FILE_TIF_ZIP 1, 2, 3, 4, 5, 6, 7, None [189] TIFF, with ZIP Compression.
8, 16, 24, 32
12 (Grayscale)

Required DLL: LFTIF. For a listing of the exact DLLs needed, based on the toolkit version, refer to Files To Be Included With Your Application.

For loading or saving CMYK files or LAB color space files, you will also need LTCLR.

Related Formats: CMP - LEAD Compressed, CMP - LEAD 1-Bit Format, EXIF - Exif Formats, JPG - JPEG Compressed, JP2 - JPEG 2000 Compressed, TIFF CCITT and other Fax Formats.

Platforms

Win32, x64, Linux.

Help Version 20.0.2019.9.22
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help