“JPG”/“JPEG”/“PNG”/“BMP”/“GIF”/“TIFF”图像有什么区别?

时间:2021-12-30 16:18:44

I have seen many types of image extensions but have never understood the real differences between them. Are there any links out there that clearly explain their differences?

我见过许多类型的图像扩展,但从未理解它们之间的真正差异。有没有明确解释其差异的链接?

Are there standards to consider when choosing a particular type of image to use in an application? What do we use for web applications?

在选择要在应用程序中使用的特定类型的图像时是否需要考虑标准?我们将什么用于Web应用程序?

11 个解决方案

#1


Yes. They are different file formats (and their file extensions).

是。它们是不同的文件格式(及其文件扩展名)。

Wikipedia entries for each of the formats will give you quite a bit of information:

每种格式的*条目将为您提供相当多的信息:

  • JPEG (or JPG, for the file extension; Joint Photographic Experts Group)
  • JPEG(或JPG,用于文件扩展名;联合图像专家组)

  • PNG (Portable Network Graphics)
  • PNG(便携式网络图形)

  • BMP (Bitmap)
  • GIF (Graphics Interchange Format)
  • GIF(图形交换格式)

  • TIFF (or TIF, for the file extension; Tagged Image File Format)
  • TIFF(或TIF,用于文件扩展名;标记图像文件格式)

Image formats can be separated into three broad categories:

图像格式可分为三大类:

  • lossy compression,
  • lossless compression,
  • uncompressed,

Uncompressed formats take up the most amount of data, but they are exact representations of the image. Bitmap formats such as BMP generally are uncompressed, although there also are compressed BMP files as well.

未压缩格式占用的数据量最多,但它们是图像的精确表示。 BMP等位图格式通常是未压缩的,但也有压缩的BMP文件。

Lossy compression formats are generally suited for photographs. It is not suited for illustrations, drawings and text, as compression artifacts from compressing the image will standout. Lossy compression, as its name implies, does not encode all the information of the file, so when it is recovered into an image, it will not be an exact representation of the original. However, it is able to compress images very effectively compared to lossless formats, as it discards certain information. A prime example of a lossy compression format is JPEG.

有损压缩格式通常适用于照片。它不适用于插图,绘图和文本,因为压缩图像的压缩瑕疵会很突出。正如其名称所暗示的,有损压缩不会对文件的所有信息进行编码,因此当它被恢复到图像中时,它将不是原始文件的精确表示。但是,与无损格式相比,它能够非常有效地压缩图像,因为它丢弃了某些信息。有损压缩格式的一个主要示例是JPEG。

Lossless compression formats are suited for illustrations, drawings, text and other material that would not look good when compressed with lossy compression. As the name implies, lossless compression will encode all the information from the original, so when the image is decompressed, it will be an exact representation of the original. As there is no loss of information in lossless compression, it is not able to achieve as high a compression as lossy compression, in most cases. Examples of lossless image compression is PNG and GIF. (GIF only allows 8-bit images.)

无损压缩格式适用于插图,绘图,文本和其他材料,这些材料在使用有损压缩进行压缩时效果不佳。顾名思义,无损压缩将对原始信息进行编码,因此当图像被解压缩时,它将是原始图像的精确表示。由于无损压缩中没有信息丢失,因此在大多数情况下,它无法实现与有损压缩一样高的压缩。无损图像压缩的示例是PNG和GIF。 (GIF只允许8位图像。)

TIFF and BMP are both "wrapper" formats, as the data inside can depend upon the compression technique that is used. It can contain both compressed and uncompressed images.

TIFF和BMP都是“包装”格式,因为内部数据可能取决于所使用的压缩技术。它可以包含压缩和未压缩的图像。

When to use a certain image compression format really depends on what is being compressed.

何时使用某种图像压缩格式实际上取决于正在压缩的内容。

Related question: Ruthlessly compressing large images for the web

相关问题:无情地为网络压缩大图像

#2


You should be aware of a few key factors...

你应该知道一些关键因素......

First, there are two types of compression: Lossless and Lossy.

首先,有两种类型的压缩:无损和有损。

Lossless means that the image is made smaller, but at no detriment to the quality. Lossy means the image is made (even) smaller, but at a detriment to the quality. If you saved an image in a Lossy format over and over, the image quality would get progressively worse and worse.

无损意味着图像变小,但不会对质量造成损害。有损意味着图像(甚至)变小,但对质量有害。如果您一次又一次地以有损格式保存图像,图像质量会越来越差。

There are also different colour depths (palettes): Indexed color and Direct color.

还有不同的颜色深度(调色板):索引颜色和直接颜色。

With Indexed it means that the image can only store a limited number of colours (usually 256) that are chosen by the image author, with Direct it means that you can store many thousands of colours that have not been chosen by the author.

使用Indexed意味着图像只能存储图像作者选择的有限数量的颜色(通常为256),而Direct表示您可以存储数千种作者未选择的颜色。


BMP - Lossless / Indexed and Direct

BMP - 无损/索引和直接

This is an old format. It is Lossless (no image data is lost on save) but there's also little to no compression at all, meaning saving as BMP results in VERY large file sizes. It can have palettes of both Indexed and Direct, but that's a small consolation. The file sizes are so unnecessarily large that nobody ever really uses this format.

这是一种旧格式。它是无损的(保存时没有图像数据丢失),但也几乎没有压缩,这意味着保存为BMP导致非常大的文件大小。它可以有Indexed和Direct的调色板,但这是一个小小的安慰。文件大小非常大,以至于没有人真正使用过这种格式。

Good for: Nothing really. There isn't anything BMP excels at, or isn't done better by other formats.

适用于:没什么。没有任何BMP擅长的东西,或者其他格式没有做得更好。

“JPG”/“JPEG”/“PNG”/“BMP”/“GIF”/“TIFF”图像有什么区别?


GIF - Lossless / Indexed only

GIF - 仅限无损/索引

GIF uses lossless compression, meaning that you can save the image over and over and never lose any data. The file sizes are much smaller than BMP, because good compression is actually used, but it can only store an Indexed palette. This means that there can only be a maximum of 256 different colours in the file. That sounds like quite a small amount, and it is.

GIF使用无损压缩,这意味着您可以反复保存图像,而不会丢失任何数据。文件大小远小于BMP,因为实际使用了良好的压缩,但它只能存储索引调色板。这意味着文件中最多只能有256种不同的颜色。这听起来很少,而且确实如此。

GIF images can also be animated and have transparency.

GIF图像也可以设置动画并具有透明度。

Good for: Logos, line drawings, and other simple images that need to be small. Only really used for websites.

适合:标识,线条图和其他需要小的简单图像。只是真正用于网站。

“JPG”/“JPEG”/“PNG”/“BMP”/“GIF”/“TIFF”图像有什么区别?


JPEG - Lossy / Direct

JPEG - 有损/直接

