Features BMP, GIF, TIFF, PNG, JPG and SVG format images

Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
This link: https://blog.csdn.net/m0_38106923/article/details/101937827

table of Contents

1, BMP format images

2, GIF format images

3, TIFF format images

4, PNG format images 

5, JPG format image  

6, SVG format images  

7. Conclusions

7.1, vs lossless lossy

7.2, color index vs direct color

7.3 vs bitmap vector

7.4 summary


A picture can be stored in a variety of formats, why some tens of KB, some a few hundred MB, some stationary, some several screen loop? Often read in the course of project development or save an image file, the different characteristics of different types of images, the scope of application is different, brief characteristics of BMP, GIF, TIFF, PNG, JPG and SVG format images.

1, BMP format images

BMP is the English Bitmap (bitmap) shorthand, it is a Windows operating system standard image file format that can be supported by a variety of Windows applications. With the development of the popular Windows operating system with rich Windows applications, BMP bitmap format rightly been widely used. This format is characterized by a rich image information contained almost no compression, but the resulting born born with its shortcomings and take up disk space is too large. So, now more popular BMP on one machine.

BMP (Bitmap-File) graphics files are used by Windows graphic file format, all image processing software running under Windows BMP image file formats are supported. Internal Windows operating system are drawing each image in BMP basis. BMP bitmap file default filename extension is BMP or bmp (sometimes it will take a .DIB or .RLE for extension)

Although the index supports both color and direct color is an advantage, but much of the file format as lead it is almost useless, and now in addition to the Windows operating system is still relatively common, we could barely see it. In the same picture quality, BMP format image file size is many times the GIF format.

2, GIF format images

GIF is short for Graphics Interchange Format, which is a graphical format conversion, using the LZW compression algorithm coding for ways to display Hypertext Markup Language (Hypertext Markup Language) indexed color images, widely used on the Internet and other online services system . GIF is a common image file format standard, copyright Compu Serve All.

GIF is lossless, save the image in GIF format will not degrade the image quality. But thanks to data compression, GIF format images, the file size is much smaller than the BMP format images. Small files, GIF format is an advantage, but, GIF format also supports animation and transparency advantages. But the GIF format only supports 8Bit color index, that is the whole picture, only there are 256 different colors.

GIF can be supported on multiple platforms such as PC and Mactiontosh, suitable for less demanding color needs while smaller file size scenes, such as corporate Logo, wireframe class diagrams. Many people think that refers to the GIF moving map, in fact, not only the GIF animated GIF, as well as static GIF, because of its small size characteristics, GIF is now widely used in various types of websites.

3, TIFF format images

Tag Image File Format TIFF is an abbreviation, it is the Tagged Image File Format, TIFF (Tag Image File Format) image files is one of the graphic image processing in commonly used formats, its image format is complex, but because its store image information flexible, it can support many color system, and is independent of the operating system, so it has been widely used (to expand support for Mac systems with Windows cross-use). In various geographical information systems, remote sensing, photogrammetry and applications require an image having geocoding information, such as where the image coordinate system, scale, coordinates of points on the image, latitude and longitude, the unit of length and angle units.

4, PNG format images 

PNG is short for Portable Network Graphics, which is the Portable Network Graphics, PNG is a lossless compression format bit the picture shape, which is designed to try to replace GIF and TIFF file formats, while adding features some of the GIF file format is not available. PNG compression ratio, generates a small file size, GIF and TIFF PNG combines the advantages of compression can support without distortion, making requires a transparent background, gradient image, now widely used in PS software, and Internet.

PNG format 8, 24, 32 three forms, eight different transparent PNG supports two forms (alpha index transparent and transparent), PNG 24 does not support transparency, PNG 32 on the basis of increase 24 8-bit alpha channel, so it can show 256 degree of transparency.

5, JPG format image  

JPG is the JPEG (Joint Photographic Experts Group) shorthand, it is a common picture format. It is characterized by a compression ratio, generates a small file size.

JPEG format is the network's most popular image formats, files can be compressed to the smallest format, designed JPG picture format is without prejudice to the distinguished human picture quality, compressed file size as much as possible. This means that the original information JPG removed part of the picture, that is a lossy compression. JPG picture of the advantages is the use of a direct color, thanks to richer colors, JPG is very suitable for storing photos, to express more vivid image effects, such as color gradients.

