Traditional Culture Encyclopedia - Photography major - The difference between png and jpg picture formats

The difference between png and jpg picture formats

1, supports advanced compression of photographic images or realistic images, and can control the image file size by using the compression ratio.

2. Lossy compression will reduce the quality of image data, and this loss will accumulate when editing and re-saving JPG format images.

3.JPG is not suitable for simple pictures with few colors, large areas with similar colors or obvious brightness differences.

Applicable scenarios:

More suitable for storing photos or real images.

For real photographic images or images with rich color levels, the best compression effect can usually be achieved by saving them in JPG image format.

1, the image file size can be compressed as much as possible with minimum distortion.

2. When storing gray-scale images with PNG, the depth of gray-scale images can be as high as 16 bits, when storing color images, the depth of color images can be as high as 48 bits, and the α-channel data can also be stored as high as 16 bits.

3. For complex images that need high fidelity, PNG can be lossless compressed, but the image file is large and not suitable for web pages.

Images that meet the following conditions are more suitable for storage in PNG8 format:

1. There are few colors in the image, which are mainly filled with solid colors or smooth gradient colors.

2. Simple pictures with large brightness difference and strong contrast (such as background and text in the "Buy Now" button).

According to experience, images with the above conditions are generally drawn by vector tools in photoshop or other software, and then saved as bitmaps.