将质量设置为100时JPEG是否无损

将质量设置为100时JPEG是否无损

本文介绍了将质量设置为100时JPEG是否无损?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解JPEG是一种有损压缩标准,并且质量"因子控制压缩程度,从而控制数据丢失量.

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.

但是当质量数设置为100时,生成的jpeg是否无损?

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

推荐答案

如上面正确回答,使用质量为100的典型" JPEG编码器不会给您带来无损压缩.存在无损JPEG编码,但是本质上有所不同,并且很少使用.

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压缩中,大多数信息在DCT系数量化步骤中丢失(8×8系数块被8×8量化表划分,因此它们变得更小->更可压缩").当您将JPEG质量设置为100时,不会进行真正的量化(因为量化表将全为1,至少对于标准IJG-JPEG表而言为1),因此实际上您在这里不会丢失任何信息.

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..

但是,即使没有进行量化,也主要有两个导致信息丢失的因素:

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

  1. 通常,JPEG压缩会减少颜色信息(如果人类视觉系统对亮度的敏感度低于对亮度的敏感度).因此,即使质量为100,您也可能要进行色度子采样(这意味着降低Cb和Cr系数的一半或更多).发生这种情况时,即使没有量化,信息也会丢失.但是,您可以告诉编码器保留完整的色度(所谓的4:4:4颜色采样).
  2. 但是,JPEG编码意味着转到DCT域,这会导致系数舍入.四舍五入会丢弃一些信息.无论所有其他选项如何,这种情况都会发生.
  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. 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.

这篇关于将质量设置为100时JPEG是否无损?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-01 16:30