当质量被设置为100时,JPEG是否无损?

时间:2022-10-09 21:20:24

I understand that JPEG is a lossy compression standard, and that the 'quality' factor controls the degree of compression and thus the amount of data loss.

我知道JPEG是一个有损压缩的标准,并且“质量”因素控制了压缩的程度,从而控制了数据丢失的数量。

But when the quality number is set to 100, is the resulting jpeg lossless?

但当质量数被设为100时,jpeg是否会无损?

4 个解决方案

#1


10  

As correctly answered above, using a "typical" JPEG encoder at quality 100 does not give you lossless compression. Lossless JPEG encoding exists, but it's different in nature and seldom used.

如上所述,在质量100中使用“典型的”JPEG编码器不会给您无损压缩。无损JPEG编码存在,但本质上是不同的,很少使用。

I'm just posting to say why quality 100 does not mean lossless.

我只是想说,为什么质量100并不意味着无损。

In JPEG compression information is mostly lost during the DCT coefficient quantization step (8-by-8 coefficient blocks are divided by a 8-by-8 quantization table, so they become smaller --> 'more compressible'). When you set JPEG quality to 100, no real quantization takes place (because the quantization table will be all 1s, at least with standard IJG-JPEG tables), so in fact you don't lose information here..

在JPEG压缩信息中,在DCT系数量化步骤中(8×8的系数块除以8×8的量子化表,所以它们变得更小——>“更可压缩”)。当您将JPEG质量设置为100时,不会发生真正的量化(因为量子化表将是所有的1,至少使用标准的IJG-JPEG表),所以实际上您不会在这里丢失信息。

However, there are mainly two factors leading to information loss even when no quantization takes place:

然而,在没有量化的情况下,主要有两个因素导致信息丢失:

  1. Typically, JPEG compression reduces color information (becase the human visual system is less senstitive to that than to lumimance). Therefore, even at quality 100 you may be carrying out chrominance subsampling (which means, dropping half or more Cb and Cr coefficients). When this happens, information is lost, even when no quantization happens. However, you can tell the encoder to preserve full chromimance (so called 4:4:4 color sampling).
  2. 通常,JPEG压缩会减少颜色信息(因为人类的视觉系统比lumimance更不敏感)。因此,即使是质量100,你也可以进行色度子采样(也就是说,去掉一半或更多的Cb和Cr系数)。当这种情况发生时,即使没有量化,信息也会丢失。但是,你可以告诉编码器保持全色度(所以叫4:4:4颜色采样)。
  3. Nevertheless, JPEG encoding implies going to the DCT domain, which causes rounding of coefficients. Rounding discards some information. This will happen regardless of all other options.
  4. 然而,JPEG编码意味着进入DCT域,这导致了系数的四舍五入。舍入丢弃一些信息。无论其他选择如何,这都将发生。

#2


56  

Jpeg is lossy regardless of the setting. At 100, you just get the LEAST loss possible.

无论设置什么,Jpeg都是有损的。在100岁时,你只会得到尽可能少的损失。

It's easy enough to test. Whip up a simple .bmp, compress that to a q=100 jpeg, then re-extract back to a .bmp. Use Gimp/Photoshop to do a "difference" of the two bitmaps, and you'll see the lossiness - it'll be much less noticeable than on a q=50 or q=1 conversion, but still be present.

这很容易测试。用一个简单的.bmp,将其压缩到q=100 jpeg,然后重新提取到.bmp。使用Gimp/Photoshop在两个位图上做一个“差”,你就会看到losdy——它比q=50或q=1的转换要小得多,但仍然存在。

#3


21  

There is a lossless form of JPEG but it is not widely supported and you do not get it by tweaking the quality setting - it's an entirely different process.

有一种无损的JPEG格式,但是它没有得到广泛的支持,而且您不通过调整质量设置来获得它——这是一个完全不同的过程。

#4


0  

According to wikipedia, No.

根据*,不。

jpeg 100 has a compression ratio of 2.6:1. The compression method is usually lossy, meaning that some original image information is lost and cannot be restored, possibly affecting image quality.

jpeg 100的压缩比为2.6:1。压缩方法通常是有损的,这意味着一些原始图像信息丢失,无法恢复,可能影响图像质量。

