Files
learngo/x-tba/project-png-parser/png-parser-project/1-png-anatomy-format.md
T

17 lines
589 B
Markdown
Raw Normal View History

2019-01-28 14:23:59 +03:00
# The Brief Anatomy of a PNG image
```
The first 24 bytes:
+=================================+
2019-01-29 19:43:12 +03:00
| PNG Header | 8 bytes | -> 89 50 4e 47 0d 0a 1a 0a
2019-01-28 14:23:59 +03:00
+---------------------+-----------+
| IHDR Chunk Header | |
| Chunk Length | 4 bytes | -> The length of the IHDR Chunk Data
2019-01-29 19:43:12 +03:00
| Chunk Type | 4 bytes | -> 49 48 44 52
2019-01-28 14:23:59 +03:00
+---------------------+-----------+
| IHDR Chunk Data | |
2019-01-29 19:43:12 +03:00
| Width | 4 bytes | -> uint32 — big endian
| Height | 4 bytes | -> uint32 — big endian
2019-01-28 14:23:59 +03:00
+=================================+
```