Does JPEG transcode images into idempotent operation?

I know that JPEG compression is lost. I have 2 questions:

Given operation T:
1. Take a JPEG-80 image
2. Decrypt it into a byte buffer
3. Encoding the specified byte buffer in JPEG-80 format

Is T an idempotent operation in terms of visual quality? Or will image quality deteriorate as T repeats? Is the same true for the JPEG-XR codec?

Thanks!

Edit : Since there are conflicting answers, it would be great if you could provide links!

+6
source share
3 answers

By definition, a lossy operation discards data, simplifying presentation in a way that (ideally) is not noticeable to the end user. However, the encoder does not have a magic method for determining which pixels are important and which are not, so it encodes all the pixels the same way, even if they are artifacts!

In other words, the encoder will handle the loss of the compressed image in the same way as the lossless image. The lossy image will be further simplified by discarding additional data in the process, as it is known for all coders that the user intends to present artifacts.

Here are some examples of loss of JPEG generation:

http://vimeo.com/3750507

http://en.wikipedia.org/wiki/File:JPEG_Generarion_Loss_rotating_90_(stitch_of_0,100,200,500,900,2000_times).png

+2
source

If you use the same JPG compression engine with the same settings, it will usually be idempotent. I don't know if this is guaranteed, but I think most implementations will take care of that. I know for sure that Java runtime implementations are idempotent.

+1
source

This is not guaranteed, but it can happen. Especially, if you repeat the encoding process for a long time β†’ decode β†’ encode β†’ decode, then it will finally be installed on a fixed point and stop losing quality (if you adhere to the same quality and the same encoder).

JPEG encoding is performed in several stages:

  • Convert RGB to YUV
  • DCT (change in frequency domain)
  • Quantization (discarding DCT bits)
  • Lossless

And decoding is the same process back.

Steps 1 and 2 have rounding errors (especially in speed-optimized encodings using integer math), so for idempotent re-encoding you should be lucky that the rounding and decoding errors are small or cancel each other out.

Step 3, which is the main loss step, is actually idempotent. If your decoded pixels are converted to a similar DCT, it will again be quantized with the same data!

JPEG XR also uses YUV, so it may experience some rounding errors, but OTOH uses a different transformation instead of DCT that can be computed without rounding errors, so it should be easier to round JPEG-XR than other formats.

+1
source

All Articles