Each field entry in an IFD has 12 bytes and consists of a 2-byte Tag,
2 bytes identifying the field type (e.g., short, long, rational,
ASCII), 4 bytes giving the count (number of values or offsets), and 4
bytes containing either the offset to a field value stored outside
the IFD or, based on the type and count, the field value itself.
Resolution and metadata such as dates, names, and descriptions are
examples of "long" field values that do not fit in 4 bytes and
therefore use offsets in the field entry. Details are given in the
TIFF specification [TIFF].
A TIFF file can contain more than one IFD, where each IFD is a
subfile whose type is given in the NewSubfileType field. Multiple
IFDs can be organized either as a linked list, with the last entry in
each IFD pointing to the next IFD (the pointer in the last IFD is 0),
or as a tree, using the SubIFDs field in the primary IFD [TTN1]. The
SubIFDs field contains an array of pointers to child IFDs of the
primary IFD.
Child IFDs describe related images, such as reduced resolution
versions of the primary IFD image. The same IFD can point both to a
next IFD and to child IFDs, and child IFDs can themselves point to
other IFDs.
All fax profiles represent a multi-page fax image as a linked list of
IFDs, with a NewSubfileType field containing a bit that identifies
the IFD as one page of a multi-page document. Each IFD has a
PageNumber field, identifying the page number in ascending order,
starting at 0 for the first page. Although a Baseline TIFF reader is
not required to read any IFDs beyond the first, an implementation
that reads the files that comply with this specification SHALL read
multiple IFDs. Only the Mixed Raster Content fax profile, described
in Section 8, requires the use of child IFDs.
The following figure illustrates the structure of a multi-page TIFF
file.
+-----------------------+
| Header |------------+
+-----------------------+ | First IFD
| IFD (page 0) |<-----------+ Offset
+---| |------------+
Value | +-----------------------+ |
Offset +-->| Long Values |--+ |
+-----------------------| | Strip |
| Image Data |<-+ Offset |
| strip 1 page 0 | | |
+-----------------------+ | |
| : | : |
|
+-----------------------+ | Next IFD
| IFD (page 1) |<-----------+ Offset
+---| |------------+
Value | +-----------------------+ |
Offset +-->| Long Values |--+ |
+-----------------------| | Strip |
| Image Data |<-+ Offset |
| strip 1 page 1 | | |
+-----------------------+ | |
| strip 2 page 1 |<-+ |
+-----------------------+ | |
| : | : |
|
+-----------------------+ | Next IFD
| IFD (page 2) |<-----------+ Offset
| : |
2.1.2. Image Structure
An IFD stores an image as one or more strips, as shown in the
preceding figure. A strip consists of 1 or more scanlines (rows) of
raster image data in compressed form. An image may be stored in a
single strip or may be divided into several strips, which would
require less memory to buffer. (Baseline TIFF recommends about 8k
bytes per strip, but existing fax usage is typically one strip per
image.)
Each IFD requires three strip-related fields: StripOffsets,
RowsPerStrip, and StripByteCounts. The StripOffsets field is an
array of pointers to the strip or strips that contain the actual
image data. The StripByteCounts field gives the number of bytes in
each strip after compression. TIFF requires that each strip, except
the last, contain the same number of scanlines, which is given in the
RowsPerStrip field. This document introduces the new StripRowCounts
field that allows a variable number of scanlines per strip, which is
required by the Mixed Raster Content fax profile (Section 8).
Image data is stored as uninterpreted, compressed image data streams
within a strip. The formats of these streams follow the ITU-T
Recommendations. The Compression field in the IFD indicates the type
of compression, and other TIFF fields in the IFD describe image
attributes such as color encoding and spatial resolution.
Compression parameters are stored in the compressed data stream
rather than in TIFF fields. This makes the TIFF representation and
compressed data format specification independent of each another.
This approach, modeled on [TTN2], allows TIFF to add new compression
schemes gracefully as they become available.
Some attributes can be specified both in the compressed data stream
and within a TIFF field. It is possible that the two values will
differ. When this happens for values required to interpret the data
stream, the values in the data stream take precedence. For
informational values that are not required to interpret the data
stream, such as author name, then the TIFF field value takes
precedence.
2.1.3. TIFF File Structure for Fax Applications
The TIFF specification has a very flexible file structure that does
not specify the ordering of IFDs, field values, and image data in a
file. Individual applications may require or recommend an ordering.
This specification recommends that when using a TIFF file for
facsimile, a multi-page fax document SHOULD be represented as a
linked list of IFDs. It also recommends that a TIFF file for
facsimile SHOULD order pages in a TIFF file in the same way that they
are ordered in a fax data stream. In a TIFF file, a page consists of
several elements: one or more IFDs (including subIFDs), long field
values that are stored outside the IFDs, and image data (in one or
more strips).
The minimal black-and-white profile (Profile S) specifies a required
ordering of pages and elements within a page (Section 3.5). The
extended black-and-white profile (Profile F) provides guidelines for
ordering pages and page elements (Section 4.4.6). Other profiles
SHOULD follow these guidelines. This recommendation is intended to
simplify the implementation of TIFF writers and readers in fax
applications and the conversion between TIFF file and fax data stream
representations. However, for interchange robustness, readers SHOULD
be prepared to read TIFF files whose structure is consistent with
[TIFF], which supports a more flexible file structure than is
recommended here.
This specification introduces an optional new GlobalParametersIFD
field, defined in Section 2.2.4. This field has type IFD and
indicates parameters describing the fax session. While it is often
possible to obtain these parameters by scanning the file, it is
convenient to make them available together in one place for fast and
easy access. If the GlobalParametersIFD occurs in a TIFF file, it
SHOULD be located in the first IFD, immediately following the 8-byte
image file header.
2.2. TIFF Fields for All Fax Applications
The TIFF specification [TIFF] is organized as a baseline set and
several extensions, including technical notes [TTN1, TTN2] that will
be incorporated in the next release of TIFF. The baseline and
extensions have required and optional fields.
Facsimile applications require (and recommend) a mixture of baseline
and extensions fields, as well as some new fields that are not part
of the TIFF specification and that are defined in this document.
This sub-section lists the fields that are required or recommended
for all profiles. In particular, Section 2.2.1 lists the fields that
are required by all profiles and that have values that do not depend
on the profile. Section 2.2.2 lists the fields that are required by
all profiles and that have values that do depend on the profile.
Section 2.2.3 lists the fields that are recommended for all profiles.
Fields required or recommended by some but not all profiles are given
in the section (Section 3 - 8) that describes that profile. The
sections for each fax profile have subsections for required and
recommended fields; each subsection organizes the fields according to
whether they are baseline, extension or new.
The fields required for facsimile have only a few legal values,
specified in the ITU-T Recommendations. Of these legal values, some
are required and some are optional, just as they are required
(mandatory) or optional in fax implementations that conform to the
ITU-T Recommendations. The required and optional values are noted in
the sections on the different fax profiles.
This section describes the fields required or recommended by all fax
profiles. The pattern for the description of TIFF fields in this
document is as follows:
FieldName(TagValueInDecimal) = allowable values.
TYPE
WhetherRequiredByTIFForTIFFforFAX
Count = (omitted if =1) = (if not in current spec but available)
Explanation of the field, how it’s used, and the values it can
have. Default value, if any, as specified in [TIFF].
When a field’s default value is the desired value, that field may be
omitted from the relevant IFD unless specifically required by the
text of this specification.
2.2.1. TIFF fields required for all fax profiles
The TIFF fields listed in this section SHALL be used by all fax
profiles but have field values that are not specified by the ITU
standards, i.e., the fields do not depend on the profile. The next
subsection lists the fields that SHALL be used by all fax profiles,
but which do have values specified by the ITU-specified or profile-
specific values. Fields that SHALL be used by some but not all
profiles are given in the Sections (3 - 8) that describe the profiles
that use them.
ImageLength(257)
SHORT or LONG
RequiredByTIFFBaseline
Total number of scanlines in image.
No default, must be specified.
PageNumber(297)
SHORT
RequiredByTIFFforFAX, TIFFExtension
Count = 2
The first number represents the page number (0 for the first
page); the second number is the total number of pages in the
document. If the second value is 0, then the total page count is
not available.
No default, must be specified
RowsPerStrip(278)
SHORT or LONG
RequiredByTIFFBaseline
The number of scanlines per TIFF strip, except for the last strip.
For a single strip image, this is the same as the value of the
ImageLength field.
Default = 2**32 - 1 (meaning all scanlines in one strip).
StripByteCounts(279)
SHORT or LONG
RequiredByTIFFBaseline
Count = number of strips
For each strip, the number of bytes in that strip after
compression.
No default, must be specified.
StripOffsets(273)
SHORT or LONG
RequiredByTIFFBaseline
Count = number of strips
For each strip, the byte offset from the beginning of the file to
the start of that strip.
No default, must be specified.
2.2.2. Additional TIFF fields required for all fax profiles
The TIFF fields listed in this section SHALL be used by all fax
profiles, but the values associated with them depend on the profile
being described and the associated ITU Recommendations. Therefore,
only the fields are defined here; the values applicable to a
particular fax profile are described in Sections 3 - 8. Fields that
SHALL be used by some but not all profiles are given in the section
(3 - 8) describing the profile that uses them.
BitsPerSample(258)
SHORT
RequiredByTIFFBaseline
Number of bits per image sample.
Default = 1 (field may be omitted if this is the value).
Compression(259)
SHORT
RequiredByTIFFBaseline
Compression method used for image data.
Default = 1 (no compression, so may not be omitted for FAX).
FillOrder(266)
SHORT
RequiredByTIFFforFax
The default bit order in Baseline TIFF per [TIFF] is indicated by
FillOrder=1, where bits are not reversed before being stored.
However, TIFF for Fax typically uses the setting of FillOrder=2,
where the bit order within bytes is reversed before storage (i.e.,
bits are stored with the Least Significant Bit first).
Default = 1 (field may be omitted if this is the value)
Facsimile data appears on the phone line in bit-reversed order
relative to its description in the relevant ITU compression
Recommendation. Therefore, a wide majority of facsimile
implementations choose this natural order for storage.
Nevertheless, all readers conforming to this specification must be
able to read data in both bit orders, except in the case of
Profile S, which only requires support for FillOrder=2 (Least
Significant Bit first).
ImageWidth(256)
SHORT or LONG
RequiredByTIFFBaseline
The number of pixels (columns) per scanline (row) of the image
No default, must be specified.
NewSubFileType(254)
LONG
RequiredByTIFFforFAX
A general indication of the kind of data contained in this IFD Bit
1 is 1 if the image is a single page of a multi-page document.
Default = 0 (no subfile bits on, so may not be omitted for FAX).
PhotometricInterpretation(262)
SHORT
RequiredByTIFFBaseline
The color space of the image data.
No default, must be specified.
ResolutionUnit(296)
SHORT
RequiredByTIFFBaseline The unit of measure for resolution. 2 =
inch, 3 = centimeter; Default = 2 (field may be omitted if this is
the value)
SamplesPerPixel(277)
SHORT
RequiredByTIFFBaseline
The number of color components per pixel; SamplesPerPixel is 1 for
a black-and-white, grayscale or indexed (palette) image. Default
= 1 (field may be omitted if this is the value).
XResolution(282)
RATIONAL
RequiredByTIFFBaseline
The horizontal resolution of the image in pixels per resolution
unit. The ITU-T Recommendations for facsimile specify a small
number of horizontal resolutions: 100, 200, 300, 400 pixels per
inch, and 80, 160 pixels per centimeter (or 204, 408 pixels per
inch). The allowed XResolution values for each profile are given
in the section defining that profile. Per [T.4], it is
permissible for applications to treat the following XResolution
values as being equivalent: <204, 200> and <400,408> in
pixels/inch. These equivalencies were allowed by [T.4] to permit
conversions between inch and metric based facsimile terminals. To
ensure interoperability, if an application accepts any member of
the pairs then T.4 requires it to accept both (e.g., accept 204 if
200 pixels per inch is accepted). TIFF for Facsimile Writers
SHOULD express XResolution in inch-based units, for consistency
with historical practice and to maximize interoperability. See
the table below for information on how to convert from an ITU-T
metric value to its inch-based equivalent resolution.
No default, must be specified
YResolution(283)
RATIONAL
RequiredByTIFFBaseline
The vertical resolution of the image in pixels per resolution
unit. The ITU-T Recommendations for facsimile specify a small
number of vertical resolutions: 100, 200, 300, 400 pixels per
inch, and 38.5, 77, 154 pixels per centimeter (or 98, 196, 391
pixels per inch). The allowed YResolution values for each profile
are given in the section defining that profile. Per [T.4], it is
permissible for applications to treat the following YResolution
values as being equivalent: <98, 100>, <196, 200>, and <391, 400>
in pixels/inch. These equivalencies were allowed by [T.4] to
permit conversions between inch- and metric-based facsimile
terminals. To insure interoperability, if an application accepts
any member of the pairs, then T.4 requires it to accept both
(e.g., accept 98 if 100 pixels per inch is accepted). TIFF for
Facsimile Writers SHOULD express YResolution in inch-based units,
for consistency with historical practice and to maximize
interoperability. See the table below for information on
converting from the metric value to its inch based equivalent
resolution.
No default, must be specified.
+-----------------------------+-----------------------------+
| XResolution | YResolution |
+--------------+--------------+--------------+--------------+
|ResolutionUnit|ResolutionUnit|ResolutionUnit|ResolutionUnit|
| =2 (inch) | =3 (cm) | =2 (inch) | =3 (cm) |
+--------------+--------------+--------------+--------------+
| 100 | | 100 | |
+--------------+--------------+--------------+--------------+
| 204 | 80 | 98 | 38.5 |
| 200 | | 100 | |
+--------------+--------------+--------------+--------------+
| 204 | 80 | 196 | 77 |
| 200 | | 200 | |
+--------------+--------------+--------------+--------------+
| 204 | 80 | 391 | 154 |
+--------------+--------------+--------------+--------------+
| 300 | | 300 | |
+--------------+--------------+--------------+--------------+
| 408 | 160 | 391 | 154 |
| 400 | | 400 | |
+--------------+--------------+--------------+--------------+
2.2.3. TIFF fields recommended for all fax profiles
The TIFF fields listed in this section MAY be used by all fax
profiles. However, Profile S writers (the minimal fax profile
described in Section 3) SHOULD NOT use these fields. Recommended
fields that are profile-specific are described in Sections 3 - 8.
DateTime(306)
ASCII
OptionalInTIFFBaseline
Date/time of image creation in 24-hour format
"YYYY:MM:DD HH:MM:SS". No default.
DocumentName(269)
ASCII
OptionalInTIFFExtension(DocumentStorageAndRetrieval)
The name of the scanned document. This is a TIFF extension field,
not a Baseline TIFF field. No default.
ImageDescription(270)
ASCII
OptionalInTIFFBaseline
A string describing the contents of the image.
No default.
Orientation(274) = 1 - 8.
SHORT
OptionalinTIFFBaseline 1: 0th row represents the visual top of the
image; the 0th column represents the visual left side of the
image. See the current TIFF spec [TIFF] for further values;
Baseline TIFF only requires value=1. Default = 1.
Note: It is recommended that a writer that is aware of the
orientation include this field to give a positive indication of
the orientation, even if the value is the default. Writers should
not generate mirror images, because many readers will not properly
reverse the image before display or print.
Software(305)
ASCII
OptionalInTIFFBaseline
The name and release number of the software package that
created the image.
No default.
2.2.4. New TIFF fields recommended for fax profiles
The new TIFF fields listed in this section MAY be used by all fax
profiles. However, Profile S writes (the minimal fax profile
described in Section 3) SHOULD NOT use these fields. In addition,
support for these new TIFF fields has not been included in historical
TIFF-F readers described in Section 4 and [TIFF-F]. These fields
describe "global" parameters of the fax session that created the
image data. They are optional, not part of the current TIFF
specification, and are defined in this document.
The first new field, GlobalParametersIFD, is an IFD that contains
global parameters and is located in a Primary IFD.
GlobalParametersIFD (400) IFD or LONG
An IFD containing global parameters. It is recommended that a
TIFF writer place this field in the first IFD, where a TIFF reader
would find it quickly.
Each field in the GlobalParametersIFD is a TIFF field that is
legal in any IFD. Required baseline fields should not be located
in the GlobalParametersIFD but should be in each image IFD. If a
conflict exists between fields in the GlobalParametersIFD and in
the image IFDs, then the data in the image IFD shall prevail.
Among the GlobalParametersIFD entries is a new ProfileType field
that generally describes information in this IFD and in the TIFF
file.
ProfileType(401)
LONG
The type of image data stored in this IFD.
0 = Unspecified
1 = Group 3 fax
No default
The following new global fields are defined in this document as IFD
entries for use with fax applications.
FaxProfile(402) = 0 - 6.
BYTE
The profile that applies to this file; a profile is subset of the
full set of permitted fields and field values of TIFF for