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 multipage 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 and Medical Imaging toolkits)
The file constants associated with this file format are:
Constant | Read Support | Write Support | Description |
---|---|---|---|
FILE_TIF | 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32, 48, 64 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 12 (grayscale) 16 (color and grayscale), 24, 32 (color and grayscale), 48, 64 BPP | [3] Tagged Image File Format, with no compression and with RGB color space. |
FILE_TIF_ABIC | 1, 4 BPP | 1, 4 BPP | [186] Tagged Image File Format, with ABIC compression. (Supports multi-page) |
Supported in Document and Medical Imaging toolkits. | |||
FILE_TIF_CMYK | 24, 32 BPP | 24, 32 BPP | [85] Tagged Image File Format, with no compression and with CMYK color space. |
FILE_TIF_YCC | 24 BPP | 24 BPP | [93] Tagged Image File Format, with no compression and with YCbCr color space. |
FILE_TIF_PACKBITS | 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32 BPP | [87] Tagged Image File Format with PackBits Compression and RGB color space. |
FILE_TIF_PACKBITS_CMYK | 24, 32 BPP | 24, 32 BPP | [88] Tagged Image File Format with PackBits Compression and CMYK color space. |
FILE_TIF_PACKBITS_YCC | 24 BPP | 24 BPP | [95] Tagged Image File Format with PackBits Compression and YCbCr color space. |
FILE_TIFLZW | 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32, 48, 64 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 16, 24, 32, 48, 64 BPP | [17] Tagged Image File Format with LZW Compression and RGB color space. |
FILE_TIFLZW_CMYK | 24, 32 BPP | 24, 32 BPP | [86] Tagged Image File Format with LZW Compression and CMYK color space |
FILE_TIFLZW_YCC | 24 BPP | 24 BPP | [94] Tagged Image File Format with LZW Compression and YCbCr color space. |
FILE_TIF_JPEG | 8, 12, 16 BPP (Grayscale) | 8, 12, 16 BPP (Grayscale) | [11] Tagged Image File Format with JPEG compression and YUV 4:4:4 color space or Lossless compression with RGB color space. |
24 BPP | 24 BPP | ||
FILE_TIF_JPEG_422 | 24 BPP | 24 BPP | [24] Tagged Image File Format with JPEG compression and YUV 4:2:2 color space. |
FILE_TIF_JPEG_411 | 24 BPP | 24 BPP | [22] Tagged Image File Format with JPEG compression and YUV 4:1:1 color space. |
FILE_TIF_JPEG_CMYK | 24 BPP | 24 BPP | [394] Tagged Image File Format with JPEG compression and CMYK 4:4:4 color space. |
FILE_TIF_JPEG_CMYK_422 | 24 BPP | 24 BPP | [396] Tagged Image File Format with JPEG compression and CMYK 4:2:2 color space. |
FILE_TIF_JPEG_CMYK_411 | 24 BPP | 24 BPP | [395] Tagged Image File Format with JPEG compression and CMYK 4:1:1 color space. |
FILE_TIF_CMP | 8 BPP (Grayscale) | 8 BPP (Grayscale) | [138] Tagged Image File Format with CMP Compression. |
24 BPP | 24 BPP | ||
FILE_TIF_JBIG | 1, 2, 3, 4, 5, 6, 7, 8, 12 (Grayscale), 16, 24, 32 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 12 (Grayscale), 16, 24, 32 BPP | [139] Tagged Image File Format with JBIG Compression. |
FILE_TIF_JBIG2 | 1 BPP | 1 BPP | [187] Tagged Image File Format with JBIG2 Compression. (Supports multi-page) |
(JBIG2 or Raster PDF support is required.) | |||
FILE_TIF_DXF_R12 | 8 BPP | 8 BPP | [176] Tagged Image File Format with a vector image saved as a DXF Release 12. |
FILE_TIF_DXF_R13 | 8 BPP | 8 BPP | [140] Tagged Image File Format with a vector image saved as a DXF Release 13. |
FILE_TIF_J2K | 8, 12 (Grayscale), 16 BPP (Grayscale) | 8, 12 (Grayscale), 16 BPP (Grayscale) | [166] Tagged Image File Format with JPEG 2000 Compression. This file format contains only a stream of image data. |
24 BPP | 24 BPP | ||
FILE_TIF_CMW | 8, 12, 16 BPP (Grayscale) | 8, 12, 16 BPP (Grayscale) | [167] Tagged Image File Format with Wavelet CMP Compression. |
24 BPP | 24 BPP | ||
FILE_GEOTIFF | 1, 2, 3, 4, 5, 6, 7, 8, 16 BPP (Grayscale), 24, 32, 48, 64 BPP | 1, 2, 3, 4, 5, 6, 7, 8, 16 BPP (Grayscale), 24, 32, 48, 64 BPP | [174] GeoTIFF file format. |
FILE_EXIF | 24 BPP | 24 BPP | [96] Exif file containing a TIFF image, with no compression and with RGB color space. |
FILE_EXIF_YCC | 24 BPP | 24 BPP | [97] Exif file containing a TIFF image, with no compression and with YCbCr color space. |
FILE_EXIF_JPEG_422 | 24 BPP | 24 BPP | [98] Exif file containing a JPEG compressed image. |
FILE_EXIF_JPEG_411 | 24 BPP | 24 BPP | [101] Exif 2.0 file containing a JPEG compressed image. |
FILE_CCITT | 1 BPP | 1 BPP | [25] Tagged Image File Format, compressed using CCITT. |
FILE_CCITT_GROUP3_1DIM | 1 BPP | 1 BPP | [27] Tagged Image File Format, compressed using CCITT, group 3, 1 dimension. |
FILE_CCITT_GROUP3_2DIM | 1 BPP | 1 BPP | [28] Tagged Image File Format, compressed using CCITT, group 3, 2 dimensions. |
FILE_CCITT_GROUP4 | 1 BPP | 1 BPP | [29] Tagged Image File Format, compressed using CCITT, group 4. |
FILE_TIF_UNKNOWN | NA | NA | [141] Tagged Image File Format, with unknown compression. |
FILE_TIF_ABC | 1 BPP | 1 BPP | [180] Tagged Image File Format with ABC compression. |
FILE_TIF_MRC | 1 BPP | 1 BPP | [177] Tagged Image File Format with MRC compression. |
FILE_TIF_LEAD_MRC | 1 BPP | 1 BPP | [315] Tagged Image File Format with LEAD MRC compression. |
FILE_TIF_ZIP | 1, 2, 3, 4, 5, 6, 7, 8, 12 (Grayscale), 16, 24, 32 BPP | None | [189] Tagged Image File Format with ZIP compression. |
Required DLLs and Libraries
Related Formats
Win32, x64, Linux.
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document