So which one of these formats, GIF, PNG, and JPG, should we choose as a candidate format, and which image format can make the image smaller but have better image quality? 1. Image Format GIF The most outstanding feature of GIF is that it supports animation. At the same time, GIF is also a lossless image format, which means that after you modify the image, the image quality is not lost. In addition, GIF supports semi-transparency (fully transparent or fully opaque). PNG First of all, PNG includes PNG-8 and true color PNG (PNG-24 or PNG-32). The biggest advantages of PNG over GIF are:
But we know that PNG does not support animation. Also note that IE6 can support PNG-8, but will display gray when processing PNG-24 transparency. For related examples, please refer to sitepoint . Generally, images saved as PNG-8 will be smaller than GIF at the same quality, and for fully transparent images we can only use PNG-24 now. But please be careful when saving images in PNG-8 and comparing them with GIF. Because the law is not always correct. JPG JPG can display more colors than GIF and PNG, and it is well compressed, so JPG is very suitable for saving digital photos. But please note that it is a lossy compression, which means that every time you modify the image, it will cause pixel distortion. After reading the above introduction, you should have a general understanding of which format to use to save which image. In short: Bottom line: For small images or basic web page elements (such as buttons), consider PNG-8 or GIF. For photos, consider JPG. |
<<: About vue component switching, dynamic components, component caching
>>: Example code for hiding element scrollbars using CSS
Database stored procedures DROP PROCEDURE IF EXIS...
MySQL download and installation (version 8.0.20) ...
Table of contents 1. Understanding Databases 1.1 ...
Copy code The code is as follows: <object id=&...
This method was edited on February 7, 2021. The v...
This article example shares the specific code of ...
Preface There are 4 types of operators in MySQL, ...
As a front-end developer, I can’t avoid IE’s pitf...
Currently, Docker has an official mirror for Chin...
Writing a Dockerfile Taking the directory automat...
The order in which the browser loads and renders H...
This article shares with you the MySQL 8.0.17 ins...
Friends always ask me how to hide Linux processes...
A jQuery plugin every day - jQuery plugin to impl...
During the Olympic Games, IE 8 Beta 2 will be rele...