Summary of five commonly used picture formats and whether they have data compression

Source: Internet
Author: User
Tags bmp image

Summary of five commonly used picture formats and whether they have data compression

Disclaimer: Reference Please specify source http://blog.csdn.net/lg1259156776/

Description: This article focuses on the five most common and most commonly used image formats: bmp,png,jpeg,jpeg200, and GIF. The first step before image processing related applications is to be able to read these image files, although many development tool support libraries such as OPENCV have helped to save the hassle of these efforts, while at the same time making it easier for developers to become familiar with these basic image formats. The purpose of this paper is to use these five kinds of commonly used image format for the sub-article description, convenient to consult.

The content draws on the mainstream picture format introduction.

BMP image File FormatNo compression

BMP is a hardware device independent of the image file format, the use of very wide. It uses bit-mapped storage format, in addition to image depth optional, No other compression, so the BMP file occupies a large space . BMP file Image depth selectable lbit, 4bit, 8bit and 24bit. BMP files when storing data, the image is scanned in order from left to right, from bottom to top.
Because the BMP file format is a standard for exchanging graph-related data in a Windows environment, graphic image software that runs in a Windows environment supports BMP image formats. It is the ultimate form of image presentation for multiple operating systems, including Windows, and can be supported by a variety of Windows applications. With the popularity of Windows operating systems and the development of rich Windows applications, BMP bitmap format is naturally widely used. This format is characterized by a rich image information, BMP is not compressed, and can be directly restored 16 binary and binary code, but this led to its innate disadvantage-taking up disk space is too large. Therefore, the current BMP on a single machine is more popular. Use very little on the network.
The typical BMP image file consists of three parts: the bitmap file header data structure, which contains BMP image file type, display content and other information, bitmap information data structure, it contains BMP image width, height, compression method, and define color and other information.

PNG image File formatLossless Compression

The original name of PNG (portable Networf graphics), called "Portability network Image", is the most recent image file format accepted online. PNG can provide lossless compressed image files that are 30% smaller in length than GIF. It also provides 24-bit and 48-bit true color image support and many other technical support. Because PNG is very new, not all programs can now use it to store image files, Photoshop can not only process PNG image files, but also can be stored in PNG image file format.
PNG is an image file storage format that was developed in the mid 1990s to attempt to replace GIF and TIFF file formats while adding features not available in the GIF file format. The streaming web graphics format (Portable Network Graphic format,png) is named after the unofficial "PNG's not GIF", which is a bitmap (bitmap file) storage format that reads "Ping". When PNG is used to store grayscale images, the depth of the grayscale image can be as much as 16 bits, and when the color image is stored, the depth of the color image can be as many as 48 bits, and the alpha channel data of up to 16 bits can also be stored. PNG uses a lossless data compression algorithm derived from LZ77 .
The PNG file format preserves the following characteristics of the GIF file format:
Color images can be supported in 256 colors using a color lookup table or a palette.
Streaming read/write performance (streamability): The image File format allows continuous readout and writing of image data, which is ideal for generating and displaying images during communication.
Successive approximation displays (progressive display): This feature enables the transmission of image files on the communication link while displaying the image on the terminal, showing the entire contour after the image is displayed progressively, that is, the image is displayed in low resolution, and then gradually improves its resolution.
Transparency (transparency): This performance allows some parts of the image to not be displayed to create some distinctive images.

GIF file formatLossless Compression

The original meaning of GIF (Graphics Interchange Format) is "Image interchange formats", an image file format developed by CompuServe Company in 1987. GIF file Data is a lossless compression format based on the LZW algorithm for continuous tones . Its compression rate is generally around 50%, it does not belong to any application. Almost all relevant software currently supports it, and the public domain has a large number of software used in GIF image files.
  the data of the GIF image file is compressed, and it uses a compression algorithm such as variable length. so gif image depth from lbit to 8bit, that is, GIF supports up to 256 colors of images. Another feature of the GIF format is that it can store multiple color images in a GIF file, which can form the simplest animation if multiple images stored in a file are read out and displayed on the screen.
GIF decoding is faster because it uses an interlaced GIF image to be scanned in four times when the edge is decoded. The first scan shows only one-eighth of the entire image, and the second scan shows only 1/4, but this shows the overall picture. When displaying a GIF image, an interlaced image gives you the impression that it appears to appear faster than other images, which is an advantage of interlaced storage.
Divided into static GIF and animated GIF two kinds, support transparent background image, suitable for a variety of operating systems, "size" is very small, many small animations on the web are GIF format. In fact, GIF is to save a number of images as an image file, thus forming an animation, so in the final analysis, GIF is still a picture file format.
Although the GIF image has such shortcomings, but this format is still large on the network, which and GIF image file short, download speed, many of the same size can be used to make the image file animation and other advantages are inseparable.

JPEG file Format: DCT of lossy compression

JPEG is an abbreviation for the Joint Photographic Experts Group (joint Image Expert Group), and the file suffix is named ". JPG "or". JPEG ", is the most commonly used image file format, developed by a software development consortium, is a lossy compression format, the image can be compressed in a small storage space, the image of repetitive or unimportant data will be lost, it is easy to cause damage to the image data. In particular, the use of high compression ratio, will make the final decompression after the restoration of image quality is significantly reduced, if the pursuit of high-quality images, should not adopt high compression ratio. However, JPEG compression technology is very advanced, it uses lossy compression method to remove redundant image data, in obtaining a very high compression rate at the same time can show very rich vivid images, in other words, can use the least disk space to get better image quality. And JPEG is a very flexible format, with the ability to adjust the image quality, allowing the use of different compression ratios of the file compression, support a variety of compression levels, compression ratio is usually between 10:1 to 40:1, the greater the compression ratio, the lower the quality; Conversely, the smaller the compression ratio, the better the quality. For example, you can put 1. 37Mb BMP bitmap File is compressed to 20. 3KB. Of course, you can also find a balance between image quality and file size. JPEG format compression is mainly high-frequency information, the information on the color retention is good, suitable for the internet, can reduce the transmission time of the image, can support 24bit true color, but also widely used in the need of continuous tone image.
JPEG format is the most popular image format on the network, it is possible to compress files into the smallest format, in the Photoshop software in JPEG format, provide 11 levels of compression level, 0-10-level representation. The 0-stage compression ratio is the highest and the image quality is the worst. The compression ratio can be up to 5:1 even with a 10-stage quality preservation with virtually lossless detail. When saved in BMP format, it gets 4. 28MB image file, when saved in JPG format, its file is only 178KB, compression ratio reaches 24:1. After many comparisons, the 8th level compression is the optimal ratio of storage space and image quality.
JPEG format is widely used, especially in the network and CD-ROM books, can find its figure. At present, all kinds of browsers support JPEG image format, because the file size of JPEG format is small and download speed is fast.
  

JPEG2000 file format: Discrete wavelet transform of lossy and lossless compression   

The JPEG2000 as an upgraded version of JPEG with a compression ratio of about 30% higher than JPEG, while supporting lossy and lossless compression. JPEG2000 format has an extremely important feature is that it can achieve progressive transmission, that is, the first transmission of image contour, and then gradually transfer data, continuously improve the image quality, so that the image from hazy to clear display. In addition, JPEG2000 supports the so-called "area of Interest" feature, which allows you to arbitrarily specify the compression quality of an area of interest on the image, and optionally the specified part to decompress first.

2015-10-12 Less Art

Copyright NOTICE: This article for Bo Master original article, reprint please indicate source http://blog.csdn.net/lg1259156776/.

Summary of five commonly used picture formats and whether they have data compression

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.