TIFF Tag SampleFormat

IFDImage
Code339 (hex 0x0153)
NameSampleFormat
LibTiff nameTIFFTAG_SAMPLEFORMAT
TypeSHORT
CountN = SamplesPerPixel
Default1 (unsigned integer data)

Description

Specifies how to interpret each data sample in a pixel.

The specification defines these values:

1 = unsigned integer data
2 = two's complement signed integer data
3 = IEEE floating point data
4 = undefined data format

LibTiff defines these values, and adds two more to cover complex sample formats:

SAMPLEFORMAT_UINT = 1;
SAMPLEFORMAT_INT = 2;
SAMPLEFORMAT_IEEEFP = 3;
SAMPLEFORMAT_VOID = 4;

SAMPLEFORMAT_COMPLEXINT = 5;
SAMPLEFORMAT_COMPLEXIEEEFP = 6;

Note that the SampleFormat field does not specify the size of data samples; this is still done by the BitsPerSample field.

A field value of undefined is a statement by the writer that it did not know how to interpret the data samples; for example, if it were copying an existing image. A reader would typically treat an image with undefined data as if the field were not present (i.e. as unsigned integer data).

Related tags