IE9和JPEG-XR:第一印象

news/2024/7/3 5:43:21 标签: python, java, 计算机视觉, linux, 机器学习

One of the new features in IE9 is the support for the JPEG-XR format, which reportedly has a better compression. Is it something we should dive into ASAP?

IE9的新功能之一是对JPEG-XR格式的支持,据说该格式具有更好的压缩率。 我们应该尽快涉足吗?

JPEG-XR (JPEG-XR)

The wikipedia article is here. This format is developed and patented (red flag!) by Microsoft (yellow flag! 🙂 ), it replaces the suggested JPEG-2000 format and is an official standard as of mid '09. It's formerly known as "HD photo" and "Microsoft something something" and is heavily used in Vista and Windows 7 - two OSes I'm yet to experience. Anyway.

维基百科的文章在这里。 此格式由Microsoft(黄色标志!🙂)开发并获得专利(红色标志!),它替代了建议的JPEG-2000格式,并且是09年中期的正式标准。 它以前被称为“高清照片”和“微软某种东西”,并且在Vista和Windows 7中大量使用-这是我尚未体验到的两种操作系统。 无论如何。

The wikipedia article says that the format has a better compression, so I had to take a look at it!

维基百科文章说该格式具有更好的压缩效果,所以我不得不看一下!

软件支援 (Software support)

That's where the problems start. The list of software that supports the format is not too long and most of the software just reads it, like IE9. IE9 doesn't run on XP, so I couldn't actually test it.

那就是问题开始的地方。 支持该格式的软件列表不太长,大多数软件只能读取它,例如IE9。 IE9无法在XP上运行,因此我无法对其进行实际测试。

What I managed to try was:

我设法尝试的是:

  • a plugin for Paint.NET that read/writes JPEG-XR

    Paint.NET的一个可读写JPEG-XR的插件

  • a 60-day trial version of MS' Expression Design 3 that reads/writes - this required an upgrade of my .Net platform, so the whole process took forever on the poor XP VMWare (but hey, I have a book to finish, so no distraction is too long!)

    MS的Expression Design 3的60天试用版,可以读取/写入-这需要升级.Net平台,因此整个过程都花在了可怜的XP VMWare上(但是,我要写一本书,所以没有分心的时间太长!)

  • a plugin for IrfanView that reads the format

    IrfanView的插件,可读取格式

Nothing for Mac though.

对于Mac来说什么也没有。

