最近,Google开源了一个新的JPEG编码压缩算法Guetzli,该算法可以将图片大小缩小35%,且能有效保证图片质量和视觉效果。以下为Google research Blog原文+翻译,翻译水平有限,如有翻译不当处请自行翻译请。
原标题:Announcing Guetzli: A New Open Source JPEG Encoder
原链接:(https://research.googleblog.com/2017/03/announcing-guetzli-new-open-source-jpeg.html)
At Google, we care about giving users the best possible online experience, both through our own services and products and by contributing new tools and industry standards for use by the online community. That’s why we’re excited to announce Guetzli, a new open source algorithm that creates high quality JPEG images with file sizes 35% smaller than currently available methods, enabling webmasters to create webpages that can load faster and use even less data.
在谷歌,我们一直致力于给用户提供最高的网络体验,不论是谷歌的软件服务、产品以及新的工具,还是用户社交网络的工业标准,谷歌一直坚持这种理念。这次我们很高兴的宣布一个新的算法Guetzli,相对其他JPEG图片处理算法,Guetzli算法可以将JPEG文件缩小35%,可以帮助站长开发的高web站点或APP能更快的加载图片、使用更好的数据量。
Guetzli [guɛtsli] — cookie in Swiss German — is a JPEG encoder for digital images and web graphics that can enable faster online experiences by producing smaller JPEG files while still maintaining compatibility with existing browsers, image processing applications and the JPEG standard. From the practical viewpoint this is very similar to our Zopfli algorithm, which produces smaller PNG and gzip files without needing to introduce a new format, and different than the techniques used in RNN-based image compression, RAISR, and WebP, which all need client and ecosystem changes for compression gains at internet scale.
Guetzli是一个用于数字图片和网络绘图的JPEG图片生成算法,在兼容现有浏览器、图片处理软件和JPEG图片标准的前提下,Guetzli可以生成更小的图片来达到加速网络体验。从使用的角度来看,Guetzli有点类似于我们发布的Zopfli算法(Zopfli是用来生成更小的PNG、GZIP文件),但是可以不用改变文件格式,当然Guetzli不同于其他的技术,比如基于神经网络的图片压缩(RNN-based image compression),精确的超级图像分辨率技术(RAISR)以及WebP,这些在互联网应用上需要客户端和生态系统都改变才能获得压缩收益。
The scale of JPEG images is directly correlated to its multi-stage compression process: color space transform, discrete cosine transform, and quantization. Guetzli specifically targets the quantization stage in which the more visual quality loss is introduced, the smaller the resulting file. Guetzli strikes a balance between minimal loss and file size by employing a search algorithm that tries to overcome the difference between the psychovisual modeling of JPEG’s format, and Guetzli’s psychovisual model, which approximates color perception and visual masking in a more thorough and detailed way than what is achievable by simpler color transforms and the discrete cosine transform. However, while Guetzli creates smaller image file sizes, the tradeoff is that these search algorithms take significantly longer to create compressed images than currently available methods.
JPEG图片的视觉质量是和多级压缩方法直接相关的,这些方法包含色彩空间变换、离散余弦变换和量化阶段。Guetzli首要目的是在量化阶段:视觉质量损失越多,图片就会越小。Guetzli是在最小损失和文件大小之间取得了一种平衡,通过算法研究,我们尝试着克服 JPEG格式的精神性视觉模型(psychovisual modeling )和Guetzli精神视觉模型(Guetzli’s psychovisual model,)之间的差异,相对那些利用简单的色彩转换和离散余弦变化的成熟算法,Guetzli精神性视觉模型用更彻底和更详细的方式去近似体现色彩感知和视觉修饰。但是,和现有算法相比,Guetzli创建更小的图片文件同时,付出的代价是创建压缩图片必须耗费更长的时间。
And while Guetzli produces smaller image file sizes without sacrificing quality, we additionally found that in experiments where compressed image file sizes are kept constant that human raters consistently preferred the images Guetzli produced over libjpeg images, even when the libjpeg files were the same size or even slightly larger. We think this makes the slower compression a worthy tradeoff.
当然Guetzli在生成更小的图片时并没有牺牲质量,另外我们在实验还发现当压缩图片的大小保持不变时,评委们总是更喜欢Guetzli图片,而非libjpeg图片,甚至有时libjpeg文件大小相同或明显更大。正是由于这点,我们认为降低压缩效率的代价是值得的。
It is our hope that webmasters and graphic designers will find Guetzli useful and apply it to their photographic content, making users’ experience smoother on image-heavy websites in addition to reducing load times and bandwidth costs for mobile users. Last, we hope that the new explicitly psychovisual approach in Guetzli will inspire further image and video compression research.
我们希望更多的站长和图片制作者能发现Guetzli的有用之处并利用用它制作图片内容,让更多移动用户在多图的站点上用户体验更平滑且能有效降低加载时间和带宽消耗。最后,我们希望Guetzli这个新的明确的精神性视觉方法能更激发更深的图片和视频压缩算法的研究。
PS:喜欢研究朋友可到github下载源码接(https://github.com/google/guetzli)