A BigTIFF file is a 16-byte header and one or more image file directories (IFDs), which
point at everything else. The design is based on a proposal by Steve Carlsen of Adobe.
Files normally keep the .tif or .tiff extension;
.tf8 and .btf have been suggested.
File header
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | ASCII | byte order | II (49 49) little-endian; MM (4D 4D) big-endian. It applies to every number in the file. |
| 2 | 2 | u16 | version | 43. |
| 4 | 2 | u16 | offset size | The size of an offset in bytes; must be 8. Readers should stop if it is not. |
| 6 | 2 | u16 | reserved | Must be 0. Readers should stop if it is not. |
| 8 | 8 | u64 | first IFD offset | Where the first directory is, from the start of the file. |
The file therefore starts 49 49 2B 00 08 00 00 00 or
4D 4D 00 2B 00 08 00 00.
Image file directory
Each page, reduced image or mask in a file has its own IFD.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 8 | u64 | count | The number of entries. It is 8 bytes wide, which keeps entries 8-byte aligned. |
| 8 | 20 × count | entries | entries | Sorted by tag number, ascending. |
| 8 + 20 × count | 8 | u64 | next IFD offset | Where the next directory is; 0 if this is the last. |
Directory entry
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | tag | Which field this is. |
| 2 | 2 | u16 | type | The data type, from the table below. |
| 4 | 8 | u64 | count | The number of values, not the number of bytes. |
| 12 | 8 | value or offset | value | The value, or where to find it. |
If count × type size is 8 bytes or fewer, the value is stored in the entry itself, left-justified, in the lower-numbered bytes of the field. Otherwise the field holds the offset of the value, and values stored out of line must start at an 8-byte-aligned address. Readers must skip entries with a type or tag they do not know.
Data types
| Value | Name | Size | Meaning |
|---|---|---|---|
| 1 | BYTE | 1 | 8-bit unsigned integer. |
| 2 | ASCII | 1 | 7-bit text, with the last byte zero. The count includes it. |
| 3 | SHORT | 2 | 16-bit unsigned integer. |
| 4 | LONG | 4 | 32-bit unsigned integer. |
| 5 | RATIONAL | 8 | Two LONGs: numerator, then denominator. |
| 6 | SBYTE | 1 | 8-bit two’s complement integer. |
| 7 | UNDEFINED | 1 | 8 bits of anything, as the field defines. |
| 8 | SSHORT | 2 | 16-bit two’s complement integer. |
| 9 | SLONG | 4 | 32-bit two’s complement integer. |
| 10 | SRATIONAL | 8 | Two SLONGs: numerator, then denominator. |
| 11 | FLOAT | 4 | IEEE single precision. |
| 12 | DOUBLE | 8 | IEEE double precision. |
| 13 | IFD | 4 | A 32-bit offset to another IFD. |
| 16 | LONG8 | 8 | 64-bit unsigned integer. New in BigTIFF. |
| 17 | SLONG8 | 8 | 64-bit two’s complement integer. New in BigTIFF. |
| 18 | IFD8 | 8 | 64-bit offset to another IFD. New in BigTIFF. |
StripOffsets, StripByteCounts, TileOffsets and
TileByteCounts may use LONG8, and the classic
LONG and SHORT types stay valid. Tags that point at other
IFDs, such as SubIFDs, may use IFD8, and IFD and
LONG stay valid.
Trees of directories
Besides the chain of next IFD offsets, a directory can point at others:
SubIFDs (tag 330) holds child images, such as reduced resolutions of the
same page, and the Exif (34665), GPS (34853) and Interoperability (40965) tags point
at directories of their own, which use the same entry layout and their own tag
numbering.
Required tags
A baseline reader expects, at the least, the following tags. A grey, palette or RGB
image also needs the fields for its type, such as SamplesPerPixel for RGB
and ColorMap for a palette.
| Tag | Name |
|---|---|
| 256 | ImageWidth |
| 257 | ImageLength |
| 258 | BitsPerSample |
| 259 | Compression |
| 262 | PhotometricInterpretation |
| 273 | StripOffsets |
| 278 | RowsPerStrip |
| 279 | StripByteCounts |
| 282 | XResolution |
| 283 | YResolution |
| 296 | ResolutionUnit |
Worked example
A complete little-endian file holding one white greyscale pixel, 193 bytes long. For brevity it leaves out the resolution tags.
| Offset | Bytes | Meaning |
|---|---|---|
| 0 | 49 49 2B 00 | Little-endian, version 43. |
| 4 | 08 00 00 00 | Offset size 8, reserved 0. |
| 8 | 10 00 00 00 00 00 00 00 | First IFD at offset 16. |
| 16 | 08 00 00 00 00 00 00 00 | 8 entries. |
| 24 | 00 01 03 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 | ImageWidth: SHORT, count 1, value 1. |
| 44 | 01 01 03 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 | ImageLength 1. |
| 64 | 02 01 03 00 01 00 00 00 00 00 00 00 08 00 00 00 00 00 00 00 | BitsPerSample 8. |
| 84 | 03 01 03 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 | Compression 1, none. |
| 104 | 06 01 03 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 | PhotometricInterpretation 1, BlackIsZero. |
| 124 | 11 01 10 00 01 00 00 00 00 00 00 00 C0 00 00 00 00 00 00 00 | StripOffsets: LONG8, offset 192. |
| 144 | 16 01 03 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 | RowsPerStrip 1. |
| 164 | 17 01 10 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 | StripByteCounts: LONG8, 1 byte. |
| 184 | 00 00 00 00 00 00 00 00 | No next IFD. |
| 192 | FF | The pixel. |