Proposed Extension

The key reason why we want to extend an existing image format is that we feel little inclination to re-invent the wheel. There are basic design and implementation issues connected with the definition of an entirely new image format, that do not pertain to our topic of interest at all. Also, for TIFF an excellent public domain library exists that can serve as a code basis for extension. The mechanisms of the TIFF library already cover all the (for our purpose) uninteresting groundwork like e.g. storing image attributes and raw data in the correct byte order.

What we need is an extension that enables us to store spectral data in TIFF images in a meaningful way. This task is split into three parts:

  1. Defining a new image type: defining a new value for the PhotometricInterpretation tag (and hence a new image type) called Spectral.
  2. Modifications to the image header: we have to store information about the representation and structure of the spectral samples that make up the data.
  3. Storing the actual spectral image data: storage and retrieval of image data can be done using generic TIFF read/write routines if the SamplesPerPixel and BytesPerSample tags are set correctly, since the actual values of the spectral representations will be arrays of integers or floating point numbers, for which provisions already exist.
Items 1 and 3 require little and no work, respectively. Item 2 alone requires some further consideration. It has to be noted that the tag mechanisms of TIFF allow us to specify all of the following constructs in a way that is consistent with the rest of the format.

Pixel spectrum representation

We define a representation of a spectrum S to be a set of n coefficients (of either integer or floating point type) Si of specified basis functions. The choice of coefficient type (int or float) depends on the needs of the user. The weighted sum of these basis functions reconstructs the spectrum for a pixel.

The basis functions are the same for each pixel in the image, and they are specified once in the image header. This approach lets us store pixel spectra as sets of float or integer values, for which the normal image storage mechanisms (with n coefficients instead of 3 RGB samples per pixel) can be utilised.

Basis Functions

For each of the n samples Si in a pixel spectrum, the image header defines a basis function Bi that determines its contribution to the overall pixel spectrum. We propose that these functions be piecewise linear (with possible extensions to higher orders in later revisions of the format).

Why the restriction to linear functions? It is desirable that addition and inner product of the basis functions should be computable exactly; this suggests piecewise polynomial functions as bases. However, the complexity (both programmatic and and with respect to execution time) of these operations rises significantly for the non-linear cases. In conjunction with the fact that one can specify even complicated bases reasonably well with a suitably densely sampled linear function (which only has to be stored once in the image header), keeping implementations of the extension simple and efficient weighed more heavily for us than the potential loss of accuracy.

The shape of the basis functions depends entirely on the application at hand; for results of digital image synthesis, usually the simple case of mutually exclusive box basis functions is a good choice, since spectral renderers tend to work with sets of n spectral bands as "colour representation".

Reconstruction

When decoding the image, the spectrum of each sample is determined by adding all the n basis functions together, weighted by the n spectral samples that are stored for each pixel. The result of this process has then to be converted to the spectral representation of the application that reads the image, which may involve re-sampling.

Premultiplication

In order to increase the dynamic range of the format, it may be desirable to add a premultiplication factor to each pixel. This amounts to one additional channel, for which no basis function is stored; the encoding can either be linear or logarithmic. The premultiplication factor is stored one additional sample at the beginning of each set of coefficients.

Compression

Another bonus of using existing TIFF mechanisms is that all in-built lossless compression mechanisms (e.g. LZW compression) are directly available for the n-coefficient pixel values. Lossy compression techniques like JPEG may introduce artifacts that influence the resulting visual output of image data in ways which remain to be understood; we refrain from using them at the moment.

Back to the Spectral TIFF main page.


This page is maintained by Alexander Wilkie. It was last updated on February 7, 1999.
If you have any comments, please send a message to wilkie@cg.tuwien.ac.at.