2

I have done a research comparing JPEG and JPEG-2000 and couldn't reach the same or better perceptual level of quality for JPEG-2000 compared to JPEG in extreme compressing levels (for web).

Although, announced as ~20+% better perceptual quality with the same size than original JPEG, with available tools to reconvert existing JPEGs or even lossless PNGs, original JPEG was still superior. JPEG-2000 managed to get arguably better results only for huge images which are not as widely used in web (Full HD and bigger).

ImageMagick, GraphicsMagick, OpenJPEG all showed identical results (I assume, due to usage of Jasper to encode JPEG-2000) and all lacked options for encoding. Using Kakadu or online/basic converters didn't help either. In current status quo, tools like imagemin with plugins, can provide much better quality JPEGs on output than JPEG-2000 when maximally compressed for web. So JPEG-2000 being useful mostly for Safari, doesn't get any point to be another format to encode since regular JPEG provides better results.

What do I do wrong and are there any other tools/tricks that have more advanced options for JPEG-2000 encoding to finally beat JPEG?

vptest
  • 246
  • 1
  • 17
  • OpenJPEG does not use Jasper. ImageMagick no longer uses Jasper and uses OpenJPEG. What commands did you use? Have you used the proper JP2 compression options in ImageMagick? See https://imagemagick.org/script/jp2.php – fmw42 Aug 03 '19 at 23:14
  • What do you mean by "proper compression options"? As you can see, not really much you can define when encoding. Only parameters to affect size are number-resolutions, quality or rate. I tried with both to achieve the same weight as JPEG after jpegrecompress with target of 0.995 (max 5 SSIM) or Guetzli, and JPEG-2000 always lost with pretty much any image. Number-resolutions provides better result with bigger number (although, logically it should be the opposite), but at a certain number (higher than 10) it always throws an error, and after 6 it doesn't provide any significant improvements. – vptest Aug 04 '19 at 09:30

1 Answers1

3

It's not just you. JPEG 2000 isn't that much better. It's difficult to encode well, and we've got more mature JPEG encoders nowadays (MozJPEG, Guetzli).

JPEG 2000 is wavelet-based, which gives it better scores in the PSNR metric. However, JPEG 2000 excels in exactly the thing PSNR metric prefers too much: blurring. It makes JPEG 2000 look great in low quality range, where the older JPEG breaks down. But it's not helpful in practice for higher-quality images. Wavelets also struggle with text and sharp edges, just like the older JPEG.

JPEG 2000 has very nice progressive loading, but Safari has stopped supporting progressive rendering at some point.

The only practical use for JPEG 2000 is delivering photographic-like images with alpha channel, because JPEG can't do that, and JPEG 2000 still wins compared to PNG.

Kornel
  • 97,764
  • 37
  • 219
  • 309
  • The problem is not even with getting better results but at least equal to JPEG with extreme compressing. Put aside Guetzli that takes quite a long time to process an image, according to provided information, JPEG-2000 should be an obvious winner against JPEG when compressing for web (where it is close to extreme encoding with imminent artifacts), but in reality the lack of encoding options produce poor results. JP2 images with the same size look significantly worse than their JPEG counterparts. – vptest Aug 04 '19 at 09:38
  • 1
    That's the point: JPEG 2000 is *not* an obvious winner over JPEG. It's a mostly dead format, for a good reason. It's been hailed as "20% better" two decades ago, mainly based on flawed PSNR scores. You're not missing anything, you're not doing anything wrong. There's nothing great hidden in JPEG 2000. – Kornel Aug 04 '19 at 23:24
  • Thanks a lot! It is quite disappointing, especially when there is no real alternative to JPEG for Safari users. It won't support WebP, still doesn't support HEIF and JP2 turned out not to be superior. – vptest Aug 05 '19 at 07:16
  • @vptest you may find that WebP (VP8) also isn't a clear win. It has 4:2:0 chroma subsampling, less-than-8-bit color range, and tends to blur too. Only HEIF and AVIF (AV1) are definite improvements, but as you've noticed, they're not here yet. – Kornel Aug 05 '19 at 14:07