Traditional Culture Encyclopedia - Photography major - What does JPG's photo format mean?

What does JPG's photo format mean?

The file extension of encoded image stored in jpeg file exchange format.

The full name of Jpg should be JPEG.

JPEG pictures store a single raster image in 24-bit color. JPEG is a platform-independent format that supports the highest level of compression. However, this compression is lossy. Progressive JPEG files support interleaving.

You can increase or decrease the compression level of JPEG files. However, the file size is at the expense of image quality. The compression ratio can be as high as 100: 1. (JPEG format can easily compress files at the ratio of 10: 1 to 20: 1, and the image quality will not decrease. ) JPEG compression can handle realistic photographic works well. However, JPEG compression can not provide ideal results for simple works with few colors, strong contrast, solid color borders or large solid color areas. Sometimes the compression ratio is as low as 5: 1, which seriously loses the integrity of the picture. The reason for this loss is that JPEG compression scheme can compress similar tones well, but JPEG compression scheme can not deal with strong differences in brightness or solid color areas well.

Advantages: Photographic works or realistic works support advanced compression.

The file size can be controlled by variable compression ratio.

Support interleaving (for progressive JPEG files).

Extensive support for Internet standards.

Disadvantages: Lossy compression will reduce the quality of the original image data.

When you edit and resave a JPEG file, JPEG will mix the quality of the original picture data. This decline is cumulative.

JPEG is not suitable for simple pictures with few colors, similar colors in a large area or obvious brightness difference.

Jpg format is a picture format, which makes it a common picture format. If your picture is in another format, you can convert it in the following ways:

1, photoshop, after opening the picture, press Save As and select JPG format from the following formats. This method is simple and suitable for image conversion with good quality and high requirements.

2. If your requirements are not high, you can directly choose JPG format through the picture program attached to windows. If converted in this way, the picture quality is average, but on the internet, it's ok!

This method is also applicable if JPG format is converted to other formats.

JPEG (Joint Photographic Experts Group) consists of ISO (International Organization for Standardization) and CCITT (International Advisory Committee). The first international digital image compression standard for still images, which was established by ional Telephone and Telegraph, is also the most widely used image compression standard so far. JPEG can provide lossy compression, so the compression ratio can reach a level unmatched by other traditional compression algorithms.

JPEG compression mode is as follows:

Sequential coding (sequential coding)

Process images from left to right and from top to bottom at a time.

Progressive coding (progressive coding)

When the image transmission time is long, the image can be processed several times, and the image can be transmitted from fuzzy to clear (the effect is similar to transmitting GIF on the network).

Lossless coding (lossless coding)

Hierarchical coding (hierarchical coding)

Images are compressed at multiple resolutions, so high-resolution images can also be displayed on low-resolution devices.

Because JPEG lossless compression is not better than other compression methods, we focus on its lossy compression. Taking a 24-bit color image as an example, JPEG compression steps are divided into:

1. color conversion

2.DCT transform

quantify

encode

1. color conversion

Because JPEG only supports the data structure of YUV color mode, but not the data structure of RGB image, it is necessary to convert the color mode before compressing the color image. The conversion of each value can be calculated by the following conversion formula:

y = 0.299 r+0.587g+0. 1 14B

u =-0. 169 r-0.33 13G+0.5B

v = 0.5R-0.4 187g-0.08 13B

Where y stands for brightness and u and v stand for color.

After the conversion is completed, data sampling is needed. Generally, the sampling ratio is 2: 1: 1 or 4: 2: 2. After this work is completed, only one row is reserved for every two rows of data, so the amount of sampled image data will be reduced to half of the original.

2.DCT transform

DCT (Discrete Cosine Transform) is a process of transforming image signals in frequency domain to separate high-frequency and low-frequency information. Then the high-frequency part of the image (that is, the image details) is compressed to achieve the purpose of compressing image data.

Firstly, the image is divided into several 8*8 matrices. Then each matrix is transformed by DCT (the transformation formula is abbreviated). After the transformation, a frequency coefficient matrix is obtained, in which the frequency coefficients are floating-point numbers.

quantify

Because the codebooks used in the post-coding process are all integers, it is necessary to quantize the transformed frequency coefficients and convert them into integers.

After data quantization, the data in the matrix are all approximate and different from the original image data. This difference is the main reason of image distortion after compression.

In this process, the choice of quality factors is very important. If the value is too large, the compression ratio can be greatly improved, but the image quality is poor; Conversely, the smaller the quality factor (the minimum value is 1), the better the image reconstruction quality, but the lower the compression ratio. In this regard, ISO has developed a set of standard quantized values for JPEG code implementers.

encode

From the previous process, we can see that the image has not been further compressed from color conversion to coding, and DCT transformation and quantization can be said to prepare for the coding stage.

There are two coding mechanisms: one is zero-value run-length coding; The second is entropy coding.

In JPEG, the zigzag sequence is adopted, that is, the elements in the matrix are arranged with the word "Z" in the normal direction of the diagonal of the matrix. The advantage of this is that the elements with large values near the upper left corner of the matrix are arranged in front of the strokes, while the matrix elements arranged behind the strokes are basically zero. Stroke length coding is a very simple and commonly used coding method, so I won't go into details here.

Coding is actually a coding method based on statistical characteristics. Huffman encoding or arithmetic coding is allowed in JPEG.