{"id":"image-x-jng","mimeType":"image/x-jng","name":"JPEG Network Graphics","shortName":"JNG","category":"Legacy \u0026 Web Graphics","extensions":[".jng"],"description":"The image/x-jng MIME type represents the JPEG Network Graphics (JNG) format. Created by the developers of the PNG format in 2001, JNG was designed as a sub-format of Multiple-image Network Graphics (MNG). It essentially combines the lossy compression of standard JPEG with the chunk-based file structure and 8-bit alpha channel transparency of PNG. This allowed for highly compressed photographic images with smooth transparency—a feature JPEG notoriously lacks. Despite its technical merits, it failed to gain widespread adoption, as modern browsers dropped MNG/JNG support in the early 2000s, and formats like WebP and AVIF have since solved the \"lossy with alpha\" problem more efficiently.","seo":{"title":"image/x-jng MIME Type | Developer Reference for JNG Format","description":"Complete reference for the image/x-jng MIME type: JPEG Network Graphics (JNG), PNG chunk structure, JPEG alpha transparency, and legacy MNG integration.","faqs":[{"question":"What is a JNG file?","answer":"A JNG (JPEG Network Graphics) file is an image format that stores photographic image data using JPEG compression, but encapsulates it within a PNG-like chunk structure to allow for an 8-bit alpha channel (transparency)."},{"question":"What is the difference between JNG and standard JPEG?","answer":"Standard JPEGs do not support transparency. JNG solved this by storing the color data as a compressed JPEG stream (JDAT chunk) and storing the transparency mask as a separate, lossless PNG stream (IDAT chunk) within the same file."},{"question":"Do web browsers support JNG images?","answer":"No. While Mozilla briefly supported MNG and JNG in the early 2000s, support was removed in 2003 to reduce code bloat. Today, WebP, AVIF, and JPEG XL have completely replaced JNG's use case for web imagery."}]},"index":{"compression":["Lossy (JPEG/DCT for color)","Lossless (Deflate for alpha mask)"],"browserSupport":{"score":1,"label":"None"},"commonUses":["Embedded frames in MNG animations","Historical web graphics requiring lossy compression with transparency"]},"technical":{"magicBytes":{"hex":"8B 4A 4E 47 0D 0A 1A 0A","ascii":"\\x8BJNG\\r\\n\\x1A\\n"},"container":"PNG-style Chunk Structure (JHDR, JDAT, IDAT, IEND)","compressionAlgorithm":["JPEG (Discrete Cosine Transform)","Deflate (LZ77)"],"colorDepth":["8-bit","12-bit","24-bit (RGB)","32-bit (RGBA)"],"transparency":true,"animation":false,"metadata":{"exif":true,"xmp":true,"iccProfile":true},"alphaChannel":true,"progressiveLoading":true,"hdrSupport":false},"history":{"developer":"MNG Development Group (Glenn Randers-Pehrson et al.)","released":"2001","specification":"JNG 1.0 Specification"},"browserSupport":{"chrome":false,"chromeVersion":"None","firefox":false,"firefoxVersion":"None","safari":false,"safariVersion":"None","edge":false,"edgeVersion":"None","internetExplorer":false},"softwareSupport":[{"name":"ImageMagick","logo":"image-magic.webp"},{"name":"XnView","logo":""},{"name":"IrfanView","logo":""}],"conversion":{"convertTo":["png","webp","jpeg","avif"],"convertFrom":["png","jpeg","webp"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/x-jng"}],"htmlAccept":"image/x-jng, .jng","fileDetection":["JNG files use an 8-byte signature that intentionally mirrors the PNG specification.","Check the first 8 bytes for: 8B 4A 4E 47 0D 0A 1A 0A (Hex).","Notice it matches the PNG signature (89 50 4E 47...), but the first byte is 0x8B and the text characters are 'JNG' instead of 'PNG'."]},"prosCons":{"pros":["Solved a massive technical hurdle in the early 2000s by combining high-compression lossy photographic data with crisp, 8-bit alpha transparency","Utilized the highly robust, extensible chunk-based architecture of the PNG format","Provided an excellent, bandwidth-saving alternative to massive 32-bit transparent PNGs for web design"],"cons":["Failed to achieve critical mass; browser vendors largely abandoned the MNG/JNG standard due to implementation complexity","Completely obsolete today, having been superseded by natively supported, superior formats like WebP, AVIF, and HEIC","Decoding requires a hybrid engine that can parse PNG chunks while simultaneously decoding a JPEG stream and a Deflate stream, complicating software support"]},"specifications":{"url":"http://www.libpng.org/pub/mng/spec/jng.html","rfc":"","mimeAliases":["image/jng"]},"developerSnippets":{"python":"import magic\n# Libmagic natively detects the JNG magic bytes\nprint(magic.from_file('image.jng', mime=True)) # Outputs 'image/x-jng'","nodejs":"const fs = require('fs');\n// Manually detecting the JNG 8-byte signature\nconst buffer = Buffer.alloc(8);\nconst fd = fs.openSync('image.jng', 'r');\nfs.readSync(fd, buffer, 0, 8, 0);\nfs.closeSync(fd);\nconst isJNG = buffer[0] === 0x8B \u0026\u0026 buffer[1] === 0x4A \u0026\u0026 buffer[2] === 0x4E \u0026\u0026 buffer[3] === 0x47;\nconsole.log('Is JPEG Network Graphics:', isJNG);","go":"import (\n    \"bytes\"\n    \"net/http\"\n)\n// Native Go HTTP detection does not recognize JNG. \n// You must explicitly check the signature:\n// isJNG := bytes.HasPrefix(buf, []byte{0x8B, 0x4A, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A})","php":"$mime = mime_content_type('image.jng');\necho $mime; // Standard setups will often resolve this correctly to 'image/x-jng' via the system magic file"},"relatedFormats":["png","jpeg","webp"]}
