File: mng-play-proposal-20070904 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 layers 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 "frame_width" and "frame_height" parameters of the MHDR 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 1-byte header followed by one or more 26-byte tile structures. The header gives the compression method: byte 0 compression_method (byte) 0: deflate 1 tile_structure_array[n] (n > 0; n * 26 bytes): tile (compressed) structures Each layer is a tile combined with a transparent background to form a layer of size (frame_width, frame_height), from the MHDR chunk. Each layer is initialized to a transparent (RGBA(0,0,0,0)) rectangle of dimensions frame_width by frame_height. The tile structure array is always compressed according to the specified compression method. A tile is a structure of 26 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 all transparent pixels. 4.3.6.4 Delays The decoder must handle the layers as specified in the MNG FRAM chunk. This might or might not involve inserting background layers between them. 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 tiles adjacent. C. Add to the Appendix: Revision History * 30 Sept 2007 (version 1.0.1): * Added the PlAY animation chunk.