What is a JPX File?
A JPX file is an extended JPEG 2000 Part 2 container that can hold multiple codestreams, layers, composition instructions, metadata, and advanced color information. The same format also travels under the .jpf extension. It expands on the simpler JP2 format.
How JPX Files work
JPX is the file format defined in Annex M of JPEG 2000 Part 2 as an extension of JP2, built from the same box structure. In the simplest case it wraps one codestream, as JP2 does, with a wider choice of color specifications. Beyond that, a file can store several JP2-style images, called compositing layers, and a layer can draw its channels from more than one codestream, for example color from one and opacity from another. Composition instructions then crop, position, and size layers inside a render area whose width and height define the rendered result, either as a still composite or as an animation. JPX also lets a codestream be split into fragments, including fragments in other files, and lets samples be interpreted as fixed-point or floating-point values. Because a reader is not required to implement every feature, the file declares what is needed to display it in a Reader Requirements box and in File Type compatibility codes. Its registered media type is image/jpx. A delivery pipeline should flatten advanced presentations only when the target cannot interpret them, and keep the original structure as the authoritative asset.
Key facts
- 1When a JPX file carries composition data in a Composition box (
comp), the displayed picture is defined by that data, not by any one codestream: it sets the width and height of the render area, and each instruction can crop a compositing layer and place it at a given position and size. Dimensions read from the first codestream can therefore differ from the rendered result. - 2A decoder can open a JPX file and return only part of it. Reaching the later codestreams, or the composed result, needs a decoder that implements those Part 2 features; JP2 and JPX baseline readers are not required to. An OpenJPEG issue filed in 2014 reports
opj_decompressdecoding the first image of a JPX file with no way to reach its other 95 codestreams; a maintainer replied that the library aimed at full Part 1 support with only some Part 2 extensions. Check what your decoder does with multi-codestream files. - 3Whether a simpler reader can show a JPX file is declared in its File Type box. The brand is
jpxplus a space;jp2plus a space in the compatibility list means a JP2 reader can open the file, andjpxbmeans a JPX baseline reader can. A baseline reader renders only the first compositing layer, which in ajpxbfile must be a single codestream representing the rendered result. The specification calls these fallbacks and says they may not generate the exact desired output; the Reader Requirements box (rreq) states what is needed to display the file as its writer intended. Test the Part 2 features you depend on after every processing step. - 4JPX is needed when the JP2 image model is too narrow. JP2 specifies color only through enumerated color spaces or restricted ICC profiles; JPX adds further enumerated spaces, any input ICC profile, vendor-defined color, opacity kept in a separate codestream or as a chroma key, and fixed-point or floating-point samples. The specification’s own example of content a conforming JP2 reader will not interpret properly is a CMYK image.
When JPX Files matter
Use JPX when a basic JP2 file cannot express required layers, compositions, or color data. Consumers limited to JP2 may reject the file or decode only a subset of its intended presentation.
Sources
- ITU-T T.801 | ISO/IEC 15444-2: JPEG 2000 extensions (Annex M, JPX extended file format; the in-force 08/2023 text is sold, not free)
- ITU-T T.801 (06/2021), superseded edition with a free PDF: Annex M clauses M.5.3, M.6, and M.9
- JPEG committee: Overview of JPEG 2000 (Part 2 and the JPX file format)
- RFC 3745: MIME Type Registrations for JPEG 2000 (image/jpx)
- Library of Congress: JPEG 2000 Part 2 (Extensions) jpf (jpx) File Format
- OpenJPEG issue 464: Support for decoding JPX files