JacobDev1/xl-converter

Loseless jpeg recompression

Closed this issue · 1 comments

Question

Is "JPEG XL" format with lossless toggle on acts the same as "Loseless JPEG Recompression" format for jpg files?

The Docs

  • I have read the docs before asking this question.

It does not act the same out of the box. By default, it performs Lossless compression with Modular mode instead of Lossless JPEG Recompression.

This is explained in the docs: here.

For lossy images (like JPEG), this means the file size will grow instead of shrink. The pixel data will stay the same. Lossless compression is meant mostly for already lossless sources, such as PNG, and is not very practical on lossy formats. Lossless JPEG Recompression (or Transcoding) can be used here instead, but isn't, because of privacy, and UX considerations.

XL Converter can recognize JPEG images and automatically perform Lossless JPEG Transcoding with just "Lossless" enabled. This can be enabled in the settings but is not recommended. The dedicated options in the format selector offer more safeguards. They also don't create false expectations the developers of other programs will have to listen to.

I designed the program this way because Lossless JPEG Transcoding (or Recompression) has the drawback of always including metadata. Thus performing this operation needs to be a conscious decision, not an automatic one. I see making this the default as a bad design decision as it breaks the existing conventions set by all other GUI image converters. I do it also out of concern for other developers. I don't want users asking devs why isn't Lossless performing Lossless JPEG Transcoding.