There's rumors all over the place that MS have a beta version of a Photoshop plugin that works on the Mac, but even the MS' press release linked to a 404. (which redirected to a bing search - here's the secret to gaining search market share!)

到处都有谣言,MS的Mac上有一个Photoshop插件的beta版,但在MS的新闻稿中却链接到404。(重定向到bing搜索-这是获得搜索市场份额的秘密!)

Actually before I digged into these programs, my first instinct was to check if ImageMagick supports this format. Turns out no. IMagick used libjpeg like pretty much all image programs out there and curiously enough here's what libjpeg's README has to say:

实际上,在研究这些程序之前,我的第一个直觉是检查ImageMagick是否支持这种格式。 原来没有。 IMagick像几乎所有的图像程序一样使用libjpeg,这很奇怪,这就是libjpeg的自述文件必须说的:

FILE FORMAT WARS
================

The ISO JPEG standards committee actually promotes different formats like
JPEG-2000 or JPEG-XR which are incompatible with original DCT-based JPEG
and which are based on faulty technologies.  IJG therefore does not and
will not support such momentary mistakes (see REFERENCES).
We have little or no sympathy for the promotion of these formats.  Indeed,
one of the original reasons for developing this free software was to help
force convergence on common, interoperable format standards for JPEG files.
Don't use an incompatible file format!
(In any case, our decoder will remain capable of reading existing JPEG
image files indefinitely.)

FILE FORMAT WARS
================

The ISO JPEG standards committee actually promotes different formats like
JPEG-2000 or JPEG-XR which are incompatible with original DCT-based JPEG
and which are based on faulty technologies.  IJG therefore does not and
will not support such momentary mistakes (see REFERENCES).
We have little or no sympathy for the promotion of these formats.  Indeed,
one of the original reasons for developing this free software was to help
force convergence on common, interoperable format standards for JPEG files.
Don't use an incompatible file format!
(In any case, our decoder will remain capable of reading existing JPEG
image files indefinitely.)

Sounds like another red flag to me. IDG (Independent JPEG Group) are the creators of libjpeg. If libjpeg doesn't sounds like it will support it JPEG-XR, that means adoption can be really slow if not feasible at all. But even if IE is the only browser under the sun that supports the format and the format is so much better, then there might be cases where it could be beneficial to browser-sniff and send different image versions, as far-fetched as that may sound.

听起来对我来说是另外一个危险信号。 IDG(独立JPEG组)是libjpeg的创建者。 如果libjpeg听起来好像不支持JPEG-XR,则意味着如果根本不可行,采用速度可能会很慢。 但是,即使IE是唯一支持这种格式的阳光浏览器,而且格式要好得多,但在某些情况下,它可能有益于浏览器嗅探并发送不同的图像版本,因为它可能牵强声音。

在Paint.NET中测试 (Test in Paint.NET)

I started with Paint.NET because it was the easiest. I took a photo I've taken with the iPhone, keeping the use case real, and resized to a 600x450px which sounds like a normal thing to do in a blog post for example. I used IrfanView and PNG, so that the original is lossless (click the thumb for the actual source image).

我从Paint.NET开始,因为它是最简单的。 我拍了用iPhone拍摄的照片,保持用例真实,然后将大小调整为600x450px,这听起来像是在博客文章中做的正常事情。 我使用了IrfanView和PNG,因此原始图像是无损的(单击拇指可获得实际的源图像)。

I converted the photo with Paint.NET to JPEG and to JPEG-XR (also called WDP/HD Photo). In both cases I used quality of 80%. There was also an option for WDP which was 32bit image by default, which I changed to 24 bits because the image was smaller filesize.

我使用Paint.NET将照片转换为JPEG和JPEG-XR(也称为WDP / HD照片)。 在这两种情况下,我都使用80%的质量。 WDP也有一个选项,默认情况下为32位图像,由于图像文件大小较小,因此我将其更改为24位。

Paint.NET中的WDP导出

The results were - 45K for XR/WDP and 24K for JPEG. So the good old JPEG was smaller - the exact opposite of what should've happened. Additionally JPEGTran shaved off another 1.3K from the file. Seemed like JPEG-XR is not that good after all. But as I said I had a book to write so I kept going with the distractions, determined to avoid writing for as long as I can.

对于XR / WDP,结果为-45K,对于JPEG ,结果为24K 。 因此,好的旧JPEG较小-与应该发生的情况完全相反。 另外,JPEGTran从文件中删除了另一个1.3K。 看起来像JPEG-XR毕竟不是那么好。 但是正如我说的那样,我有一本书要写,所以我会继续分散注意力,决心尽我所能避免写作。

使用表达设计进行测试 (Test with Expression Design)

Expression Design produced the exact same WDP/HD Photo/JPEG-XR file - 45K. And this is not surprising actually, since there is an image framework from MS, called WIC, part of .Net, which is probably what Paint.NET and Expression Design both use. But surprisingly enough the JPEG outcome from Expression Design was significantly bigger - 57K. What?!

Expression Design制作了完全相同的WDP / HD Photo / JPEG-XR文件-45K。 实际上,这并不奇怪,因为有一个来自MS的图像框架,称为WIC ,它是.Net的一部分,这可能是Paint.NET和Expression Design都使用的框架。 但是令人惊讶的是,来自Expression Design的JPEG结果明显更大-57K 。 什么?!

Then I looked at the visual quality and the number of colors and it turned out the JPEGs were pretty different, although they were converted from the same PNG and using 80% in both programs.

然后,我查看了视觉质量和颜色数量,结果发现JPEG完全不同,尽管它们是从相同的PNG转换并在两个程序中都使用80%。

Software/FormatJPEGJPEG-XR aka WDP aka HD Photo
Paint.NET24K (50 000+ colors)45K (104 000+ colors)
Expression Design57K (54 000+ colors)
软件/格式 JPEG格式JPEG-XR aka WDP aka高清照片
Paint.NET 24K(5万多种颜色) 45K(104万多种颜色)
表达设计 57K(54 000多种颜色)

Visually the JPEG from Paint.NET is clearly lower quality than the one from Expression Design and from the WDP format. Interestingly, IrfanView produced an pretty much identical file when converting the PNG to JPEG with quality 80. So Expression Design seems to be doing something differently.

从视觉上看,Paint.NET的JPEG质量明显低于Expression Design和WDP格式的JPEG质量。 有趣的是,将PNG转换为质量80时,IrfanView生成了几乎相同的文件。因此Expression Design似乎在做一些不同的事情。

Using IrfanView I increased the quality of the JPEG until the file size reaches the file size of the WDP. (After all, all I want to know is which format has the smaller filesize). The quality of 93 resulted in a JPEG that was about the same file size as quality 80 JPEG-XR. Then I tried so look at the visual quality and although I'm not a designer, it seemed to me that the two images are pretty identical and XR is maybe just a little better. But that's a little subjective.

使用IrfanView,我提高了JPEG的质量,直到文件大小达到WDP的文件大小为止。 (毕竟,我只想知道哪种格式的文件大小较小)。 93的质量产生的JPEG文件大小与80 JPEG-XR质量相同。 然后,我尝试着眼于视觉质量,尽管我不是设计师,但在我看来这两个图像是完全相同的,而XR可能要好一些。 但这有点主观。

Here's the two files for comparison. Let me know which one you think is better. In this case they are both losslessly converted to PNG, so all browsers can see the WDP.

这是两个文件进行比较。 让我知道您认为哪个更好。 在这种情况下,它们都会无损地转换为PNG,因此所有浏览器都可以看到WDP。

  • Quality 92 JPEG - 51K+ colors

    品质92 JPEG-51K +色彩

  • Quality 80 WDP (JPEG-XR) - 100K+ colors

    品质80 WDP(JPEG-XR)-100K +色彩

Here's also an image diff (from ImageMagick's compare) - it shows that technically the two images are very different (the white dots are pixels with the exact same color values)