There is an optional lossless mode defined in the JPEG standard; however, this mode is not widely supported in products.

在JPEG标准中定义了一个可选的无损模式;但是,这种模式在产品中并没有得到广泛的支持。

#1


10  

As correctly answered above, using a "typical" JPEG encoder at quality 100 does not give you lossless compression. Lossless JPEG encoding exists, but it's different in nature and seldom used.

如上所述,在质量100中使用“典型的”JPEG编码器不会给您无损压缩。无损JPEG编码存在,但本质上是不同的,很少使用。

I'm just posting to say why quality 100 does not mean lossless.

我只是想说,为什么质量100并不意味着无损。

In JPEG compression information is mostly lost during the DCT coefficient quantization step (8-by-8 coefficient blocks are divided by a 8-by-8 quantization table, so they become smaller --> 'more compressible'). When you set JPEG quality to 100, no real quantization takes place (because the quantization table will be all 1s, at least with standard IJG-JPEG tables), so in fact you don't lose information here..

在JPEG压缩信息中,在DCT系数量化步骤中(8×8的系数块除以8×8的量子化表,所以它们变得更小——>“更可压缩”)。当您将JPEG质量设置为100时,不会发生真正的量化(因为量子化表将是所有的1,至少使用标准的IJG-JPEG表),所以实际上您不会在这里丢失信息。

However, there are mainly two factors leading to information loss even when no quantization takes place:

然而,在没有量化的情况下,主要有两个因素导致信息丢失:

  1. Typically, JPEG compression reduces color information (becase the human visual system is less senstitive to that than to lumimance). Therefore, even at quality 100 you may be carrying out chrominance subsampling (which means, dropping half or more Cb and Cr coefficients). When this happens, information is lost, even when no quantization happens. However, you can tell the encoder to preserve full chromimance (so called 4:4:4 color sampling).
  2. 通常,JPEG压缩会减少颜色信息(因为人类的视觉系统比lumimance更不敏感)。因此,即使是质量100,你也可以进行色度子采样(也就是说,去掉一半或更多的Cb和Cr系数)。当这种情况发生时,即使没有量化,信息也会丢失。但是,你可以告诉编码器保持全色度(所以叫4:4:4颜色采样)。
  3. Nevertheless, JPEG encoding implies going to the DCT domain, which causes rounding of coefficients. Rounding discards some information. This will happen regardless of all other options.
  4. 然而,JPEG编码意味着进入DCT域,这导致了系数的四舍五入。舍入丢弃一些信息。无论其他选择如何,这都将发生。

#2


56  

Jpeg is lossy regardless of the setting. At 100, you just get the LEAST loss possible.

无论设置什么,Jpeg都是有损的。在100岁时,你只会得到尽可能少的损失。

It's easy enough to test. Whip up a simple .bmp, compress that to a q=100 jpeg, then re-extract back to a .bmp. Use Gimp/Photoshop to do a "difference" of the two bitmaps, and you'll see the lossiness - it'll be much less noticeable than on a q=50 or q=1 conversion, but still be present.

这很容易测试。用一个简单的.bmp,将其压缩到q=100 jpeg,然后重新提取到.bmp。使用Gimp/Photoshop在两个位图上做一个“差”,你就会看到losdy——它比q=50或q=1的转换要小得多,但仍然存在。

#3


21  

There is a lossless form of JPEG but it is not widely supported and you do not get it by tweaking the quality setting - it's an entirely different process.

有一种无损的JPEG格式,但是它没有得到广泛的支持,而且您不通过调整质量设置来获得它——这是一个完全不同的过程。

#4


0  

According to wikipedia, No.

根据*,不。

jpeg 100 has a compression ratio of 2.6:1. The compression method is usually lossy, meaning that some original image information is lost and cannot be restored, possibly affecting image quality.

jpeg 100的压缩比为2.6:1。压缩方法通常是有损的,这意味着一些原始图像信息丢失,无法恢复,可能影响图像质量。

There is an optional lossless mode defined in the JPEG standard; however, this mode is not widely supported in products.

在JPEG标准中定义了一个可选的无损模式;但是,这种模式在产品中并没有得到广泛的支持。