JPEGs images were designed to make detailed photographic images as small as possible by removing information that the human eye won't notice. As a result it's a Lossy format, and saving the same file over and over will result in more data being lost over time. It has a palette of thousands of colours and so is great for photographs, but the lossy compression means it's bad for logos and line drawings: Not only will they look fuzzy, but such images will also have a larger file-size compared to GIFs!

JPEG图像旨在通过删除人眼不会注意到的信息,使详细的摄影图像尽可能小。因此,它是一种有损格式,并且反复保存相同的文件将导致更多数据随着时间的推移而丢失。它有数千种颜色的调色板,因此非常适合拍摄照片,但有损压缩意味着它对徽标和线条图不利:它们不仅看起来模糊,而且与GIF相比,这些图像也会有更大的文件大小!

Good for: Photographs. Also, gradients.

适合:照片。此外,渐变。

“JPG”/“JPEG”/“PNG”/“BMP”/“GIF”/“TIFF”图像有什么区别?


PNG-8 - Lossless / Indexed

PNG-8 - 无损/索引

PNG is a newer format, and PNG-8 (the indexed version of PNG) is really a good replacement for GIFs. Sadly, however, it has a few drawbacks: Firstly it cannot support animation like GIF can (well it can, but only Firefox seems to support it, unlike GIF animation which is supported by every browser). Secondly it has some support issues with older browsers like IE6. Thirdly, important software like Photoshop have very poor implementation of the format. (Damn you, Adobe!) PNG-8 can only store 256 colours, like GIFs.

PNG是一种较新的格式,PNG-8(PNG的索引版本)确实是GIF的良好替代品。然而,遗憾的是,它有一些缺点:首先它不能像GIF那样支持动画(好吧它可以,但只有Firefox似乎支持它,不像每个浏览器都支持的GIF动画)。其次,它与IE6等旧浏览器有一些支持问题。第三,像Photoshop这样的重要软件的格式实现很差。 (该死的,Adobe!)PNG-8只能存储256种颜色,比如GIF。

Good for: The main thing that PNG-8 does better than GIFs is having support for Alpha Transparency.

适合:PNG-8比GIF更好的主要因素是支持Alpha Transparency。

“JPG”/“JPEG”/“PNG”/“BMP”/“GIF”/“TIFF”图像有什么区别?

Important Note: Photoshop does not support Alpha Transparency for PNG-8 files. (Damn you, Photoshop!) There are ways to convert Photoshop PNG-24 to PNG-8 files while retaining their transparency, though. One method is PNGQuant, another is to save your files with Fireworks.

重要说明:Photoshop不支持PNG-8文件的Alpha透明度。 (该死的,Photoshop!)有很多方法可以将Photoshop PNG-24转换为PNG-8文件,同时保留其透明度。一种方法是PNGQuant,另一种方法是使用Fireworks保存文件。


PNG-24 - Lossless / Direct

PNG-24 - 无损/直接

PNG-24 is a great format that combines Lossless encoding with Direct color (thousands of colours, just like JPEG). It's very much like BMP in that regard, except that PNG actually compresses images, so it results in much smaller files. Unfortunately PNG-24 files will still be much bigger than JPEGs, GIFs and PNG-8s, so you still need to consider if you really want to use one.

PNG-24是一种很好的格式,它将无损编码与直接色彩(数千种颜色,就像JPEG)相结合。在这方面它非常像BMP,除了PNG实际上压缩图像,因此它会产生更小的文件。不幸的是,PNG-24文件仍然比JPEG,GIF和PNG-8大得多,所以你仍然需要考虑是否真的想要使用它。

Even though PNG-24s allow thousands of colours while having compression, they are not intended to replace JPEG images. A photograph saved as a PNG-24 will likely be at least 5 times larger than a equivalent JPEG image, which very little improvement in visible quality. (Of course, this may be a desirable outcome if you're not concerned about filesize, and want to get the best quality image you can.)

尽管PNG-24在压缩时允许数千种颜色,但它们并不是要取代JPEG图像。保存为PNG-24的照片可能至少比同等JPEG图像大5倍,这对可见光质量的改善很小。 (当然,如果您不关心文件大小,并希望获得最佳质量的图像,这可能是一个理想的结果。)

Just like PNG-8, PNG-24 supports alpha-transparency, too.

就像PNG-8一样,PNG-24也支持alpha透明度。

I hope that helps!

我希望有所帮助!

#3


Generally these are either:

通常这些是:

Lossless compression Lossless compression algorithms reduce file size without losing image quality, though they are not compressed into as small a file as a lossy compression file. When image quality is valued above file size, lossless algorithms are typically chosen.

无损压缩无损压缩算法可以在不损失图像质量的情况下减小文件大小,但它们不会像压缩文件那样压缩成小文件。当图像质量高于文件大小时,通常选择无损算法。

Lossy compression Lossy compression algorithms take advantage of the inherent limitations of the human eye and discard invisible information. Most lossy compression algorithms allow for variable quality levels (compression) and as these levels are increased, file size is reduced. At the highest compression levels, image deterioration becomes noticeable as "compression artifacting". The images below demonstrate the noticeable artifacting of lossy compression algorithms; select the thumbnail image to view the full size version.

有损压缩有损压缩算法利用人眼固有的局限性并丢弃不可见信息。大多数有损压缩算法允许可变质量级别(压缩),并且随着这些级别的增加,文件大小也会减小。在最高压缩级别,图像劣化变得明显为“压缩伪像”。下面的图像展示了有损压缩算法的明显伪像;选择缩略图图像以查看完整大小的版本。

Each format is different as described below:

每种格式都不同,如下所述:

JPEG JPEG (Joint Photographic Experts Group) files are (in most cases) a lossy format; the DOS filename extension is JPG (other OS might use JPEG). Nearly every digital camera can save images in the JPEG format, which supports 8 bits per color (red, green, blue) for a 24-bit total, producing relatively small files. When not too great, the compression does not noticeably detract from the image's quality, but JPEG files suffer generational degradation when repeatedly edited and saved. Photographic images may be better stored in a lossless non-JPEG format if they will be re-edited, or if small "artifacts" (blemishes caused by the JPEG's compression algorithm) are unacceptable. The JPEG format also is used as the image compression algorithm in many Adobe PDF files.

JPEG JPEG(联合图像专家组)文件(在大多数情况下)是有损格式; DOS文件扩展名是JPG(其他操作系统可能使用JPEG)。几乎每个数码相机都可以保存JPEG格式的图像,每种颜色支持8位(红色,绿色,蓝色),总共24位,产生相对较小的文件。如果不是太大,压缩不会明显降低图像的质量,但JPEG文件在重复编辑和保存时会遭受世代性的降级。如果拍摄图像将被重新编辑,或者如果小的“伪像”(由JPEG的压缩算法引起的瑕疵)是不可接受的,则可以以无损非JPEG格式更好地存储摄影图像。 JPEG格式也用作许多Adobe PDF文件中的图像压缩算法。

