JPEG XR (JXR, HD Photo)
| Full name | JPEG XR (Extended Range), formerly HD Photo and Windows Media Photo |
|---|---|
| Extensions | .jxr, .hdp and .wdp (HD Photo) |
| MIME type | image/jxr, image/vnd.ms-photo (HD Photo) |
| Type | raster image, lossy and lossless compression, HDR (16-bit and 32-bit floating point) |
| Starts with | 49 49 BC 01 (II, 0xBC, version 1), a TIFF-like header; the codestream inside starts with WMPHOTO\0 (57 4D 50 48 4F 54 4F 00) |
| Specification | ITU-T T.832 (identical to ISO/IEC 29199-2) |
| Reference software | ITU-T T.835, jxrlib (BSD-2-Clause) |
| Maintained by | ISO/IEC JTC 1/SC 29 (JPEG committee) and ITU-T; originally Microsoft |
| License | open; Microsoft grants royalty-free use under its Community Promise |
JPEG XR is an image format developed by Microsoft as HD Photo and standardized by JPEG. It compresses images with a block transform similar to JPEG but with less blocking, supports lossy and lossless compression in the same codec, and stores many pixel formats: 8-bit and 16-bit integer, 16-bit half float and 32-bit float per channel, fixed point, CMYK, up to 8 extra channels, and a separate alpha plane.
Today its main use is HDR screenshots on Windows: the Xbox Game Bar (Win+Alt+PrtScn) saves a .jxr file next to a tone-mapped PNG when HDR is on, and the NVIDIA app does the same. Windows reads and writes JPEG XR through the Windows Imaging Component (WIC), and it’s used inside XPS documents and some Microsoft tools. No current web browser supports it; Internet Explorer and the old Edge were the only ones.
When to use JPEG XR#
- Use to keep HDR screenshots from Windows games and apps: the JXR file has the full HDR data (usually 64-bit RGBA half float, scRGB), while the PNG copy is clipped or tone-mapped.
- Use when a Windows/WIC-based workflow needs HDR images with lossy compression.
- Avoid for sharing images: few programs outside Windows open JPEG XR. Convert to PNG (SDR), or to AVIF or JPEG XL for HDR.
- Avoid for new projects: JPEG XL and AVIF compress better, have HDR support and are supported by more software.
File structure#
A JPEG XR file uses a container modeled on TIFF: a header, then an IFD (image file directory) of tagged entries that point to the codestream, an optional alpha plane and metadata. All numbers are little-endian.
49 49 BC 01 'II', 0xBC (JPEG XR), version 1
20 00 00 00 offset of the first IFD: 32
... IFD: entry count, then 12-byte entries (tag, type, count, value/offset)
57 4D 50 48 4F 54 4F 00 'WMPHOTO\0': start of the image codestream
Common IFD tags:
| Tag | Name | Purpose |
|---|---|---|
0xBC01 |
PIXEL_FORMAT | 16-byte GUID that identifies the pixel format, e.g. 64bpp RGBA half float |
0xBC80, 0xBC81 |
IMAGE_WIDTH, IMAGE_HEIGHT | size in pixels |
0xBC82, 0xBC83 |
WIDTH_RESOLUTION, HEIGHT_RESOLUTION | DPI as floats |
0xBCC0, 0xBCC1 |
IMAGE_OFFSET, IMAGE_BYTE_COUNT | location of the image codestream |
0xBCC2, 0xBCC3 |
ALPHA_OFFSET, ALPHA_BYTE_COUNT | location of the separate alpha plane, if any |
0x8773 |
ICC_PROFILE | embedded ICC color profile |
0x02BC |
XMP_METADATA | XMP packet |
0x8769 |
EXIF_METADATA | offset of an Exif IFD |
Codestream and compression#
- RGB pixels are converted to an internal YUV color space with a reversible integer transform, with optional 4:2:0 or 4:2:2 chroma subsampling.
- The image is split into 16x16 macroblocks, grouped into one or more tiles.
- A two-stage lapped transform runs on 4x4 blocks: the Photo Core Transform (PCT), an integer transform that’s exactly reversible, plus an optional overlap filter (POT) that reduces block artifacts. The overlap level is 0 (none), 1 or 2.
- Coefficients are quantized (no quantization for lossless) and coded in 4 frequency bands: DC, lowpass, highpass and flexbits.
- The codestream is stored in spatial mode (macroblocks in order) or frequency mode (all DC first, then lowpass, then highpass), which allows progressive and lower-resolution decoding.
Quality is set as a quantization level or, in jxrlib’s encoder, as a value from 0.0 to 1.0, where 1.0 is lossless.
Converting JPEG XR#
- jxrlib’s tools:
JxrDecApp -i in.jxr -o out.tifandJxrEncApp -i in.tif -o out.jxr -q 0.9. The decoder writes BMP (8-bit) or TIFF (16-bit and float), not PNG. - jxr_to_png converts HDR Windows screenshots to 16-bit HDR PNG (PQ / Rec. 2100), keeping the HDR look.
- ImageMagick reads and writes JPEG XR only when the jxrlib tools are installed, as an external delegate.
Specifications and documentation#
- ITU-T T.832: JPEG XR image coding specification (ISO/IEC 29199-2), includes the file format in Annex A
- ITU-T T.835: JPEG XR reference software (ISO/IEC 29199-5)
- JPEG XR at jpeg.org
- JPEG XR codec in WIC: Microsoft’s documentation of the Windows codec and its options
- jxrlib source and DPK documentation
- JPEG XR on Wikipedia
Software that opens JPEG XR files#
| Software | Windows | macOS | Linux | Web | Can | Notes |
|---|---|---|---|---|---|---|
| SumatraPDF | ✓ | view | free, open source | |||
| Microsoft Photos | ✓ | view | built into Windows; shows HDR screenshots | |||
| Windows Imaging Component | ✓ | view, convert, create | system codec used by Windows apps (File Explorer thumbnails, WPF) | |||
| Paint.NET | ✓ | view, edit, create, convert | free; uses the Windows codec | |||
| XnView MP | ✓ | ✓ | ✓ | view, convert | free for private use | |
| IrfanView | ✓ | view, convert | free for non-commercial use, needs the plugins package | |||
| HDR + WCG Image Viewer | ✓ | view | free, open source; shows HDR JXR on HDR displays | |||
| jxr_to_png | ✓ | convert | free, open source; HDR JXR to HDR PNG | |||
| jxrlib tools | ✓ | ✓ | ✓ | convert, create | JxrEncApp, JxrDecApp, reference command-line tools | |
| ImageMagick | ✓ | ✓ | ✓ | convert | open source; needs the jxrlib tools as a delegate |
Libraries#
Open-source libraries that read and write JPEG XR. See all JPEG XR libraries for a comparison.
| C/C++ | jxrlib |
|---|---|
| C# | WPF imaging |
| Python | imagecodecs |
| Rust | jpegxr |
Related formats#
- JPEG XL: newer royalty-free format with HDR, lossless and lossy modes, better compression
- AVIF: HDR-capable format based on AV1, supported by browsers
- JPEG 2000: wavelet-based format with high bit depth, used in cinema and medical imaging
- JPEG: 8-bit lossy format that JPEG XR was meant to improve on
- TIFF: the container design JPEG XR’s file format is based on
- XPS: Microsoft document format that can embed JPEG XR images