PNG Proposed xCAL and yCAL Chunks, draft 19970203

File: png-proposed-xcal-ycal-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): xCAL (xxSC) and yCAL (yySC).

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 ycAL 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
   
   xCAL               No      Before IDAT
   yCAL               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. xCAL proposal

4.1.1. Discussion

The proposed name of the registered chunk is "xCAL". The name "xxSC" must be used in test implementations until the chunk is registered. New chunk, 16 August 1996 (Version 19960816). This chunk was formerly included in the "xySC" chunk and was called "xSCL" in the 19960914 version. The chunk name was changed in the 19961011 version because the "purpose" and "signature" fields were added. The proposed registered name for this chunk is "xCAL" (formerly the proposed registered name was "xSCL", but has been changed in the 19970203 version to "xCAL", to connote "calibration" instead of "scaling".

4.1.2. xxSC X calibration of image subject

This chunk relates the actual dimension of the image subject in the "x" (width) direction to the column position of a pixel. It provides some additional capability beyond that available in the "sCAL" [link to sCAL in PNG extensions document] chunk, which does not provide for an offset, and does not provide for different units in the width and height directions. The latter could be useful, for example, in racing photo-finish "streak" images, where one of the dimensions is time and the other is length. The chunk does not affect the image display, but could be used to construct calibrated axes adjacent to the image.

The "xxSC" chunk's contents are

n bytes:  purpose (Latin-1 text)

1 byte:   null separator

20 bytes: signature ("PNG group 1996-10-11")

1 byte:   null separator

xu bytes: Xunit (Latin-1 text).  Symbol or description of
          the width unit, eg. milliseconds, degrees West
          Longitude,  etc).  A zero-length string can be
          used if the data is dimensionless.

1 byte:   null separator

x0 bytes: Xoffset (ASCII text).  X offset, a real number
          written as a text floating-point value [link
          to Floating-Point Values in PNG extensions
          document] This is the physical value of "x"
          corresponding to the left edge of the image.

1 byte:   null separator

xs bytes: X-calibration (ASCII text). The distance
          corresponding to the width of a pixel.  Must
          be non-zero.  The positive direction is to
          the right.
There is no null separator for the final string.

The "purpose" identifies the x-calibration, which can permit applications or people to choose the appropriate one when more than one x-calibraton 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 algorithm for finding the physical x-value of the middle of a pixel is

physical_x_value := Xoffset + Xcalibration * (column_number + 0.5)
If present, the "xxSC" chunk must appear before the first "IDAT" chunk. Only one instance of the "xxSC" chunk is permitted in a PNG stream.

4.2. yCAL proposal

4.2.1. Discussion

The proposed name of the registered chunk is "yCAL". The name "yySC" must be used in test implementations until the chunk is registered. New chunk, 16 August 1996 (Version 19960816). This chunk was formerly included in the "xySC" chunk and was called "ySCL" in the 19960914 version. The chunk name was changed in the 19961011 version because the "purpose" and "signature" fields were added. the proposed registered name was "ySCL", but has been changed in the 19970203 version to "yCAL", to connote "calibration" instead of "scaling".

4.2.2. yySC Y calibration of image subject

This chunk is similar to the "xxSC" chunk. It relates the actual dimension of the image subject in the "y" (height) direction to the row position of a pixel, positive downward from the top.

The "yySC" chunk's contents are

n bytes:  purpose (Latin-1 text)

1 byte:   null separator

20 bytes: signature ("PNG group 1996-10-11")

1 byte:   null separator

yu bytes: Yunit (Latin-1 text).  Symbol or description of
          the width unit, eg. milliseconds, degrees West
          Longitude,  etc).  A zero-length string can be
          used if the data is dimensionless.

1 byte:   null separator

y0 bytes: Yoffset (ASCII text).  Y offset, a real number
          written as a text floating-point value [link
          to Floating-Point Values in PNG extensions
          document].  This is the physical value of "y"
          corresponding to the top edge of the image.

1 byte:   null separator

ys bytes: Y-calibration (ASCII text).  The distance
          corresponding to the height of a pixel.  Must
          be non-zero.  The positive direction is
          downward.
There is no trailing zero for the final string.

The "purpose" identifies the x-calibration, which can permit applications or people to choose the appropriate one when more than one x-calibration 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 algorithm for finding the physical y-value of the middle of a pixel is

physical_y_value := Yoffset + Ycalibration * (row_number + 0.5)
If present, the "yySC" chunk must appear before the first "IDAT" chunk. Only one instance of the "yySC" chunk is permitted in a PNG stream.

Contributors

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

Editor

End of PNG xCAL and yCAL Chunks Proposal. Expires 03 Aug 1997.