
Image by Pixelkult on Pixabay · Pixabay License
Described at
JNG 1.0
libpng.org →In the case of any discrepancy between this extract and the full MNG specification, the full MNG specification shall take precedence. This document presents the format of a JNG (JPEG Network Graphics) datastream. JNG is a lossy single-image member of the PNG (Portable Network Graphics) format family. It encapsulates a JPEG datastream in PNG-style chunks, along with an optional alpha channel and ancillary chunks that carry color-space information and comments. While JNG is primarily intended as a subformat of the MNG (Multiple-image Network Graphics) format, standalone JNG files are also possible. JNG (JPEG Network Graphics) is the lossy sub-format for MNG [MNG ] objects. Note: This specification depends on the PNG Portable Network Graphics specification [PNG ]. The PNG specification is available at the PNG home page, A JNG datastream consists of a header chunk (JHDR), JDAT chunks that contain a complete JPEG datastream, optional IDAT chunks that contain a PNG-encoded grayscale image that is to be used as an alpha mask, and an IEND chunk. The alpha mask, if present, must have the same dimensions as the image itself. The JDAT and IDAT chunks can be interleaved. Some of the PNG ancillary chunks are also recognized in JNG datastreams. We may at some future time register an Internet Media Type for JNG files. Until then, the interim media type image/x-jng can be used. It is recommended that the file extension ".jng" (lower case preferred) be used. This section specifies the critical chunks that are defined in the JNG format. The format of the JHDR chunk introduces a JNG datastream. It contains: Image sample depth: 1 byte 8: 8-bit samples and quantization tables. 12: 12-bit samples and quantization tables. 20: 8-bit image followed by a 12-bit image. Image interlace method: 1 byte. 0: Sequential JPEG, single scan. 8: Progressive JPEG. Alpha compression method: 1 byte. 0: PNG grayscale IDAT format. 8: JNG 8-bit grayscale JDAA format. Alpha filter method: 1 byte. 0: Adaptive PNG (see PNG spec) or not applicable (JPEG). Alpha interlace method: 1 byte. 0: Noninterlaced PNG or sequential single-scan JPEG. The width, height, image sample depth, image compression method, and image interlace method fields are redundant because equivalent information is also embedded in the JDAT datastream. They appear in the JHDR chunk for convenience. Their values must be identical to their equivalents embedded in the JDAT chunk. We use four bytes in the width and height fields for similarity to MNG and PNG, and to leave room for future expansion, even though two bytes would have been sufficient. When the color type is 8 or 10 (no alpha channel), the last four bytes, which describe the IDAT or JDAA data, must be set to zero. The alpha sample depth must be nonzero when the alpha channel is present. A JNG datastream must contain one or more JDAT chunks, whose data, when concatenated, forms a complete JNG JPEG datastream. JNG decoders are required to read all baseline JNG JPEG and eight-bit progressive JNG JPEG datastreams. Twelve-bit capability is not required. JDAT chunks are like PNG IDAT chunks in that there may be multiple JDAT chunks, the data from which are concatenated to form a single datastream that can be sent to the decompressor. No chunks are permitted among the sequence of JDAT chunks, except for interleaved IDAT chunks. The ordering requirements of other ancillary chunks are the same with respect to JDAT as they are in PNG with respect to the IDAT chunk. Actually, a JNG may contain two separate JNG JPEG datastreams (one eight-bit and one twelve-bit), each contained in a series of JDAT chunks, and separated by a JSEP chunk (see the JSEP chunk specification below, Paragraph 1.1.5 ). Decoders that are unable to (or do not wish to) handle twelve-bit datastreams are allowed to display the eight-bit datastream instead, if one is present. The core of the JNG JPEG definition is baseline JNG JPEG, which is JPEG Part 1's definition of bas
Excerpt from a page describing this subject · 24,385 chars · not written by Vinony
Wikidata facts
Show 4 more facts
- file extension
- jng
- described at URL
- www.libpng.org/pub/mng/spec/jng.html
- media type
- image/jng
- file format identification pattern
- 8B4A4E470D0A1A0A
Sources (3)
via Wikidata · CC0