TIFF The TIFF (Tagged Image File Format) is a flexible format that normally saves 8 bits or 16 bits per color (red, green, blue) for 24-bit and 48-bit totals, respectively, using either the TIFF or the TIF filenames. The TIFF's flexibility is both blessing and curse, because no single reader reads every type of TIFF file. TIFFs are lossy and lossless; some offer relatively good lossless compression for bi-level (black&white) images. Some digital cameras can save in TIFF format, using the LZW compression algorithm for lossless storage. The TIFF image format is not widely supported by web browsers. TIFF remains widely accepted as a photograph file standard in the printing business. The TIFF can handle device-specific colour spaces, such as the CMYK defined by a particular set of printing press inks.

TIFF TIFF(标记图像文件格式)是一种灵活的格式,通常可以使用TIFF或TIF文件名为24位和48位总计每种颜色(红色,绿色,蓝色)保存8位或16位。 TIFF的灵活性既有祝福又有诅咒,因为没有一个读者可以读取每种类型的TIFF文件。 TIFF是有损无损的;有些为双层(黑白)图像提供了相对良好的无损压缩。一些数码相机可以使用LZW压缩算法进行无损存储,以TIFF格式保存。 Web浏览器不广泛支持TIFF图像格式。 TIFF仍然被广泛接受为印刷业务中的照片文件标准。 TIFF可以处理特定于设备的颜色空间,例如由特定印刷机墨水定义的CMYK。

PNG The PNG (Portable Network Graphics) file format was created as the free, open-source successor to the GIF. The PNG file format supports truecolor (16 million colours) while the GIF supports only 256 colours. The PNG file excels when the image has large, uniformly coloured areas. The lossless PNG format is best suited for editing pictures, and the lossy formats, like JPG, are best for the final distribution of photographic images, because JPG files are smaller than PNG files. Many older browsers currently do not support the PNG file format, however, with Internet Explorer 7, all contemporary web browsers fully support the PNG format. The Adam7-interlacing allows an early preview, even when only a small percentage of the image data has been transmitted.

PNG PNG(可移植网络图形)文件格式是作为GIF的免费开源继承者创建的。 PNG文件格式支持truecolor(1600万种颜色),而GIF仅支持256种颜色。当图像具有大而均匀着色的区域时,PNG文件表现优异。无损PNG格式最适合编辑图片,而有损格式(如JPG)最适合最终分发摄影图像,因为JPG文件比PNG文件小。许多旧版浏览器目前不支持PNG文件格式,但是,对于Internet Explorer 7,所有当代Web浏览器都完全支持PNG格式。即使只传输了一小部分图像数据,Adam7隔行扫描也可以进行早期预览。

GIF GIF (Graphics Interchange Format) is limited to an 8-bit palette, or 256 colors. This makes the GIF format suitable for storing graphics with relatively few colors such as simple diagrams, shapes, logos and cartoon style images. The GIF format supports animation and is still widely used to provide image animation effects. It also uses a lossless compression that is more effective when large areas have a single color, and ineffective for detailed images or dithered images.

GIF GIF(图形交换格式)仅限于8位调色板或256色。这使得GIF格式适合于存储具有相对较少颜色的图形,例如简单的图表,形状,徽标和卡通风格图像。 GIF格式支持动画,并且仍广泛用于提供图像动画效果。它还使用无损压缩,当大区域具有单一颜色时更有效,并且对于详细图像或抖动图像无效。

BMP The BMP file format (Windows bitmap) handles graphics files within the Microsoft Windows OS. Typically, BMP files are uncompressed, hence they are large; the advantage is their simplicity, wide acceptance, and use in Windows programs.

BMP BMP文件格式(Windows位图)处理Microsoft Windows操作系统中的图形文件。通常,BMP文件是未压缩的,因此它们很大;优点是它们的简单性,广泛接受性以及在Windows程序中的使用。

Use for Web Pages / Web Applications

用于网页/ Web应用程序

The following is a brief summary for these image formats when using them with a web page / application.

