最近,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)