TIFF 6.0 Specification
Final—June 3, 1992
Comments
Associated alpha data is just another component added to each pixel. Thus, for
example, its size is defined by the value of the BitsPerSample field.
Note that since data is stored with RGB components already multiplied by alpha,
naive applications that want to display an RGBA image on a display can do so
simply by displaying the RGB component values. This works because it is effec-
tively the same as merging the image with a black background. That is, to merge
one image with another, the color of resultant pixels are calculated as:
C
r
= C
over
* A
over
+ C
under
* (1–A
over
)
Since the “under image” is a black background, this equation reduces to
C
r
= C
over
* A
over
which is exactly the pre-multiplied color; i.e. what is stored in the image.
On the other hand, to print an RGBA image, one must composite the image over a
suitable background page color. For a white background, this is easily done by
adding 1 - A to each color component. For an arbitrary background color
C
back
, the
printed color
of each pixel is
C
print
= C
image
+ C
back
* (1–A
image
)
(since
C
image
is pre-multiplied).
Since the ExtraSamples field is independent of other fields, this scheme permits
alpha information to be stored in whatever organization is appropriate. In particu-
lar, components can be stored packed (PlanarConfiguration=1); this is important
for good I/O performance and for good memory access performance on machines
that are sensitive to data locality. However, if this scheme is used, TIFF readers
must not derive the SamplesPerPixel from the value of the
PhotometricInterpretation field (e.g., if RGB, then SamplesPerPixel is 3).
In addition to being independent of data storage-related fields, the field is also
independent of the PhotometricInterpretation field. This means, for example, that
it is easy to use this field to specify grayscale data and associated matte informa-
tion. Note that a palette-color image with associated alpha will not have the
colormap indices pre-multiplied; rather, the RGB colormap values will be pre-
multiplied.
Unassociated Alpha and Transparency Masks
Some image manipulation applications support notions of transparency masks
and soft-edge masks. The associated alpha information described in this section is
different from this
unassociated alpha
information in many ways, most impor-
tantly:
• Associated alpha describes opacity or coverage at each pixel, while clipping-
related alpha information describes a boolean relationship. That is, associated
alpha can specify fractional coverage at a pixel, while masks specify either 0 or
100 percent coverage.
• Once defined, associated alpha is not intended to be removed or edited, except
as a result of compositing the image; it is an integral part of an image.
78