PNG Proposed fALS chunk, draft 19970203

File: png-proposed-fals-chunk-19970203.txt

Status of this Memo

This document is an informal draft of the PNG development group.

Comments on this document can be sent to the PNG specification maintainers at

png-info@uunet.uu.net
or at
png-list@dworkin.wustl.edu.

Distribution of this memo is unlimited.

At present, the latest version of this document is available on the World Wide Web from

ftp://swrinde.nde.swri.edu/pub/png-group/documents/.

Notices

Copyright © 1997 Thomas Boutell

Permission is granted to copy and distribute this document for any purpose and without charge, provided that the copyright notice and this notice are preserved, and that any substantive changes or deletions from the original are clearly marked.

Abstract

This document describes some special-purpose chunk types that have been proposed for use in various PNG (Portable Network Graphics) and related multi-image applications. They have not yet been approved for registration by the PNG developers, and therefore are experimental and their format is subject to change. The proposed chunks are (with unregistered names that can be used in test implementations shown in parentheses): fALS (faLT).

Table of Contents

1. Introduction

Chunks described here have been proposed to the PNG development group for use by the scientific visualization community. Their definitions are subject to change until such time as the group formally registers them. No decoder is required or expected to implement these chunks except for experimental or evaluation purposes. Comments on these proposals, and new proposals for additional chunk types, should be sent to the PNG specification maintainers at
png-info@uunet.uu.net.
The basic PNG specification is available from the W3C archive at
http://www.w3.org/pub/WWW/TR/WD-png.

2. Using Proposed PNG Sci-Vis Chunks

No chunks described in this document have yet been registered by the PNG maintainers. Therefore they have a lower-case letter in the second position of the chunkname, and in some cases the name is different from the proposed registered chunk name. They are experimental chunks and the format is subject to change. If and when any become registered, the chunk name will be changed to its final form. The second letter of the chunk name will become uppercase. The "signature" field and it zero-byte separator will be deleted. There will be no further change to the format.

Whenever you use any of these unregistered chunks you should also include a "tEXt" chunk describing it, for example:

tEXtComment\0
This file contains a faLT chunk written according to the
format given in Version 19970203 of the PNG Proposed Chunks
document.
For those proposed chunks that have a "signature" field, decoders should check to ensure that the signature field is present and that its contents exactly match the specified string.

3. Summary of Proposed Sci-Vis Chunks

This table summarizes some properties of the proposed chunks described in this document.
   Proposed        Multiple   Ordering
   chunk name         OK?     constraints
   
   fALS               No      Before IDAT

4. Proposed PNG Sci-Vis Chunk Specifications

This section provides the detailed specifications for the proposed chunks. Each of the following subsections includes a discussion paragraph that will not form a part of the final specification, and a specification paragraph that describes the proposed chunk in its unregistered form.

4.1. fALS proposal

4.1.1. Discussion

The proposed name of the registered chunk is "fALS". The name "faLT" must be used in test implementations until the chunk is registered. The format last changed in version 19961027 of this document (October 1996). The name has been changed from "faLS" to "faLT" to distinguish the versions. The "signature" field and its null separator will not be included in the registered chunk.

4.1.2. faLT False-color palette

This chunk is used with grayscale data, where the pixels are to be rendered in a false color according to the grayscale value. The grayscale sample of each pixel serves as a pointer into the false-color palette.

This chunk's contents are a text string (purpose) that names the palette, followed by a null separator, [a 20-byte signature and a null-byte separator] a gamma field, and a series of false-color palette entries:

   n bytes:  purpose (Latin-1 text)
   
   1 byte:   null separator
   
   20 bytes: signature ("PNG group 1996-10-27")
   
   1 byte:   null separator
   
   4 bytes:  gamma (unsigned integer), file_gamma
             times 100000
   
   2 bytes:  index (unsigned integer),  range
             [0 .. (2^sample_depth) -1)]
   
   2 bytes:  red   (unsigned integer) range [0 .. 65535]
   2 bytes:  green (unsigned integer) range [0 .. 65535]
   2 bytes:  blue  (unsigned integer) range [0 .. 65535]
   
   etc.
The number of entries is determined from the remaining chunk length after the gamma field. This length not divisible by 8 is an error.

The "purpose" identifies the palette, which can permit applications or people to choose the appropriate one when more than one false-color palette is stored in a multiple-image file. The "purpose" string must follow the format of a "tEXt" keyword, i.e. 1-79 printable Latin-1 characters.

The gamma field gives the value of "file_gamma", times 100000, that is associated with the false-color palette samples.

This chunk can appear for color type 0 or color type 4. If it appears for any other color type, it will be ignored.

The complete 2^sample_depth-entry false-color palette can be built from the chunk data. If the first entry (index value 0) is missing, it will be assumed to be {0, 0, 0} (black). If the last entry (index value 2^sample_depth - 1) is missing, it will be assumed to be {65535, 65535, 65535} (white). The red, green, blue samples for other missing entries are filled in by linearly interpolating between the samples that are present, independently for each of the three color components.

Once the complete false-color palette is established, it is used similarly to PLTE. The first entry in the completed false-color palette is referenced by the grayscale value 0, the second by grayscale value 1, etc.

If the "tRNS" chunk is present, its value is compared to the graylevel, not to the converted false-color of the pixels. If the "bKGD" chunk is present, background pixels will be displayed in the false-color corresponding to the grayscale value found in the "bKGD" chunk. The "cHRM" and alpha conversions, if present, are applied to the color samples in the converted false-color pixels. The "gAMA" chunk is ignored when the "faLT" chunk is processed, and the supplied "file_gamma" value is used instead.

Note that the "gAMA" and other values must be selected so that the grayscale image is meaningfully displayed when the "faLT" chunk is unrecognized or ignored.

If this chunk does appear, it must precede the first "IDAT" chunk. There can be only one "faLT" chunk in a PNG datastream.

Contributors

Names of contributors not already listed in the PNG specification are presented in alphabetical order:

Editor

End of PNG fALS Chunk Proposal. Expires 03 Aug 1997.