File: mng-play-proposal-20070903 It is proposed to register an playlist MNG chunk: PLAY. In this proposal, the new chunk name is shown in its private form (second letter lowercase, PlAY). Until the proposal is approved, the private form must be used in any test implementations. It is proposed to document the PLAY chunk in the MNG 1.0 Specification, Version 1.0.1, as follows: A. Change document version to 1.0.1. B. Add paragraph 4.3.6 4.3.6. PlAY Playlist Chunk 4.3.6.1 Overview The PlAY chunk contains a compressed "play list" which provides instructions to the decoder for constructing animation frames from pieces of previously defined objects. 4.3.6.2 Terminology The "frame" is the MNG frame where the layers are are to be written. The "layer" is a pixel array with dimensions specified by the "layer_width" and "layer_height" parameters of the PlAY chunk. Conceptually, each tile is constructed in a layer and passed back to the MNG viewer. A "tile" is a pixel array copied from an object and used to construct a layer. 4.3.6.3 PlAY Chunk structure The PlAY chunk contains a 13-byte header followed by one or more 23-byte tile structures. The header gives the width and height of the layers and the compression method: byte 0 frame_width (unsigned int) Width of frames 4 frame_height (unsigned int) Height of frames 8 compression_method (byte) 0: deflate 9 tile_structure_array[n] (n > 0; n * 23 bytes): tile (compressed) structures Each layer is a tile combined with a transparent background to form a layer of size (layer_width, layer_height). Each layer is initialized to a transparent (RGBA(0,0,0,0)) rectangle of dimensions layer_width by layer_height. The tile structure array is always compressed according to the specified compression method. A tile is a structure of 23 bytes: byte 0 object (unsigned int) Object ID of source image 2 x (unsigned int) Left of tile pixels 6 y (unsigned int) Top of tile pixels 10 width (unsigned int) Width of tile pixels 14 height (unsigned int) Height of tile pixels 18 x_offset (signed int) X offset of tile destination 22 y_offset (signed int) Y offset of tile destination The tile data identifies a rectangle (x,y,width,height) in the object containing pixels of the tile. This rectangle is composited on the layer at top left position (x_offset, y_offset). Any part of the tile outside the object must be treated as transparent. Any part of the tile which extends outside the layer must be ignored. The tile width or height may be zero, in which case the tile contains no pixels. 4.3.6.4 Delays The decoder should handle the layers as specified in the MNG FRAM chunk. Even if a layer's tile is entirely outside the frame, the delay for the resulting empty layer is handled in the same way as if it were inside the frame. 4.3.6.5 PlAY recommendations for encoders Tall vs wide layouts Typically the best compression is obtained when a PNG image is very wide and not very tall, with similar frames adjacent; however, tthis layout makes it necessary for the viewer to decode the entire PNG image before it can display even the first frame. If the PNG image is taller and less wide, and earlier frames appear closer to the top, it becomes more possible for the viewer to display while it decodes, but the compression is likely to suffer. C. Add to the Appendix: Revision History * 30 Sept 2007 (version 1.0.1): * Added the PlAY animation chunk.