What is JPEG XT?
JPEG XT, standardized as ISO/IEC 18477, extends base JPEG with higher precision, HDR, floating-point, lossless, and alpha-channel coding. Its streams retain a base image for older JPEG decoders.
How JPEG XT works
JPEG XT is layered on top of legacy JPEG. A file holds an ordinary JPEG image, the base layer, plus extension data that an XT decoder combines with the decoded base to reconstruct the richer picture. The thorfdbg/libjpeg codec, which the JPEG committee lists among JPEG XT implementations, carries that extension data as boxes inside APP11 application marker segments, and the JPEG standard reserves application segments for application use, which is how existing decoders can read the file without understanding the extension. For HDR content the base is a low-dynamic-range rendering: that encoder tone-maps the HDR input by default and, for some profiles, accepts a separately supplied image. The standard is split into parts. Part 1 restates the JPEG core as it is commonly used, Part 2 codes HDR images with a legacy text-based encoding for its metadata, Part 3 defines the box-based file format, Part 6 adds 9- to 16-bit integer samples, Part 7 floating-point HDR samples, Part 8 lossless and near-lossless coding, and Part 9 alpha channels. Support therefore has to be stated per part, and for Part 7 per profile, not as a single yes-or-no flag.
Key facts
- 1A file that opens in an ordinary viewer proves only that the base JPEG is intact. The HDR, higher-precision, lossless, or alpha data travels in application marker segments (APP11 in the
thorfdbg/libjpegcodec) that a legacy decoder does not interpret, so confirm it with a decoder for the relevant JPEG XT part. - 2JPEG XT support is not one capability. Part 6 covers 9- to 16-bit integer samples, Part 7 floating-point HDR samples, Part 8 lossless and near-lossless coding, and Part 9 alpha channels, while Part 1 only restates the JPEG core in common use. Part 7 is not the only HDR part: Part 2 is also an HDR part, with a legacy text-based encoding for its metadata. Ask which parts, and for Part 7 which profile, a tool reads and writes: the JPEG committee’s own software list includes one codec compliant only with Part 7 Profile B and another only with Part 2.
- 3Rewriting a file with JPEG-only tooling can drop the extension data without an error. libjpeg-turbo’s
jpegtran, for example, by default copies only comment markers and discards other metadata;-copy allis needed to keep all extra markers. Keeping the markers does not prove the extension still decodes:thorfdbg/libjpegstores a checksum of the base JPEG stream when it writes JPEG XT files and rejects extension data whose dimensions differ from the base image, so compare XT-decoded output before and after any rewrite. A decode and re-encode through a legacy codec starts from the base image alone. - 4JPEG XT is not JPEG XL. JPEG XT (ISO/IEC 18477) keeps the file readable by legacy JPEG decoders. JPEG XL (ISO/IEC 18181) is a separate coding system whose bridge to legacy JPEG is lossless transcoding of an existing JPEG file to JPEG XL and back to the identical JPEG file.
When JPEG XT matters
JPEG XT matters when one file has to open in ordinary JPEG software and also carry HDR, higher-bit-depth, lossless, or alpha data for XT-aware software. Legacy decoders show only the base image, so the extra data has to be checked with a decoder that implements the relevant part of the standard.
Sources
- JPEG committee: Overview of JPEG XT (ISO/IEC 18477) and its parts
- JPEG committee: JPEG XT workplan and published ISO/IEC 18477 parts
- JPEG committee: Software for JPEG XT and the parts each implementation complies with
- thorfdbg/libjpeg: JPEG and JPEG XT codec (README)
- thorfdbg/libjpeg: boxes/box.hpp (extension boxes in APP11 marker segments)
- thorfdbg/libjpeg: codestream/image.cpp (base-stream checksum and extension dimension check)
- ITU-T T.81 | ISO/IEC 10918-1: JPEG requirements and guidelines (APPn segments, clause B.2.4.6)
- libjpeg-turbo: jpegtran manual (the -copy option)
- JPEG committee: Overview of JPEG XL (ISO/IEC 18181)