以下是这些图像格式与网页/应用程序一起使用时的简短摘要。

  • PNG is great for IE6 and up (will require a small CSS patch to get transparency working well). Great for illustrations and photos.
  • PNG非常适合IE6及以上版本(需要一个小的CSS补丁来提高透明度)。非常适合插图和照片。

  • JPG is great for photos online
  • JPG非常适合在线拍照

  • GIF is good for illustrations when you do not wish to move to PNG
  • 当您不想移动到PNG时,GIF适用于插图

  • BMP shouldn't be used online within web pages - wastes bandwidth
  • 不应在网页中在线使用BMP - 浪费带宽



    Source: Image File Formats

    来源:图像文件格式

    #4


    Since others have covered the differences, I'll hit the uses.

    由于其他人已经涵盖了差异,我将达到用途。

    TIFF is usually used by scanners. It makes huge files and is not really used in applications.

    TIFF通常由扫描仪使用。它生成大文件,并没有真正用于应用程序。

    BMP is uncompressed and also makes huge files. It is also not really used in applications.

    BMP是未压缩的,也可以生成大文件。它也没有真正用于应用程序。

    GIF used to be all over the web but has fallen out of favor since it only supports a limited number of colors and is patented.

    GIF曾经遍布网络,但已经失宠,因为它只支持有限数量的颜色并获得专利。

    JPG/JPEG is mainly used for anything that is photo quality, though not for text. The lossy compression used tends to mar sharp lines.

    JPG / JPEG主要用于任何照片质量,但不适用于文字。使用的有损压缩倾向于破坏尖锐的线条。

    PNG isn't as small as JPEG but is lossless so it's good for images with sharp lines. It's in common use on the web now.

    PNG不像JPEG那么小,但是无损,所以它对于线条清晰的图像很有用。它现在在网络上很常见。

    Personally, I usually use PNG everywhere I can. It's a good compromise between JPG and GIF.

    就个人而言,我经常在任何地方使用PNG。这是JPG和GIF之间的妥协。

    #5


    JPG > Joint Photographic Experts Group

    JPG>联合图像专家组

    1 JPG images support 16 million colors and are best suited for photographs and complex graphics

    1张JPG图像支持1600万种颜色,最适合照片和复杂图形

    2 JPGs do not support transparency.

    2 JPG不支持透明度。

    PNG > Portable Network Graphics

    PNG>便携式网络图形

    1 It's used as an alternative to the GIF file format when the GIF technology was copyrighted and required permission to use.

    1当GIF技术受版权保护且需要使用许可时,它可用作GIF文件格式的替代品。

    2 PNGs allow for 5 to 25 percent greater compression than GIFs, and with a wider range of colors. PNGs use two-dimensional interlacing, which makes them load twice as fast as GIF images.”

    2个PNG比GIF具有5到25%的压缩,并且具有更广泛的颜色。 PNG使用二维隔行扫描,这使得它们的加载速度是GIF图像的两倍。“

    3 Image that has a lot of colors or requires advanced variable transparency, PNG is the preferred file type.

    3具有大量颜色或需要高级可变透明度的图像,PNG是首选文件类型。

    GIF > Graphics Interchange Format

    GIF>图形交换格式

    1 Reduces the number of colors in an image to 256.

    1将图像中的颜色数减少到256。

    2 GIFs also support transparency.

    2个GIF也支持透明度。

    3 GIFs have the unique ability to display a sequence of images, similar to videos, called an animated GIF.

    3个GIF具有显示图像序列的独特能力,类似于视频,称为动画GIF。

    4 If the image has few colors and does not require any advanced alpha transparency effect, GIF is the way to go.

    4如果图像颜色较少且不需要任何高级Alpha透明效果,则可以使用GIF。

    SVG > Scalable Vector Graphics

    SVG>可缩放矢量图形

    1 SVGs are a web standard based on XML that describe both static images and animations in two dimensions.

    1 SVG是基于XML的Web标准,它描述了二维静态图像和动画。

    2 SVG allows you to create very high-quality graphics and animations that do not lose detail as their size increases/decreases.

    2 SVG允许您创建非常高质量的图形和动画,这些图形和动画在大小增加/减少时不会丢失细节。

    #6


    These names refers to different ways to encode pixel image data (JPG and JPEG are the same thing, and TIFF may just enclose a jpeg with some additional metadata).

    这些名称指的是对像素图像数据进行编码的不同方式(JPG和JPEG是相同的,TIFF可能只包含带有一些额外元数据的jpeg)。

    These image formats may use different compression algorithms, different color representations, different capability in carrying additional data other than the image itself, and so on.

    这些图像格式可以使用不同的压缩算法,不同的颜色表示,携带除图像本身之外的附加数据的不同能力,等等​​。

    For web applications, I'd say jpeg or gif is good enough. Jpeg is used more often due to its higher compression ratio, and gif is typically used for light weight animation where a flash (or something similar) is an over kill, or places where transparent background is desired. PNG can be used too, but I don't have much experience with that. BMP and TIFF probably are not good candidates for web applications.

    对于Web应用程序,我会说jpeg或gif足够好。 Jpeg由于其较高的压缩比而被更频繁地使用,并且gif通常用于轻量级动画,其中闪光(或类似的东西)是过度杀戮,或者需要透明背景的地方。 PNG也可以使用,但我没有太多经验。 BMP和TIFF可能不适合Web应用程序。

    #7


    What coobird and Gerald said.

    coobird和Gerald说的是什么。

    Additionally, JPEG is the file format name. JPG is commonly used abbreviated file extension for this format, as you needed to have a 3-letter file extension for earlier Windows systems. Likewise with TIFF and TIF.

    此外,JPEG是文件格式名称。 JPG是此格式的常用缩写文件扩展名,因为您需要为早期Windows系统提供3个字母的文件扩展名。与TIFF和TIF相同。

    Web browsers at the moment only display JPEG, PNG and GIF files - so those are the ones that can be shown on web pages.

    目前,Web浏览器只显示JPEG,PNG和GIF文件 - 因此可以在网页上显示这些文件。

    #8


    PNG supports alphachannel transparency.

    PNG支持alphachannel透明度。

    TIFF can have extended options I.e. Geo referencing for GIS applications.

    TIFF可以有扩展选项I.e. GIS应用程序的地理参考。

    I recommend only ever using JPEG for photographs, never for images like clip art, logos, text, diagrams, line art.

    我建议只使用JPEG作为照片,永远不要用于剪贴画,徽标,文字,图表,艺术线条等图像。

    Favor PNG.

    #9


    The named ones are all raster graphics, but beside that don't forget the more and more important vectorgraphics. There are compressed and uncompressed types (in a more or less way), but they're all lossless. Most important are:

    命名的都是光栅图形,但除此之外不要忘记越来越重要的矢量图形。有压缩和未压缩类型(或多或少),但它们都是无损的。最重要的是:

    #10


    The file extension tells you how the image is saved. Some of those formats just save the bits as they are, some compress the image in different ways, including lossless and lossy methods. The Web can tell you, although I know some of the patient responders will outline them here.

    文件扩展名告诉您图像的保存方式。其中一些格式只是按原样保存位,有些以不同方式压缩图像,包括无损和有损方法。网络可以告诉你,虽然我知道一些患者响应者会在这里概述它们。

    The web favors gif, jpg, and png, mostly. JPEG is the same (or very close) to jpg.

    网络主要支持gif,jpg和png。 JPEG与jpg相同(或非常接近)。

    #11


    For the specified difference and usage between the varies of image formats have a good discussion above already.

    对于指定的差异和各种图像格式之间的用法已经在上面进行了很好的讨论。

    However, I want to add something for the overall process of capturing a picture and storing them.

    但是,我想为捕获图片和存储图片的整个过程添加一些内容。

    The capturing process

    Or you can say the construct process(as we can draw or make pictures with computers now). If you take a photograph with a camera, you are already using lots of sensors(CCD or CMOS) and algorithms(Bayer Pattern Filter, Sub-sampling and quantization, etc.) Also there are stuff like Pixel Format and Color Space. After you got the basic pixel information, there must be a way for storing them.

    或者你可以说构造过程(因为我们现在可以用计算机绘制或制作图片)。如果你用相机拍照,你已经使用了很多传感器(CCD或CMOS)和算法(拜耳模式滤镜,子采样和量化等)。还有像像素格式和色彩空间这样的东西。获得基本像素信息后,必须有一种方法来存储它们。

    The basic image file structure

    For storing the pixels info a file, we need a convention and related algorithms. For saving space, there are compression, but basically problem is encoding the pixels to bytes and decoding the bytes to pixels for display.

    为了将像素信息存储到文件中,我们需要约定和相关算法。为了节省空间,存在压缩,但基本上问题是将像素编码为字节并将字节解码为像素以供显示。

    A typical image file may be consisted by several parts, basically two:meta data or file header and pixel data section. The meta data tells about the image itself, maybe height and width, file format, etc. And the pixel data section is the real section who deals with the real picture.

    典型的图像文件可以由几个部分组成,基本上是两个部分:元数据或文件头和像素数据部分。元数据讲述了图像本身,可能是高度和宽度,文件格式等。像素数据部分是处理真实图像的真实部分。

    Storing and Displaying

    As we said earlier, files are stored in hard disk and are in bytes/bits. So image files have no priority but also bytes stream actually. For displaying, maybe we should get something to know how monitor works. Typical PC monitors use RGB model for displaying.

    如前所述,文件存储在硬盘中,以字节/位为单位。因此图像文件没有优先级,但实际上也是字节流。对于显示,也许我们应该知道监视器如何工作。典型的PC监视器使用RGB模型进行显示。

    Hope this helps:-)

    希望这可以帮助:-)

    #1


    Yes. They are different file formats (and their file extensions).

    是。它们是不同的文件格式(及其文件扩展名)。

    Wikipedia entries for each of the formats will give you quite a bit of information:

    每种格式的*条目将为您提供相当多的信息:

    • JPEG (or JPG, for the file extension; Joint Photographic Experts Group)
    • JPEG(或JPG,用于文件扩展名;联合图像专家组)

    • PNG (Portable Network Graphics)
    • PNG(便携式网络图形)

    • BMP (Bitmap)
    • GIF (Graphics Interchange Format)
    • GIF(图形交换格式)

    • TIFF (or TIF, for the file extension; Tagged Image File Format)
    • TIFF(或TIF,用于文件扩展名;标记图像文件格式)

    Image formats can be separated into three broad categories:

    图像格式可分为三大类:

    • lossy compression,
    • lossless compression,
    • uncompressed,

    Uncompressed formats take up the most amount of data, but they are exact representations of the image. Bitmap formats such as BMP generally are uncompressed, although there also are compressed BMP files as well.

    未压缩格式占用的数据量最多,但它们是图像的精确表示。 BMP等位图格式通常是未压缩的,但也有压缩的BMP文件。

    Lossy compression formats are generally suited for photographs. It is not suited for illustrations, drawings and text, as compression artifacts from compressing the image will standout. Lossy compression, as its name implies, does not encode all the information of the file, so when it is recovered into an image, it will not be an exact representation of the original. However, it is able to compress images very effectively compared to lossless formats, as it discards certain information. A prime example of a lossy compression format is JPEG.

    有损压缩格式通常适用于照片。它不适用于插图,绘图和文本,因为压缩图像的压缩瑕疵会很突出。正如其名称所暗示的,有损压缩不会对文件的所有信息进行编码,因此当它被恢复到图像中时,它将不是原始文件的精确表示。但是,与无损格式相比,它能够非常有效地压缩图像,因为它丢弃了某些信息。有损压缩格式的一个主要示例是JPEG。

    Lossless compression formats are suited for illustrations, drawings, text and other material that would not look good when compressed with lossy compression. As the name implies, lossless compression will encode all the information from the original, so when the image is decompressed, it will be an exact representation of the original. As there is no loss of information in lossless compression, it is not able to achieve as high a compression as lossy compression, in most cases. Examples of lossless image compression is PNG and GIF. (GIF only allows 8-bit images.)

    无损压缩格式适用于插图,绘图,文本和其他材料,这些材料在使用有损压缩进行压缩时效果不佳。顾名思义,无损压缩将对原始信息进行编码,因此当图像被解压缩时,它将是原始图像的精确表示。由于无损压缩中没有信息丢失,因此在大多数情况下,它无法实现与有损压缩一样高的压缩。无损图像压缩的示例是PNG和GIF。 (GIF只允许8位图像。)

    TIFF and BMP are both "wrapper" formats, as the data inside can depend upon the compression technique that is used. It can contain both compressed and uncompressed images.

    TIFF和BMP都是“包装”格式,因为内部数据可能取决于所使用的压缩技术。它可以包含压缩和未压缩的图像。

    When to use a certain image compression format really depends on what is being compressed.

    何时使用某种图像压缩格式实际上取决于正在压缩的内容。

    Related question: Ruthlessly compressing large images for the web

    相关问题:无情地为网络压缩大图像

    #2


    You should be aware of a few key factors...

    你应该知道一些关键因素......

    First, there are two types of compression: Lossless and Lossy.

    首先,有两种类型的压缩:无损和有损。

    Lossless means that the image is made smaller, but at no detriment to the quality. Lossy means the image is made (even) smaller, but at a detriment to the quality. If you saved an image in a Lossy format over and over, the image quality would get progressively worse and worse.

    无损意味着图像变小,但不会对质量造成损害。有损意味着图像(甚至)变小,但对质量有害。如果您一次又一次地以有损格式保存图像,图像质量会越来越差。

    There are also different colour depths (palettes): Indexed color and Direct color.

    还有不同的颜色深度(调色板):索引颜色和直接颜色。

    With Indexed it means that the image can only store a limited number of colours (usually 256) that are chosen by the image author, with Direct it means that you can store many thousands of colours that have not been chosen by the author.

    使用Indexed意味着图像只能存储图像作者选择的有限数量的颜色(通常为256),而Direct表示您可以存储数千种作者未选择的颜色。


    BMP - Lossless / Indexed and Direct

    BMP - 无损/索引和直接

    This is an old format. It is Lossless (no image data is lost on save) but there's also little to no compression at all, meaning saving as BMP results in VERY large file sizes. It can have palettes of both Indexed and Direct, but that's a small consolation. The file sizes are so unnecessarily large that nobody ever really uses this format.

    这是一种旧格式。它是无损的(保存时没有图像数据丢失),但也几乎没有压缩,这意味着保存为BMP导致非常大的文件大小。它可以有Indexed和Direct的调色板,但这是一个小小的安慰。文件大小非常大,以至于没有人真正使用过这种格式。

    Good for: Nothing really. There isn't anything BMP excels at, or isn't done better by other formats.

    适用于:没什么。没有任何BMP擅长的东西,或者其他格式没有做得更好。

    “JPG”/“JPEG”/“PNG”/“BMP”/“GIF”/“TIFF”图像有什么区别?


    GIF - Lossless / Indexed only

    GIF - 仅限无损/索引

    GIF uses lossless compression, meaning that you can save the image over and over and never lose any data. The file sizes are much smaller than BMP, because good compression is actually used, but it can only store an Indexed palette. This means that there can only be a maximum of 256 different colours in the file. That sounds like quite a small amount, and it is.

    GIF使用无损压缩,这意味着您可以反复保存图像,而不会丢失任何数据。文件大小远小于BMP,因为实际使用了良好的压缩,但它只能存储索引调色板。这意味着文件中最多只能有256种不同的颜色。这听起来很少,而且确实如此。

    GIF images can also be animated and have transparency.

    GIF图像也可以设置动画并具有透明度。

    Good for: Logos, line drawings, and other simple images that need to be small. Only really used for websites.

    适合:标识,线条图和其他需要小的简单图像。只是真正用于网站。

    “JPG”/“JPEG”/“PNG”/“BMP”/“GIF”/“TIFF”图像有什么区别?


    JPEG - Lossy / Direct

    JPEG - 有损/直接

    JPEGs images were designed to make detailed photographic images as small as possible by removing information that the human eye won't notice. As a result it's a Lossy format, and saving the same file over and over will result in more data being lost over time. It has a palette of thousands of colours and so is great for photographs, but the lossy compression means it's bad for logos and line drawings: Not only will they look fuzzy, but such images will also have a larger file-size compared to GIFs!

    JPEG图像旨在通过删除人眼不会注意到的信息,使详细的摄影图像尽可能小。因此,它是一种有损格式,并且反复保存相同的文件将导致更多数据随着时间的推移而丢失。它有数千种颜色的调色板,因此非常适合拍摄照片,但有损压缩意味着它对徽标和线条图不利:它们不仅看起来模糊,而且与GIF相比,这些图像也会有更大的文件大小!

    Good for: Photographs. Also, gradients.

    适合:照片。此外,渐变。

    “JPG”/“JPEG”/“PNG”/“BMP”/“GIF”/“TIFF”图像有什么区别?


    PNG-8 - Lossless / Indexed

    PNG-8 - 无损/索引

    PNG is a newer format, and PNG-8 (the indexed version of PNG) is really a good replacement for GIFs. Sadly, however, it has a few drawbacks: Firstly it cannot support animation like GIF can (well it can, but only Firefox seems to support it, unlike GIF animation which is supported by every browser). Secondly it has some support issues with older browsers like IE6. Thirdly, important software like Photoshop have very poor implementation of the format. (Damn you, Adobe!) PNG-8 can only store 256 colours, like GIFs.

    PNG是一种较新的格式,PNG-8(PNG的索引版本)确实是GIF的良好替代品。然而,遗憾的是,它有一些缺点:首先它不能像GIF那样支持动画(好吧它可以,但只有Firefox似乎支持它,不像每个浏览器都支持的GIF动画)。其次,它与IE6等旧浏览器有一些支持问题。第三,像Photoshop这样的重要软件的格式实现很差。 (该死的,Adobe!)PNG-8只能存储256种颜色,比如GIF。

    Good for: The main thing that PNG-8 does better than GIFs is having support for Alpha Transparency.

    适合:PNG-8比GIF更好的主要因素是支持Alpha Transparency。

    “JPG”/“JPEG”/“PNG”/“BMP”/“GIF”/“TIFF”图像有什么区别?

    Important Note: Photoshop does not support Alpha Transparency for PNG-8 files. (Damn you, Photoshop!) There are ways to convert Photoshop PNG-24 to PNG-8 files while retaining their transparency, though. One method is PNGQuant, another is to save your files with Fireworks.

    重要说明:Photoshop不支持PNG-8文件的Alpha透明度。 (该死的,Photoshop!)有很多方法可以将Photoshop PNG-24转换为PNG-8文件,同时保留其透明度。一种方法是PNGQuant,另一种方法是使用Fireworks保存文件。


    PNG-24 - Lossless / Direct

    PNG-24 - 无损/直接

    PNG-24 is a great format that combines Lossless encoding with Direct color (thousands of colours, just like JPEG). It's very much like BMP in that regard, except that PNG actually compresses images, so it results in much smaller files. Unfortunately PNG-24 files will still be much bigger than JPEGs, GIFs and PNG-8s, so you still need to consider if you really want to use one.

    PNG-24是一种很好的格式,它将无损编码与直接色彩(数千种颜色,就像JPEG)相结合。在这方面它非常像BMP,除了PNG实际上压缩图像,因此它会产生更小的文件。不幸的是,PNG-24文件仍然比JPEG,GIF和PNG-8大得多,所以你仍然需要考虑是否真的想要使用它。

    Even though PNG-24s allow thousands of colours while having compression, they are not intended to replace JPEG images. A photograph saved as a PNG-24 will likely be at least 5 times larger than a equivalent JPEG image, which very little improvement in visible quality. (Of course, this may be a desirable outcome if you're not concerned about filesize, and want to get the best quality image you can.)

    尽管PNG-24在压缩时允许数千种颜色,但它们并不是要取代JPEG图像。保存为PNG-24的照片可能至少比同等JPEG图像大5倍,这对可见光质量的改善很小。 (当然,如果您不关心文件大小,并希望获得最佳质量的图像,这可能是一个理想的结果。)

    Just like PNG-8, PNG-24 supports alpha-transparency, too.

    就像PNG-8一样,PNG-24也支持alpha透明度。

    I hope that helps!

    我希望有所帮助!

    #3


    Generally these are either:

    通常这些是:

    Lossless compression Lossless compression algorithms reduce file size without losing image quality, though they are not compressed into as small a file as a lossy compression file. When image quality is valued above file size, lossless algorithms are typically chosen.

    无损压缩无损压缩算法可以在不损失图像质量的情况下减小文件大小,但它们不会像压缩文件那样压缩成小文件。当图像质量高于文件大小时,通常选择无损算法。

    Lossy compression Lossy compression algorithms take advantage of the inherent limitations of the human eye and discard invisible information. Most lossy compression algorithms allow for variable quality levels (compression) and as these levels are increased, file size is reduced. At the highest compression levels, image deterioration becomes noticeable as "compression artifacting". The images below demonstrate the noticeable artifacting of lossy compression algorithms; select the thumbnail image to view the full size version.

    有损压缩有损压缩算法利用人眼固有的局限性并丢弃不可见信息。大多数有损压缩算法允许可变质量级别(压缩),并且随着这些级别的增加,文件大小也会减小。在最高压缩级别,图像劣化变得明显为“压缩伪像”。下面的图像展示了有损压缩算法的明显伪像;选择缩略图图像以查看完整大小的版本。

    Each format is different as described below:

    每种格式都不同,如下所述:

    JPEG JPEG (Joint Photographic Experts Group) files are (in most cases) a lossy format; the DOS filename extension is JPG (other OS might use JPEG). Nearly every digital camera can save images in the JPEG format, which supports 8 bits per color (red, green, blue) for a 24-bit total, producing relatively small files. When not too great, the compression does not noticeably detract from the image's quality, but JPEG files suffer generational degradation when repeatedly edited and saved. Photographic images may be better stored in a lossless non-JPEG format if they will be re-edited, or if small "artifacts" (blemishes caused by the JPEG's compression algorithm) are unacceptable. The JPEG format also is used as the image compression algorithm in many Adobe PDF files.

    JPEG JPEG(联合图像专家组)文件(在大多数情况下)是有损格式; DOS文件扩展名是JPG(其他操作系统可能使用JPEG)。几乎每个数码相机都可以保存JPEG格式的图像,每种颜色支持8位(红色,绿色,蓝色),总共24位,产生相对较小的文件。如果不是太大,压缩不会明显降低图像的质量,但JPEG文件在重复编辑和保存时会遭受世代性的降级。如果拍摄图像将被重新编辑,或者如果小的“伪像”(由JPEG的压缩算法引起的瑕疵)是不可接受的,则可以以无损非JPEG格式更好地存储摄影图像。 JPEG格式也用作许多Adobe PDF文件中的图像压缩算法。

    TIFF The TIFF (Tagged Image File Format) is a flexible format that normally saves 8 bits or 16 bits per color (red, green, blue) for 24-bit and 48-bit totals, respectively, using either the TIFF or the TIF filenames. The TIFF's flexibility is both blessing and curse, because no single reader reads every type of TIFF file. TIFFs are lossy and lossless; some offer relatively good lossless compression for bi-level (black&white) images. Some digital cameras can save in TIFF format, using the LZW compression algorithm for lossless storage. The TIFF image format is not widely supported by web browsers. TIFF remains widely accepted as a photograph file standard in the printing business. The TIFF can handle device-specific colour spaces, such as the CMYK defined by a particular set of printing press inks.

    TIFF TIFF(标记图像文件格式)是一种灵活的格式,通常可以使用TIFF或TIF文件名为24位和48位总计每种颜色(红色,绿色,蓝色)保存8位或16位。 TIFF的灵活性既有祝福又有诅咒,因为没有一个读者可以读取每种类型的TIFF文件。 TIFF是有损无损的;有些为双层(黑白)图像提供了相对良好的无损压缩。一些数码相机可以使用LZW压缩算法进行无损存储,以TIFF格式保存。 Web浏览器不广泛支持TIFF图像格式。 TIFF仍然被广泛接受为印刷业务中的照片文件标准。 TIFF可以处理特定于设备的颜色空间,例如由特定印刷机墨水定义的CMYK。

    PNG The PNG (Portable Network Graphics) file format was created as the free, open-source successor to the GIF. The PNG file format supports truecolor (16 million colours) while the GIF supports only 256 colours. The PNG file excels when the image has large, uniformly coloured areas. The lossless PNG format is best suited for editing pictures, and the lossy formats, like JPG, are best for the final distribution of photographic images, because JPG files are smaller than PNG files. Many older browsers currently do not support the PNG file format, however, with Internet Explorer 7, all contemporary web browsers fully support the PNG format. The Adam7-interlacing allows an early preview, even when only a small percentage of the image data has been transmitted.

    PNG PNG(可移植网络图形)文件格式是作为GIF的免费开源继承者创建的。 PNG文件格式支持truecolor(1600万种颜色),而GIF仅支持256种颜色。当图像具有大而均匀着色的区域时,PNG文件表现优异。无损PNG格式最适合编辑图片,而有损格式(如JPG)最适合最终分发摄影图像,因为JPG文件比PNG文件小。许多旧版浏览器目前不支持PNG文件格式,但是,对于Internet Explorer 7,所有当代Web浏览器都完全支持PNG格式。即使只传输了一小部分图像数据,Adam7隔行扫描也可以进行早期预览。

    GIF GIF (Graphics Interchange Format) is limited to an 8-bit palette, or 256 colors. This makes the GIF format suitable for storing graphics with relatively few colors such as simple diagrams, shapes, logos and cartoon style images. The GIF format supports animation and is still widely used to provide image animation effects. It also uses a lossless compression that is more effective when large areas have a single color, and ineffective for detailed images or dithered images.

    GIF GIF(图形交换格式)仅限于8位调色板或256色。这使得GIF格式适合于存储具有相对较少颜色的图形,例如简单的图表,形状,徽标和卡通风格图像。 GIF格式支持动画,并且仍广泛用于提供图像动画效果。它还使用无损压缩,当大区域具有单一颜色时更有效,并且对于详细图像或抖动图像无效。

    BMP The BMP file format (Windows bitmap) handles graphics files within the Microsoft Windows OS. Typically, BMP files are uncompressed, hence they are large; the advantage is their simplicity, wide acceptance, and use in Windows programs.

    BMP BMP文件格式(Windows位图)处理Microsoft Windows操作系统中的图形文件。通常,BMP文件是未压缩的,因此它们很大;优点是它们的简单性,广泛接受性以及在Windows程序中的使用。

    Use for Web Pages / Web Applications

    用于网页/ Web应用程序

    The following is a brief summary for these image formats when using them with a web page / application.

    以下是这些图像格式与网页/应用程序一起使用时的简短摘要。

  • PNG is great for IE6 and up (will require a small CSS patch to get transparency working well). Great for illustrations and photos.
  • PNG非常适合IE6及以上版本(需要一个小的CSS补丁来提高透明度)。非常适合插图和照片。

  • JPG is great for photos online
  • JPG非常适合在线拍照

  • GIF is good for illustrations when you do not wish to move to PNG
  • 当您不想移动到PNG时,GIF适用于插图

  • BMP shouldn't be used online within web pages - wastes bandwidth
  • 不应在网页中在线使用BMP - 浪费带宽



    Source: Image File Formats

    来源:图像文件格式

    #4


    Since others have covered the differences, I'll hit the uses.

    由于其他人已经涵盖了差异,我将达到用途。

    TIFF is usually used by scanners. It makes huge files and is not really used in applications.

    TIFF通常由扫描仪使用。它生成大文件,并没有真正用于应用程序。

    BMP is uncompressed and also makes huge files. It is also not really used in applications.

    BMP是未压缩的,也可以生成大文件。它也没有真正用于应用程序。

    GIF used to be all over the web but has fallen out of favor since it only supports a limited number of colors and is patented.

    GIF曾经遍布网络,但已经失宠,因为它只支持有限数量的颜色并获得专利。

    JPG/JPEG is mainly used for anything that is photo quality, though not for text. The lossy compression used tends to mar sharp lines.

    JPG / JPEG主要用于任何照片质量,但不适用于文字。使用的有损压缩倾向于破坏尖锐的线条。

    PNG isn't as small as JPEG but is lossless so it's good for images with sharp lines. It's in common use on the web now.

    PNG不像JPEG那么小,但是无损,所以它对于线条清晰的图像很有用。它现在在网络上很常见。

    Personally, I usually use PNG everywhere I can. It's a good compromise between JPG and GIF.

    就个人而言,我经常在任何地方使用PNG。这是JPG和GIF之间的妥协。

    #5


    JPG > Joint Photographic Experts Group

    JPG>联合图像专家组

    1 JPG images support 16 million colors and are best suited for photographs and complex graphics

    1张JPG图像支持1600万种颜色,最适合照片和复杂图形

    2 JPGs do not support transparency.

    2 JPG不支持透明度。

    PNG > Portable Network Graphics

    PNG>便携式网络图形

    1 It's used as an alternative to the GIF file format when the GIF technology was copyrighted and required permission to use.

    1当GIF技术受版权保护且需要使用许可时,它可用作GIF文件格式的替代品。

    2 PNGs allow for 5 to 25 percent greater compression than GIFs, and with a wider range of colors. PNGs use two-dimensional interlacing, which makes them load twice as fast as GIF images.”

    2个PNG比GIF具有5到25%的压缩,并且具有更广泛的颜色。 PNG使用二维隔行扫描,这使得它们的加载速度是GIF图像的两倍。“

    3 Image that has a lot of colors or requires advanced variable transparency, PNG is the preferred file type.

    3具有大量颜色或需要高级可变透明度的图像,PNG是首选文件类型。

    GIF > Graphics Interchange Format

    GIF>图形交换格式

    1 Reduces the number of colors in an image to 256.

    1将图像中的颜色数减少到256。

    2 GIFs also support transparency.

    2个GIF也支持透明度。

    3 GIFs have the unique ability to display a sequence of images, similar to videos, called an animated GIF.

    3个GIF具有显示图像序列的独特能力,类似于视频,称为动画GIF。

    4 If the image has few colors and does not require any advanced alpha transparency effect, GIF is the way to go.

    4如果图像颜色较少且不需要任何高级Alpha透明效果,则可以使用GIF。

    SVG > Scalable Vector Graphics

    SVG>可缩放矢量图形

    1 SVGs are a web standard based on XML that describe both static images and animations in two dimensions.

    1 SVG是基于XML的Web标准,它描述了二维静态图像和动画。

    2 SVG allows you to create very high-quality graphics and animations that do not lose detail as their size increases/decreases.

    2 SVG允许您创建非常高质量的图形和动画,这些图形和动画在大小增加/减少时不会丢失细节。

    #6


    These names refers to different ways to encode pixel image data (JPG and JPEG are the same thing, and TIFF may just enclose a jpeg with some additional metadata).

    这些名称指的是对像素图像数据进行编码的不同方式(JPG和JPEG是相同的,TIFF可能只包含带有一些额外元数据的jpeg)。

    These image formats may use different compression algorithms, different color representations, different capability in carrying additional data other than the image itself, and so on.

    这些图像格式可以使用不同的压缩算法,不同的颜色表示,携带除图像本身之外的附加数据的不同能力,等等​​。

    For web applications, I'd say jpeg or gif is good enough. Jpeg is used more often due to its higher compression ratio, and gif is typically used for light weight animation where a flash (or something similar) is an over kill, or places where transparent background is desired. PNG can be used too, but I don't have much experience with that. BMP and TIFF probably are not good candidates for web applications.

    对于Web应用程序,我会说jpeg或gif足够好。 Jpeg由于其较高的压缩比而被更频繁地使用,并且gif通常用于轻量级动画,其中闪光(或类似的东西)是过度杀戮,或者需要透明背景的地方。 PNG也可以使用,但我没有太多经验。 BMP和TIFF可能不适合Web应用程序。

    #7


    What coobird and Gerald said.

    coobird和Gerald说的是什么。

    Additionally, JPEG is the file format name. JPG is commonly used abbreviated file extension for this format, as you needed to have a 3-letter file extension for earlier Windows systems. Likewise with TIFF and TIF.

    此外,JPEG是文件格式名称。 JPG是此格式的常用缩写文件扩展名,因为您需要为早期Windows系统提供3个字母的文件扩展名。与TIFF和TIF相同。

    Web browsers at the moment only display JPEG, PNG and GIF files - so those are the ones that can be shown on web pages.

    目前,Web浏览器只显示JPEG,PNG和GIF文件 - 因此可以在网页上显示这些文件。

    #8


    PNG supports alphachannel transparency.

    PNG支持alphachannel透明度。

    TIFF can have extended options I.e. Geo referencing for GIS applications.

    TIFF可以有扩展选项I.e. GIS应用程序的地理参考。

    I recommend only ever using JPEG for photographs, never for images like clip art, logos, text, diagrams, line art.

    我建议只使用JPEG作为照片,永远不要用于剪贴画,徽标,文字,图表,艺术线条等图像。

    Favor PNG.

    #9


    The named ones are all raster graphics, but beside that don't forget the more and more important vectorgraphics. There are compressed and uncompressed types (in a more or less way), but they're all lossless. Most important are:

    命名的都是光栅图形,但除此之外不要忘记越来越重要的矢量图形。有压缩和未压缩类型(或多或少),但它们都是无损的。最重要的是:

    #10


    The file extension tells you how the image is saved. Some of those formats just save the bits as they are, some compress the image in different ways, including lossless and lossy methods. The Web can tell you, although I know some of the patient responders will outline them here.

    文件扩展名告诉您图像的保存方式。其中一些格式只是按原样保存位,有些以不同方式压缩图像,包括无损和有损方法。网络可以告诉你,虽然我知道一些患者响应者会在这里概述它们。

    The web favors gif, jpg, and png, mostly. JPEG is the same (or very close) to jpg.

    网络主要支持gif,jpg和png。 JPEG与jpg相同(或非常接近)。

    #11


    For the specified difference and usage between the varies of image formats have a good discussion above already.

    对于指定的差异和各种图像格式之间的用法已经在上面进行了很好的讨论。

    However, I want to add something for the overall process of capturing a picture and storing them.

    但是,我想为捕获图片和存储图片的整个过程添加一些内容。

    The capturing process

    Or you can say the construct process(as we can draw or make pictures with computers now). If you take a photograph with a camera, you are already using lots of sensors(CCD or CMOS) and algorithms(Bayer Pattern Filter, Sub-sampling and quantization, etc.) Also there are stuff like Pixel Format and Color Space. After you got the basic pixel information, there must be a way for storing them.

    或者你可以说构造过程(因为我们现在可以用计算机绘制或制作图片)。如果你用相机拍照,你已经使用了很多传感器(CCD或CMOS)和算法(拜耳模式滤镜,子采样和量化等)。还有像像素格式和色彩空间这样的东西。获得基本像素信息后,必须有一种方法来存储它们。

    The basic image file structure

    For storing the pixels info a file, we need a convention and related algorithms. For saving space, there are compression, but basically problem is encoding the pixels to bytes and decoding the bytes to pixels for display.

    为了将像素信息存储到文件中,我们需要约定和相关算法。为了节省空间,存在压缩,但基本上问题是将像素编码为字节并将字节解码为像素以供显示。

    A typical image file may be consisted by several parts, basically two:meta data or file header and pixel data section. The meta data tells about the image itself, maybe height and width, file format, etc. And the pixel data section is the real section who deals with the real picture.

    典型的图像文件可以由几个部分组成,基本上是两个部分:元数据或文件头和像素数据部分。元数据讲述了图像本身,可能是高度和宽度,文件格式等。像素数据部分是处理真实图像的真实部分。

    Storing and Displaying

    As we said earlier, files are stored in hard disk and are in bytes/bits. So image files have no priority but also bytes stream actually. For displaying, maybe we should get something to know how monitor works. Typical PC monitors use RGB model for displaying.

    如前所述,文件存储在硬盘中,以字节/位为单位。因此图像文件没有优先级,但实际上也是字节流。对于显示,也许我们应该知道监视器如何工作。典型的PC监视器使用RGB模型进行显示。

    Hope this helps:-)

    希望这可以帮助:-)