32. File header description of various image formats

One: .jpeg
file header identifier (2 bytes): 0XFF, 0XD8 (SOI)
end of file identifier (2 bytes): 0XFF, 0XD9 (EOI)

Open the .jpg file in hexadecimal, you can see the head and tail logo, as shown below:
Insert picture description here
Insert picture description here

Two: .png
file header identification (8 bytes):
0X89 0X50 0X4E 0X47 0X0D 0X0A 0X1A 0X0A
Insert picture description here

Three: .bmp
file header identification (2 bytes):
0X42 0X4D

Insert picture description here

Four: .gif

  • File header identification (6 bytes)
    0X47 0X49 0X46 0X38 0X39(37) 0X61
    GIF 8 9 (7) a
    Insert picture description here

Five: .tiff
file header identification (2 bytes)
0X4D 0X4D or 0X49 0X49
Insert picture description here

Guess you like

Origin blog.csdn.net/yanghangwww/article/details/111770724