The JPEG file format can be saved in two ways. They are Baseline JPEG and Progressive JPEG.
The two formats have the same size and image data, and their extensions are the same. The only difference is that they are displayed differently.
Baseline JPEG
This type of JPEG file is stored in the JPEG file by scanning from top to bottom. When you open this file to display its content, the data will be displayed from top to bottom lines in the storage order until all the data is read, the entire image is displayed. If the file is large or the network download speed is slow, the image is loaded by one row. This format of JPEG has no advantages. Therefore, Progressive JPEG is generally recommended.
Progressive JPEG
Unlike Baseline, the Progressive JPEG file contains multiple scans. These scans are stored in JPEG files. When opening a file, the blurred outline of the entire image is displayed first. As the number of scans increases, the image becomes clearer and clearer. The main advantage of this format is that when the network is slow, you can see the picture outline to know what the picture is being loaded. When some websites open large images, you will notice this technology.
If your network speed is the same as that of snails, you can see the effect. In fact, you will often see this effect on large websites such as qzone and Weibo.
PHP code can also be converted to Progressive jpg.
Copy codeThe Code is as follows:
<? Php
$ Im = imagecreatefrom#('file.jpg ');
// Sets the line-through-line scan to set the line-through-line scan bit mark. If the image is in JPEG format, the image is created as progressive JPEG. Php Manual
Imageinterlace ($ im, 1 );
Imagejpeg ($ im, './outfile.jpg', 80 );
Imagedestroy ($ im );
?>
How can I see whether the image is in the Progressive or Baseline format?
I currently know that I use the identity command in the ImageMagick software to view image resources.
Copy codeThe Code is as follows:
Identify-verbose outfile.jpg
If you see an image with the attribute "Interlace: JPEG", it is a sive ssive image.