{"id":"image-jxl","mimeType":"image/jxl","name":"JPEG XL","shortName":"JXL","category":"Web \u0026 Photography","extensions":[".jxl"],"description":"JPEG XL is a modern, royalty-free raster image format designed to outperform and eventually replace legacy formats like JPEG, PNG, and GIF. It offers phenomenal lossless and lossy compression, high dynamic range (HDR) support, progressive decoding, and the unique ability to losslessly recompress existing JPEG files by ~20%.","seo":{"title":"image/jxl MIME Type | Complete Developer Reference \u0026 Magic Bytes","description":"Complete reference for the image/jxl MIME type: magic bytes, browser support matrix, HTTP headers, developer snippets, and technical specifications for JPEG XL.","faqs":[{"question":"What is the magic byte for JPEG XL?","answer":"JPEG XL files can exist as raw codestreams or within an ISOBMFF-based container. Raw codestreams begin with FF 0A. Containerized JXL files begin with a 12-byte signature: 00 00 00 0C 4A 58 4C 20 0D 0A 87 0A (which includes the string 'JXL ')."},{"question":"Can JPEG XL really compress existing JPEGs losslessly?","answer":"Yes! One of JXL's most unique features is its ability to take an existing legacy JPEG and recompress it losslessly into a JXL file, typically saving about 20% in file size. The exact original JPEG can be fully restored byte-for-byte from the JXL file."},{"question":"Do web browsers support JPEG XL?","answer":"Support is mixed. Apple added full native support for JPEG XL in Safari 17 (iOS 17 and macOS Sonoma). However, Google controversially removed experimental support from Chrome in early 2023, and Mozilla Firefox currently keeps it hidden behind a developer flag."}]},"index":{"compression":["Lossy (VarDCT)","Lossless (Modular)"],"browserSupport":{"score":3,"label":"Partial (Safari Only / Flags)"},"commonUses":["High-End Web Delivery (via Safari/Polyfills)","HDR Photography","Legacy JPEG Archiving","Digital Art \u0026 Image Storage"]},"technical":{"magicBytes":{"hex":"FF 0A (Codestream) / 00 00 00 0C 4A 58 4C 20 0D 0A 87 0A (Container)","ascii":"ÿ\n / ....JXL ....\n"},"container":"ISOBMFF / JPEG XL Codestream","compressionAlgorithm":["VarDCT (Variable block-size DCT)","Modular (Predictive coding for lossless)"],"colorDepth":["8-bit","10-bit","12-bit","16-bit","32-bit (Float)"],"transparency":true,"animation":true,"metadata":{"exif":true,"xmp":true,"iccProfile":true},"alphaChannel":true,"progressiveLoading":true,"hdrSupport":true},"history":{"developer":"Joint Photographic Experts Group (JPEG)","released":"2021","specification":"ISO/IEC 18181"},"browserSupport":{"chrome":false,"chromeVersion":"Removed (was behind flag)","firefox":false,"firefoxVersion":"Behind Flag","safari":true,"safariVersion":"17+","edge":false,"edgeVersion":"None","internetExplorer":false},"softwareSupport":[{"name":"ImageMagick","logo":"image-magic.webp"},{"name":"Affinity Photo","logo":""},{"name":"Adobe Camera Raw / Lightroom","logo":""},{"name":"Krita","logo":""},{"name":"GIMP","logo":"gimp.svg"}],"conversion":{"convertTo":["jpeg","png","avif","webp"],"convertFrom":["jpeg","png","tiff"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/jxl"}],"htmlAccept":"image/jxl, .jxl","fileDetection":["Check the first two bytes for 'FF 0A' to identify a raw codestream","Check the first 12 bytes for the container signature: 00 00 00 0C 4A 58 4C 20 0D 0A 87 0A"]},"prosCons":{"pros":["Capable of losslessly recompressing legacy JPEG files, saving ~20% space while retaining perfect byte-for-byte restorability","Highly superior progressive decoding (Saliency-driven), allowing recognizable images to load extremely fast on slow connections","Outperforms WebP and competes favorably with AVIF, especially at high-fidelity settings and for complex textures/photography","Royalty-free with an open-source reference implementation (libjxl)"],"cons":["Google's removal of JXL support from Chrome severely hindered its adoption as a universal web standard","Lack of hardware decoding chips compared to video-derived codecs like AVIF (AV1)","File parsing logic is complex due to the split between raw codestreams and ISOBMFF containers"]},"specifications":{"url":"https://jpeg.org/jpegxl/","rfc":"","mimeAliases":[]},"developerSnippets":{"python":"import magic\nprint(magic.from_file('photo.jxl', mime=True)) # Outputs 'image/jxl' with updated magic database","nodejs":"const FileType = require('file-type');\nconst type = await FileType.fromFile('photo.jxl');\nconsole.log(type.mime); // image/jxl","go":"import \"net/http\"\n// Requires custom byte matching for FF 0A or the 12-byte JXL container box.","php":"$mime = mime_content_type('photo.jxl');\necho $mime; // image/jxl (if magic.mime is up to date)"},"relatedFormats":["jpeg","avif","webp","png"]}
