{"id":"image-hej2k","mimeType":"image/hej2k","name":"JPEG 2000 Image (HEIF Container)","shortName":"HEJ2K","category":"Professional \u0026 Archival","extensions":[".hej2"],"description":"HEJ2K (High Efficiency JPEG 2000) is a format that stores still images encoded with the JPEG 2000 codec (including HTJ2K) inside a High Efficiency Image File Format (HEIF) container. It combines the powerful wavelet-based compression of JPEG 2000 with the flexible, metadata-rich architecture of the ISOBMFF standard.","seo":{"title":"image/hej2k MIME Type | Complete Developer Reference \u0026 Magic Bytes","description":"Complete reference for the image/hej2k MIME type: magic bytes, browser support matrix, HTTP headers, developer snippets, and technical specifications for HEJ2K.","faqs":[{"question":"What is the difference between image/jp2 and image/hej2k?","answer":"While both formats encode image data using the JPEG 2000 standard, image/jp2 uses the traditional JP2 file format. In contrast, image/hej2k encapsulates the JPEG 2000 codestream within the modern HEIF (ISOBMFF) container, allowing for richer metadata, auxiliary image items, and depth maps."},{"question":"What is the magic byte for HEJ2K?","answer":"Like other HEIF files, HEJ2K uses the ISOBMFF structure. It begins with a 4-byte box size, followed by the 'ftyp' identifier and the brand 'j2ki'. In hex, this is commonly XX XX XX XX 66 74 79 70 6A 32 6B 69 (....ftypj2ki)."},{"question":"Are HEJ2K images supported in web browsers?","answer":"No. There is no native web browser support for JPEG 2000 images encapsulated in HEIF containers. These files are typically used in specialized archival, medical, or geospatial workflows."}]},"index":{"compression":["Lossy","Lossless"],"browserSupport":{"score":1,"label":"None"},"commonUses":["Medical Imaging","Geospatial Data","Scientific Archiving"]},"technical":{"magicBytes":{"hex":"XX XX XX XX 66 74 79 70 6A 32 6B 69","ascii":"....ftypj2ki"},"container":"HEIF / ISOBMFF (ISO/IEC 15444-16)","compressionAlgorithm":["JPEG 2000","HTJ2K"],"colorDepth":["8-bit","10-bit","12-bit","16-bit"],"transparency":true,"animation":false,"metadata":{"exif":true,"xmp":true,"iccProfile":true},"alphaChannel":true,"progressiveLoading":true,"hdrSupport":true},"history":{"developer":"ISO/IEC JTC 1 / ITU-T","released":"2019","specification":"ISO/IEC 15444-16 (JPEG 2000 Part 16)"},"browserSupport":{"chrome":false,"chromeVersion":"None","firefox":false,"firefoxVersion":"None","safari":false,"safariVersion":"None","edge":false,"edgeVersion":"None","internetExplorer":false},"softwareSupport":[{"name":"Kakadu Software","logo":""},{"name":"OpenJPEG","logo":""},{"name":"Grok","logo":""}],"conversion":{"convertTo":["jp2","jpeg","png","heic"],"convertFrom":["jp2","j2k","jpeg","tiff"]},"developer":{"httpHeaders":[{"header":"Content-Type","value":"image/hej2k"}],"htmlAccept":"image/hej2k, .hej2","fileDetection":["Check for ISOBMFF 'ftyp' box starting at byte offset 4","Verify 'j2ki' brand string starting at byte offset 8 to confirm HEIF encapsulation of JPEG 2000"]},"prosCons":{"pros":["Brings the extensive capabilities of the HEIF container (like EXIF/XMP, thumbnails, and depth maps) to JPEG 2000","Supports mathematically lossless compression via wavelet transformation","High scalability and progressive decoding out of the box"],"cons":["Extremely limited software support outside of niche industries","Zero native compatibility with web browsers","High computational complexity compared to simpler formats like JPEG or PNG"]},"specifications":{"url":"https://ds.jpeg.org/","rfc":"","mimeAliases":["image/heif"]},"developerSnippets":{"python":"import magic\nprint(magic.from_file('image.hej2', mime=True)) # May output generic 'image/heif' based on system libraries","nodejs":"const FileType = require('file-type');\nconst type = await FileType.fromFile('image.hej2');\nconsole.log(type?.mime); // Standard libraries may fall back to image/heif without specific j2ki definitions","go":"import \"net/http\"\n// Custom ISOBMFF parsing is required to read the 'j2ki' brand inside the ftyp box.","php":"$mime = mime_content_type('image.hej2');\necho $mime; // application/octet-stream or image/heif"},"relatedFormats":["heif","j2c"]}
