JPG, PNG, GIF What is the difference?

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/qq_30787727/article/details/100066643

 

  • JPG is a commonly used in photography or graphic work, lossy compression graphics format;

  • PNG is a clear, transparent support, lossless compression of a bitmap graphics format;

  • GIF is a low color effect, small size, transparent support image file format.

 

Picture size comparison

PNG ≈ JPG > GIF

Typically, PNG bigger than JPG, GIF minimum share volume.

 

In this era of the pursuit of speed, out of the picture refresh rate which also seriously affect the user experience, select the correct format can better enhance the user experience.

 

 

The compatibility of the page

GIF ≈ JPG > PNG

The content to be side-tracked the IE6

 

 

Graphics transparency

PNG > GIF > JPG

PNG and GIF support transparency, but also supports gradual transparent PNG, GIF slightly better than one , because GIF supports up to 256 colors, it is difficult to prop up the gradual gradient transparent.

 

Our most common JPG format does not support transparency.

 

 

Richness of color

JPG > PNG(png24>png8) >GIF

Colorful images (photographic, realistic drawing) suggested that the preferred second choice JPG PNG24 ; JPG format is three formats can be recorded up to the color information, the color has very strict requirements, you can use this format.

 

Large blocks of color (illustration, poster) or presence of color gradient images suggesting the preferred second choice PNG24 GIF ; PNG successive approximation display and supports transparent gradients, gradient color in particular, appear in the picture, priority use this format.

 

Single-tone images (logo, text, animation) is recommended to choose GIF or PNG8 ; small volume GIF, animation support, if the picture is not only monotonous color gradient, then choose GIF better and better.

 

 

Image compression

When the small picture size, picture upload many sites should have little impact, but when a large picture size will be compressed when uploading. Usually jpg and png format images will be uploaded after being compressed to 640px, which affects the clarity of the picture.

 

Under normal circumstances, the appropriate size of GIF images are not compressed changed.

 

Picture clarity

We talk so much foreshadowing, and finally talked about the topic of the section.

 

There are many online tutorials on the clarity of the three kinds of picture formats rank comparison, such as: PNG definition> gif definition> jpg clarity . But I want to say is, different picture content, it is clear that the comparison is not rigorous.

 

✦ in the case will not be compressed

JPG color reserved the best, most relatively clear, followed PNG24;

 

✦ In the case it will be compressed

There are requirements for color, clarity is png> gif definition> jpg clarity;

 

This mainly depends on the content of the picture, under normal circumstances, PNG24 may be required by the competent color picture in the case of most compression; but because of the uncertainty of the picture content, for a color strict picture requirements, we can work in three Upload a format of each, and then screened using.

 

✦ monotone color picture

Then the experience of GIF> PNG> JPG;

 

As one of the most common examples, such as some "star Notice" or "official notice", the picture content is usually some "black and white" or "blue black", the preferred second choice PNG8 GIF can bring a better reading experience.

Guess you like

Origin blog.csdn.net/qq_30787727/article/details/100066643