硬汉嵌入式论坛

 找回密码
 立即注册
查看: 4530|回复: 1
收起左侧

[LibJPEG] 【LibJPEG专题系列十四】文件格式

[复制链接]

740

主题

1326

回帖

3546

积分

管理员

春暖花开

Rank: 9Rank: 9Rank: 9

积分
3546
QQ
发表于 2015-5-6 17:45:41 | 显示全部楼层 |阅读模式
      Section - [14] Why all the argument about file formats?

Strictly speaking, JPEG refers only to a family of compression algorithms; it does *not* refer to a specific image
format.  The JPEG committee was prevented from defining a file format by turf wars within the international
standards organizations.


Since we can't actually exchange images with anyone else unless we agree on a common file format, this leaves us
with a problem.  In the absence of official standards, a number of JPEG program writers have just gone off to "do
their own thing", and as a result their programs aren't compatible with anyone else's.


The closest thing we have to a standard JPEG format is some work that's been coordinated by people at C-Cube
Microsystems.  They have defined two JPEG-based file formats:  
       * JFIF (JPEG File Interchange Format), a "low-end" format that transports     pixels and not much else.  
       * TIFF/JPEG, aka TIFF 6.0, an extension of the Aldus TIFF format.  TIFF is     a "high-end" format
that will let you record just about everything you ever wanted to know about an image, and a lot more besides :-).


JFIF has emerged as the de-facto standard on Internet, and is what is most commonly meant by "a JPEG file".  
Most JFIF readers are also capable of handling some not-quite-JFIF-legal variant formats.


The TIFF 6.0 spec for incorporating JPEG is not widely implemented, partly because it has some serious design
flaws.  A revised TIFF/JPEG design is now described by TIFF Technical Note #2; this design will be the one
used in TIFF 7.0.  New implementations of TIFF should use the Tech Note's design for embedding JPEG, not
the TIFF 6.0 design.  (As far as I know, NeXTStep systems are the only ones making any significant use of TIFF
6.0 style TIFF/JPEG.)  Even when TIFF/JPEG is stable, it will never be as widely used as JFIF.  TIFF is far more
complex than JFIF, and is generally less transportable because different vendors often implement slightly different,
nonoverlapping subsets of TIFF.  Adding JPEG to the mix hasn't helped any.


Apple's Macintosh QuickTime software uses a JFIF-compatible datastream wrapped inside the Mac-specific PICT
format.Conversion between JFIF and PICT/JPEG is pretty straightforward, and several Mac programs are available
to do it (see part 2, item 8).  If you have an editor that handles binary files, you can even strip a PICT/JPEG file down
to JFIF by hand; see the next section for details.


News flash: the ISO JPEG committee seems to have won their turf wars.  They have defined a complete file format
spec called SPIFF in the new &quotart 3" extensions to the JPEG standard.  It's pretty late in the game though, so whether
this will have much impact on real-world files remains to be seen. SPIFF is upward compatible with JFIF, so if it does
get widely adopted, most users probably won't even notice.
努力打造安富莱高质量微信公众号:点击扫描图片关注
回复

使用道具 举报

740

主题

1326

回帖

3546

积分

管理员

春暖花开

Rank: 9Rank: 9Rank: 9

积分
3546
QQ
 楼主| 发表于 2015-5-6 17:49:12 | 显示全部楼层
                                             Section 14—文件格式

    严格的说,JPEG仅仅指的是一系列的压缩算法;而不是图像的特定格式。JPEG委员会在国际标准组织的争夺战中
曾被阻止去定义文件格式。


    既然只有我们同意一个共同的文件格式时,才能与其他人真正地交换图像,那么问题随之而来。没有官方的标准,
一些JPEG的程序编写人员按照自己的标准去进行操作,而作为结果,他们的程序不会符合任何人的兼容。


     最接近标准JPEG格式的是被C-Cube Microsystems公司的人协调好的一些工作。他们已定义了两个基于JPEG的文件
格式:
        * JFIF (JPEG File Interchange Format),一个只能传输像素的“低端”格式。
        * TIFF/JPEG,又称TIFF 6.0Aldus TIFF格式的扩展。TIFF是一种可以让你记录你想知道的所有图像信息的格
式,并且还能做到更多。

    JFIF已成为因特网上的实际标准,也是“JPEG文件”最通常的所指。绝不部分的JFIF读取器还能处理一些“非常不符
JFIF标准”的变种格式。


    整合JPEGTIFF 6.0规范没有被广泛实施,部分原因在于它有一些严重的设计缺陷。修订后的TIFF/JPEG设计现在
TIFF Technical Note #2所说明;这样的设计将在TIFF 7.0中使用。新的TIFF操作应该使用技术说明的设计来嵌入
JPEG,而不是TIFF 6.0设计。(据我所知,NeXTStep的系统是唯一可以显著利用TIFF 6.0类型的TIFF/ JPEG)。即使
TIFF/JPEG是稳定的,它也不会像JFIF一样被广泛应用。TIFF远比JFIF更加复杂,而且通常更少用于传输,是因为不
同的供应商通常执行略有不同的、不重复的TIFF子集。因此,加入JPEG没有任何帮助。


    苹果公司的Mac QuickTime软件使用包裹于Mac专用PICT格式里兼容的JFIF数据流。JFIFPICT/ JPEG之间的转换
是非常简单的,而且几个Mac程序都可以做到这一点(见 part 2, item 8)。如果你有一个处理二进制文件的编辑器,你甚
至可以亲手剥离一个PICT/ JPEG文件只剩下JFIF;请参阅下一节的详细信息。


    快讯:ISO JPEG委员会似乎已经赢得了他们的争夺战。他们已经定义了一个完整的文件格式规范—SPIFF,可见于
Part 3部分的JPEG标准扩展。这结果已经很晚了,那么这是否会对现实世界的文件太大的影响还有待观察。SPIFF向上兼
容于JFIF,所以如果它就算得到广泛采用,大部分的用户可能也不会注意到。
努力打造安富莱高质量微信公众号:点击扫描图片关注
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-5-12 11:12 , Processed in 0.241472 second(s), 25 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表