Free webp to jpg
HEJ2K

JPEG 2000 Image (HEIF Container)

image/hej2k Released 2019 · by ISO/IEC JTC 1 / ITU-T

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.

Professional & Archival Transparency Progressive ✦ HDR Production Ready

Technical Specifications

MIME Type
image/hej2k
Extensions
.hej2
Container
HEIF / ISOBMFF (ISO/IEC 15444-16)
Compression
Lossy & Lossless
Algorithms
JPEG 2000HTJ2K
Color Depth
8-bit, 10-bit, 12-bit, 16-bit
Metadata
EXIF XMP ICC
Capabilities
Transparency
Animation
Progressive Loading
Alpha Channel
HDR Support
Official Specification
Aliases: image/heif

Magic Bytes & HTTP Headers

File Signature (Magic Bytes)
XX XX XX XX 66 74 79 70 6A 32 6B 69
ASCII: ....ftypj2ki
HTTP Headers
Content-Type: image/hej2k
HTML Accept Attribute
accept="image/hej2k, .hej2"

Browser Support Matrix

Browser Status Min Version
Chrome Chrome
Not Supported
Firefox Firefox
Not Supported
Safari Safari
Not Supported
Edge Edge
Not Supported
Internet Explorer Internet Explorer
Not Supported Legacy

Advantages & Limitations

Advantages
  • 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
Limitations
  • 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

Developer Code Snippets

import magic
print(magic.from_file('image.hej2', mime=True)) # May output generic 'image/heif' based on system libraries
const FileType = require('file-type');
const type = await FileType.fromFile('image.hej2');
console.log(type?.mime); // Standard libraries may fall back to image/heif without specific j2ki definitions
import "net/http"
// Custom ISOBMFF parsing is required to read the 'j2ki' brand inside the ftyp box.
$mime = mime_content_type('image.hej2');
echo $mime; // application/octet-stream or image/heif

File Detection Steps

How to programmatically detect a image/hej2k file by reading its raw bytes:

  1. 1 Check for ISOBMFF 'ftyp' box starting at byte offset 4
  2. 2 Verify 'j2ki' brand string starting at byte offset 8 to confirm HEIF encapsulation of JPEG 2000

Software Support

K
Kakadu Software
O
OpenJPEG
G
Grok

Conversion Tools

Share & Embed

Markdown Badge
HEJ2K Format Badge
[![HEJ2K Format](https://freewebptojpg.com/mime/image/hej2k/badge.svg)](https://freewebptojpg.com/mime/image/hej2k)
Interactive iframe Widget
<iframe src="https://freewebptojpg.com/mime/image/hej2k/embed" width="100%" height="280" style="border:1px solid #cbd5e1;border-radius:8px;" title="HEJ2K Specs"></iframe>

JSON API

All data on this page is available as a free, open JSON API. Use it in your project, documentation, or tooling.

GET https://freewebptojpg.com/mime/image/hej2k.json Open JSON
Free to use
No auth required
CORS enabled
Use from any domain
Cached 24h
Cache-Control headers set

Frequently Asked Questions

What is the difference between image/jp2 and image/hej2k?

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.

What is the magic byte for HEJ2K?

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).

Are HEJ2K images supported in web browsers?

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.

Related Formats

Share this format