这也是一个图像差异(来自ImageMagick的compare )-从技术上讲,这两个图像非常不同(白点是具有完全相同的颜色值的像素)

表情设计选项

One other thing about Expression Design - when exporting WDR, it has a "transparency" checkbox ON. This results is bigger images, so make sure you turn it off when using, it makes no sense for photos.

关于Expression Design的另一件事-导出WDR时,它具有“透明”复选框。 这样可以得到更大的图像,因此请确保在使用时将其关闭,这对照片没有意义。

批量转换? (Batch conversion?)

My motivation in this experiment was to see if there's a way (and a reason) to do a batch conversion of all JPEG imagery to JPEG-XR. This would be my favorite performance optimization - you run one script and wake up to a 5-10% less image bandwidth.

在此实验中,我的动机是查看是否存在将所有JPEG图像批量转换为JPEG-XR的方法(和原因)。 这将是我最喜欢的性能优化-您运行一个脚本,然后将图像带宽减少5-10%。

Looks like JPEG-XR could probably look better for the same filesize, meaning maybe a smaller filesize for the same quality. But it's not easy to decide when it comes to quality and certainly even harder for a machine (a simple batch conversion script) to tell. I was hoping that there's a way to losslessly convert to JPEG-XR. From what I can see, there isn't. JPEG-XR does have a lossless option but it creates huge files (like 250K instead of 45), so the lossless versions are not meant to be on the web. BTW, the lossless option is the same as 100 quality (which is not the same in normal JPEG, where even 100% is lossy).

