Lossless JPEG Transcoding

Overview

JPEG XL can preserve the original JPEG while reducing its file size by 16% - 22% [1] .

This process is reversible - you can reconstruct the original JPEG image with an identical checksum.

Lossless JPEG Transcoding

To transcode a JPEG image into JPEG XL image:

  1. Add JPEG images

  2. Select “Lossless JPEG Transcoding” from the format selector

  3. Convert

JPEG Reconstruction

To reverse the recompression and get the original JPEG image:

  1. Add JPEG XL images (with jxl extension)

  2. Select “JPEG Reconstruction” from the format selector

  3. Convert

Options

Lossless JPEG Transcoding

Effort

Increasing Effort in this case always reduces file size and slow down the transcoding. Effort 9 offers the smallest file size.

Verify

Validates that a JPEG image can be reconstructed, and its checksum matches the original. An exception will be displayed if any problems occur.

Enabling this option is unnecessary because the transcoding is highly reliable. However, it does provide an additional reassurance.

If “Normalize” is enabled, the checksum of the normalized image will be used instead.

Images will take slightly longer to process if enabled.

Normalize

Allows for transcoding problematic JPEG images. Rewrites image structure without affecting quality or metadata.

Discards unnecessary information, such as unused quantization tables or arbitrary tail data.

Important

With this enabled, the checksum of a JPEG image you can reconstruct will change, and its file size will increase.

Equivalent to jpegtran -copy all -optimize. Images will take slightly longer to process if enabled.

Modes:

  • On Fail - will normalize only when transcoding fails then retry.

  • Always - all sources will be normalized.

JPEG Reconstruction

PNG Fallback

Disabled: an exception will be raised if reconstruction data is not found.

Enabled: image will be decoded to PNG if there is no reconstruction data.

Metadata

Lossless JPEG Transcoding always preserves metadata!

Common Problems

Lossless JPEG Transcoding fails on some JPEG images.

Enable “Normalize”.

Keep in mind this option alters the checksums in the JPEG images you can reconstruct.

While the vast majority of JPEG images can be losslessly transcoded, there are minor exceptions.

Limitations:

  • No CMYK images.

  • No more than 4 MB of arbitrary tail data is allowed.

  • No unused quantization tables.

  • Possibly more limits

Compression Types in JPEG XL

  • Lossless Compression (from pixels) - standard lossless compression.

  • Lossless JPEG Transcoding (or Recompression) - a special type of lossless compression desgined specifically for compressing JPEG images.

Only the standard compression is applied when “JPEG XL” format is selected. This is done for privacy reasons as recompression requires metadata preservation.

While this behavior can be changed, dedicated modes are recommended instead:

  • Lossless JPEG Transcoding

  • JPEG Reconstruction

They also offer safeguards, extra features, avoid cluttering the UI, and non-standard behavior.