The difference between gif,png,jpg

Source: Internet
Author: User

GIF picture format

1987 births, often used for Web animation, using lossless compression, support 256 colors (commonly called 8 bit color). It has the lowest color effect, and generally colorful pictures are not saved with GIF.

GIF is divided into static GIF and animated GIF, with the extension. gif, is a compressed bitmap format, supports transparent background image, suitable for a variety of operating systems, "size" is very small, many small animations on the web are in GIF format.

In fact, GIF is to save multiple images as an image file, thus forming an animation, so GIF is still a picture file format. However, GIF can only display 256 colors. In general, the animated images we see on our web pages are usually in GIF format.

Its advantages are: small size, excellent compression effect, support animation, support transparency effect. The disadvantage is: the color effect is poor.

Gpeg picture (jpg)

Born in 1992, digital cameras save images in the most commonly used format, lossy compression, 24bit true Color (224=17 color).

JPEG has the advantage of image compression, but it is lossy compression and the image quality will be lost. The general screen screenshot is in PNG format, which is higher than JPEG quality and has a smaller file size.

Its advantage is: color restore good, can be in the case of the picture is not obvious distortion, greatly reduce the volume, the website wants to give the most natural most scenic pictures of the best use JPG; The disadvantage is that animations are not supported and transparency is not supported.

PNG image format

1996, lossless compression, the most common use format is 256 indexed color (PNG-8) and 24bit True Color (PNG-24) (of course, PNG support color format far more than this), support full alpha channel (256-level adjustable translucent color), does not support animation.

PNG should be promoted on site design, which is recognized as the most suitable image format for web use. Google is a good example. Almost all of Google's site's image resources are in PNG format. 8-bit PNG can completely replace GIF.

Its advantages are: clear, lossless compression, compression is relatively high, can be gradual and transparent, with almost all the advantages of GIF, the disadvantage is that the color is not as rich as JPG, the same picture volume is slightly larger than JPG.

In the network of general small icons in a lot of image format is PNG, can be used as a material directly, because it has a very good feature: transparent background. PNG has another advantage, that is, successive approximation display (progressive displays): Transfer image files at the same time, you can display the entire outline, and then gradually display the details of the image, that is, the display of low-resolution display image, from Blur to clear, and then uncle improve its resolution. This is a good user experience.

All aspects of comparison

Size comparison: Typically, Png≈jpg > GIF

Transparency: PNG > GIF > JPG

Color richness: JPG > PNG > GIF

Degree of compatibility: gif≈jpg > PNG

Note that the transparency of PNG under IE6 is not displayed and has its corresponding hack method.

The difference between gif,png,jpg

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.