对于相同的文件大小,看起来JPEG-XR可能看起来更好,这意味着对于相同的质量,可能较小的文件大小。 但是,决定质量的时间并不容易,对于一台机器(一个简单的批处理转换脚本)来说,当然还要困难得多。 我希望有一种无损转换为JPEG-XR的方法。 从我所见,没有。 JPEG-XR确实具有无损选项,但它会创建巨大的文件(例如250K而不是45K),因此无损版本不适合在网络上使用。 顺便说一句,无损选项与100质量相同(在普通JPEG中甚至100%有损的情况下也不一样)。

So, in conclusion - JPEG-XR may look promising but is currently unusable for practical purposes, because of

因此,总而言之-JPEG-XR看起来很有前途,但由于以下原因,目前无法用于实际用途

  • the extremely limited support in browsers (browser, actually),

    浏览器(实际上是浏览器)的支持非常有限,
  • very limited choices of creation software

    创作软件的选择非常有限
  • the benefits are hard to distinguish

    好处很难区分
  • not possible to batch-and-forget process all old JPEGs

    无法批量处理所有旧的JPEG

And there's the other turn off - patents. Although Microsoft has promised to promise not to sue people around for implementing JPEG-XR, a patent is a patent and all software patents must die on general principle 🙂

还有另一项关闭-专利。 尽管微软已承诺不会起诉实施JPEG-XR的人,但专利是专利,并且所有软件专利都必须遵循一般原则而死🙂

Tell your friends about this post on Facebook and Twitter

在Facebook和Twitter上告诉您的朋友有关此帖子的信息

翻译自: https://www.phpied.com/ie9-and-jpeg-xr-first-impressions/


http://www.niftyadmin.cn/n/1306274.html

相关文章

JavaScript实现获取table中某一列的值

JavaScript实现获取table中某一列的值 1、实现源码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns"http://www.w3.org/1999/xhtml"> …

HDU 1085 Holding Bin-Laden Captive!(母函数)

题目&#xff1a;HDU-1085 题目链接&#xff1a;http://acm.hdu.edu.cn/showproblem.php?pid1085 题目&#xff1a; Holding Bin-Laden Captive! Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 19057 Accep…

WebService之CXF注解之一(封装类)

Teacher.java&#xff1a; /*** Title:Teacher.java* Package:com.you.model* Description:老师封装类* author:Youhaidong(游海东)* date:2014-5-5 下午11:03:13* version V1.0*/ package com.you.model;import java.io.Serializable;/*** 类功能说明* 类修改者 修改日期* 修改…

编程神书_向编程之神祈祷

编程神书Oh Almighty All-One (01), 全能的哦(01)&#xff0c; Grant me the courage to embrace and early adopt new cool technologies, the serenity to ignore distractions from new technology fads and the wisdom to tell the difference. 让我勇于接受和尽早采…

YSlow开发:自定义规则集

(This is part 3. See part one and part two.) (这是第3部分。请参见第1部分和第2部分。) There are two concepts to remember when working on your YSlow extensions and customizations: 在处理YSlow扩展和自定义项时&#xff0c;要记住两个概念&#xff1a; rules (or &q…

HDU 1171 Big Event in HDU

题目&#xff1a;HDU-1085 题目链接&#xff1a;http://acm.hdu.edu.cn/showproblem.php?pid1085 题目&#xff1a; Big Event in HDU Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 31958 Accepted Submi…

WebService之CXF注解之二(Service接口)

ITeacherService.java&#xff1a; /*** Title:ITeacherService.java* Package:com.you.service* Description:教师Service接口* author:Youhaidong(游海东)* date:2014-5-5 下午11:06:24* version V1.0*/ package com.you.service;import javax.jws.WebMethod; import javax.j…

HDU 1709 The Balance(母函数)

题目&#xff1a;HDU-1085 题目链接&#xff1a;http://acm.hdu.edu.cn/showproblem.php?pid1085 题目&#xff1a; The Balance Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 7089 Accepted Submission(s…