But its disadvantages are also obvious, when you edit and re-save JPG files, JPG mix will decline in the quality of the original picture data, and this decline is cumulative. Figuratively, you receive forwarded many times JPG images in micro letter which will find a lot of confusion than the original picture, and the pan-green.

6, SVG format images  

Scalable Vector Graphics SVG is abbreviated, it is scalable vector graphics, SVG image thereof by the method of drawing lines and curves, and composition. When you enlarge an SVG picture, you see the lines and curves or without pixels appear. This means that SVG image when zoomed in, without distortion, so it is very suitable for drawing corporate Logo, Icon and so on.

SVG作为W3C所推荐的基于XML的开放标准,能够与其他网络技术进行无缝集成,特点是使用XML来描述图片。借助于前几年XML技术的流行,SVG也流行了很多。使用XML的优点是,任何时候你都可以把它当做一个文本文件来对待,也就是说,你可以非常方便的修改SVG图片,你所需要的只需要一个文本编辑器。

7、总结

每种类型图像都有不同的指标特点,总结如下:

7.1、有损vs无损

图片文件格式有可能会对图片的文件大小进行不同程度的压缩,图片的压缩分为有损压缩和无损压缩两种。

  • 有损压缩。指在压缩文件大小的过程中,损失了一部分图片的信息,也即降低了图片的质量,并且这种损失是不可逆的,我们不可能从有一个有损压缩过的图片中恢复出全来的图片。常见的有损压缩手段,是按照一定的算法将临近的像素点进行合并。
  • 无损压缩。只在压缩文件大小的过程中,图片的质量没有任何损耗。我们任何时候都可以从无损压缩过的图片中恢复出原来的信息。

7.2、索引色vs直接色

计算机在表示颜色的时候,有两种形式,一种称作索引颜色(Index Color),一种称作直接颜色(Direct Color)。

  • 索引色。用一个数字来代表(索引)一种颜色,在存储图片的时候,存储一个数字的组合,同时存储数字到图片颜色的映射。这种方式只能存储有限种颜色,通常是256种颜色,对应到计算机系统中,使用一个字节的数字来索引一种颜色。
  • 直接色。使用四个数字来代表一种颜色,这四个数字分别代表这个颜色中红色、绿色、蓝色以及透明度。现在流行的显示设备可以在这四个维度分别支持256种变化,所以直接色可以表示2的32次方种颜色。当然并非所有的直接色都支持这么多种,为压缩空间使用,有可能只有表达红、绿、蓝的三个数字,每个数字也可能不支持256种变化之多。

7.3、点阵图vs矢量图

  • 点阵图,也叫做位图,像素图。构成点阵图的最小单位是象素,位图就是由象素阵列的排列来实现其显示效果的,每个象素有自己的颜色信息,在对位图图像进行编辑操作的时候,可操作的对象是每个象素,我们可以改变图像的色相、饱和度、明度,从而改变图像的显示效果。点阵图缩放会失真,用最近非常流行的沙画来比喻最恰当不过,当你从远处看的时候,画面细腻多彩,但是当你靠的非常近的时候,你就能看到组成画面的每粒沙子以及每个沙粒的颜色。
  • 矢量图,也叫做向量图。矢量图并不纪录画面上每一点的信息,而是纪录了元素形状及颜色的算法,当你打开一付矢量图的时候,软件对图形象对应的函数进行运算,将运算结果[图形的形状和颜色]显示给你看。无论显示画面是大还是小,画面上的对象对应的算法是不变的,所以,即使对画面进行倍数相当大的缩放,其显示效果仍然相同(不失真)。

7.4、总结

图片的压缩方式有无损压缩和有损压缩两种。前者压缩后比后者要大。

1、图片的颜色表示有直接颜色和索引颜色两种。前者比后者更丰富,体积更大。

2、BMP采用无损压缩和直接色,所以体积最大。太大的文件格式格式导致它几乎没有用武之地。

3、GIF采用无损和索引色的,适用于对色彩要求不高同时需要文件体积较小的场景,比如企业Logo、线框类的图等。支持动画和透明。

4、JPEG(JPG)采用有损压缩和直接色,不适合用来存储企业Logo、线框类的图。因为有损压缩会导致图片模糊,而直接色的选用,又会导致图片文件较GIF更大。而适合作为摄影类的图片。.

所以小图片尽量使用png、要想支持动画则使用gif、大型图片使用jpg。

Guess you like

Origin blog.csdn.net/m0_38106923/article/details/101937827