Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the image file formats in web

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces what the image file format is in web, which is very detailed and has certain reference value. Friends who are interested must finish it!

First, which three formats?

They are: gif, jpg, png.

Second, why is it important to optimize image files?

For websites with low traffic, image optimization may not attract much attention, but if the daily visits are in tens of thousands of sites, for example, 100000, then the size of a picture is reduced by 3k. 9G of bandwidth is saved in a month, which will reduce the overhead for both the users who visit the site at the same time and the operation of the site itself.

III. Several concepts that have to be mentioned

1. Lossy compression and lossless compression

With regard to these two concepts, I saw related articles on the blog of Taobao UED, and I thought it was very good to link to the picture format and design.

2. Color depth

Refers to the number of colors contained in an image format. Expressed in bits, for example, 8-bit depth represents 256 colors.

IV. Brief introduction of 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 exceeded, some color information will be lost.

(2) support 1-bit transparency, that is, either fully transparent or opaque.

(3) support simple frame-based animation (which is not available in the other two formats)

(4) when will it be available? Images with small color values and large areas of the same color are suitable for saving in this format.

2 、 jpg

(1) support 24-bit color depth

(2) Transparency is not supported

(3) the image in this format can be compressed, and the level can be set during compression. The higher the level, the clearer the image, but the larger the file, and vice versa. Therefore, when compressing, we must weigh the pros and cons between image quality and file size.

(4) when will it be available? Images with more color values and rich colors and details are suitable to be saved in this format.

3 、 png

(1) two color depth modes are provided: 8-bit and 24-bit.

(2) 24-bit deep png files can be compressed losslessly, but the files will be correspondingly large and are not supported under ie6.

(3) 8-bit deep png files use a color index similar to gif, and in most cases, the image compressed by png under the same setting is smaller than gif.

(4) when will it be available? An 8-bit deep png file is recommended.

5. Conclusion

Choose the image file format should be in transparency, color depth, compression ratio of the three trade-offs, if the color is rich, and without transparency support, then jgp is undoubtedly the most appropriate choice; if transparency support is needed, then jpg is undoubtedly the first option to be excluded. Through the introduction of the above three formats, I believe you will have a certain understanding of how to choose the image file format.

This article extends:

The excellent imaging quality of DSLR is not only based on good hardware configuration, but also has a great degree of freedom in image post-processing. When it comes to this point, one factor has to be mentioned: the file format of the image. Maybe some people will say? What is there to say about the picture format? In fact, this is not the case, the knowledge in this is very great.

For DSLRs, we usually have to deal with three image file formats: JPEG, RAW and TIFF. Ordinary consumer products, however, only support JPEG. So, what is the difference between the three and how to use them?

JPEG format is the most widely used file format at present, and the file suffix is JPG, which is a lossy compression format similar to MP3 in music. The JPEG image captured by DSLR is the final "result" obtained by various processing (brightness, contrast, saturation and white balance) inside the camera. It is very easy to use. At present, although today's JPG can provide fairly good image quality, 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 is not yet able to cope with the most stringent conditions.

RAW means "raw data format", which contains the initial 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 to cook a dish, and the raw data in the RAW file is the raw material for cooking. The camera's direct output of the JPEG picture means that it is done directly in a relatively short period of time. Using RAW files means you can save these ingredients and give them to another chef who can spend more time working on them. In this way, the taste is naturally different. And, with the continuous upgrading of the software in the later stage, it is possible to improve the effect of the final production.

Because RAW is very "primitive", the file formats of different brands and different models of DSLRs are almost not common and need to be handled by special software. For example, Canon has DigitalPhotoProfessional, Nikon has NikonCaptureNX, and some general-purpose software, such as AdobePhotoshopCS2 and so on. Due to incompatibility, file suffixes are also varied, such as Canon's CRW, CR2, Nikon's NEF and Sony ARW, and so on. RAW has another advantage. If you make various adjustments to the image later, there will be no loss of image quality. However, if JPG adjusts later and continues to compress on the basis of compression, it can only cause more losses.

In addition to the JPEG and RAW formats, there is an TIFF format with the file suffix TIF. For DSLRs, the role played by TIFF is the final result of RAW file processing. In other words, the RAW file is processed and finally transformed into a TIFF file. There are two reasons for this: first, TIFF is also a format supported by all image processing software and is widely used. Second, it is an uncompressed format, which can maximize the quality of the picture. Therefore, the conversion from RAW to TIFF ensures that the whole process is lossless. This is also the ultimate way to maximize the advantage of DSLR imaging quality. Of course, RAW can also be converted to a JPEG file, but it loses the point of using RAW-- in the end, after a lossy compression, the value of RAW is greatly reduced.

The above is all the contents of the article "what are the image file formats in web?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report