1. Which three formats? They are: gif, jpg, and png respectively. Why is it important to optimize image files? For websites with low traffic, image optimization may not attract much attention. However, if the website has tens of thousands of daily visits, for example 100,000, then reducing the size of a picture by 3k will save 9G of bandwidth in a month. This will reduce costs for both users who visit the website at the same time and the website operation itself. 3. Several concepts that must be mentioned 1. Lossy compression and lossless compression Regarding these two concepts, I saw related articles on Taobao UED’s blog and thought they were very good. The link goes to the topic of image format and design. 2. Color depth refers to the number of colors contained in a certain image format. Expressed in bits, such as 8-bit color depth represents 256 colors. 4. Introduction to the three formats 1. GIF (1) Only 8-bit color depth mode is supported, that is, only 256 colors can exist in the same image. If the number exceeds 256, some color information will be lost. (2) Support 1-bit transparency, that is, either fully transparent or opaque. (3) Supports simple frame-based animation (which is not available in the other two formats) (4) When will it be available? Images with fewer color values and large areas of the same color are suitable for saving in this format. 2.jpg (1) Supports 24-bit color depth (2) Does not support transparency (3) Images in this format can be compressed, and the compression level can be set. The higher the level, the clearer the image, but the larger the file size; and vice versa. So when compressing you must strike a balance between image quality and file size. (4) When will it be available? Images with high color values, rich colors and details are suitable for saving in this format. 3.png (1) Two color depth modes are provided: 8-bit and 24-bit. (2) PNG files with 24-bit color depth can be compressed losslessly, but the files will be correspondingly large and are not supported under IE6. (3) PNG files with 8-bit color depth use color indexes similar to GIFs, and in most cases, PNG compressed images are smaller than GIFs under the same settings. (4) When will it be available? It is recommended to use PNG files with 8-bit color depth. V. Conclusion When choosing an image file format, you should weigh the three factors of transparency, color depth, and compression rate. If the color is rich and no transparency support is required, then jgp is undoubtedly the most suitable choice; if transparency support is required, then jpg is undoubtedly the first option to be excluded. Through the introduction of the above three formats, I believe everyone will have a certain understanding of how to choose image file formats. This article expands on : The excellent imaging quality of digital SLR cameras is not only based on good hardware configuration, but also has a great degree of freedom in post-processing of images. When mentioning this, we have to mention one factor: the file format of the image. Maybe someone will say? What's there to say about the image format? In fact, this is not the case. There is a lot of knowledge involved. For digital SLRs, we usually have to deal with three image file formats: JPEG, RAW and TIFF. Ordinary consumer products only support the JPEG format. So, what are the differences between the three and how should they be used? The JPEG format is the most widely used file format at present. The file suffix is JPG. It is a lossy compression format, similar to MP3 in music. The JPEG images taken by a digital SLR are the final "result" after various processing (brightness, contrast, saturation and white balance) inside the camera, and are very simple to use. Although JPG can provide quite good image quality nowadays, it is still a compressed format in the eyes of picky people. In addition, the post-processing space of JPEG is relatively limited. Therefore, JPEG cannot cope with the most demanding conditions. RAW means "raw data format", which contains the original photosensitive data of the camera's photosensitive element (CCD or CMOS) without any processing by the camera. What are the advantages of RAW files? It can be understood this way: the process of taking pictures is like cooking a dish, and the raw data in the RAW file is the raw materials for cooking. The camera outputs JPEG images directly, which means they can be produced in a shorter time. Using RAW files means you can save the ingredients and give them to another chef, who can spend more time fine-tuning them. In this way, the taste will naturally be different. Moreover, with the continuous upgrading of post-production software, the final output may be further improved. Since RAW is very "primitive", the file formats of digital SLRs of different brands and models are almost not universal and require special software to process. For example, Canon has Digital Photo Professional, Nikon has Nikon Capture NX, and there are some general software such as Adobe Photoshop CS2 and so on. Due to incompatibility, the file extensions are also varied, such as Canon's CRW, CR2, Nikon's NEF and Sony ARW, etc. RAW has another advantage. If you make various adjustments to the image later, there will be no loss of image quality. If JPG is adjusted later and further compressed, it will only cause more losses. In addition to JPEG and RAW formats, there is also a TIFF format with the file suffix TIF. For digital SLRs, TIFF plays the role of the final processing result of RAW files. In other words, the RAW file is processed and finally converted into a TIFF file. There are two reasons for this: First, TIFF is a format supported by all image processing software and is widely used. Second, it is an uncompressed format that can maximize the quality of the picture. Therefore, converting from RAW to TIFF can ensure that the entire process is lossless. This is also the ultimate way to maximize the advantages of digital SLR imaging quality. Of course, RAW can also be converted into JPEG files, but this defeats the purpose of using RAW - in the end, it still has to go through a lossy compression, and the value of RAW is greatly reduced. |
<<: Example code for building an admin dashboard layout using CSS and JavaScript
>>: Detailed explanation of mysql filtering replication ideas
Table of contents Preface Type Inference Truth va...
Table of contents Overview 1. Compositon API 1. W...
Table of contents Transaction Isolation Level Pro...
This article mainly explains the style of buttons...
Today at work, a friend I added temporarily asked ...
I have written such an article before, but I used...
Table of contents 1. The concept of filter 1. Cus...
introduce This chapter mainly introduces the proc...
Table of contents Preface webpack-deb-server webp...
1. Add PRIMARY KEY (primary key index) mysql>A...
Table of contents Overview Application scenarios ...
Preface I recently encountered this requirement a...
Table of contents Scenario Requirements glibc ver...
When receiving this requirement, Baidu found many...
MySQL is a multi-user managed database that can a...