From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:PNG" |
|---|
| claim | "The IHDR chunk data is 13 bytes: width u32, height u32 (both 1 to 2^31-1, big-endian), bit depth, colour type, compression method (0), filter method (0), interlace method (0 none, 1 Adam7)." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:PNG" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "png_IHDR" |
|---|
| size | 13 |
|---|
| fields | | offset | 0 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "width" |
|---|
| notes | "big-endian" |
|---|
|
| offset | 4 |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "height" |
|---|
| notes | "big-endian" |
|---|
|
| offset | 8 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "bit_depth" |
|---|
| notes | "1, 2, 4, 8 or 16; the allowed set depends on the colour type" |
|---|
|
| offset | 9 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "color_type" |
|---|
| bits | |
|---|
|
| offset | 10 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "compression_method" |
|---|
| notes | "0 = deflate (zlib stream)" |
|---|
|
| offset | 11 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "filter_method" |
|---|
| notes | "0; 64 = intrapixel differencing, only inside MNG" |
|---|
|
| offset | 12 |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "interlace_method" |
|---|
| notes | "0 none, 1 Adam7" |
|---|
|
|
|---|
| endianness | "big" |
|---|
|
|---|
| evidence | | type | "documentation" |
|---|
| detail | "https://www.w3.org/TR/png-3/ section 11.2.1 IHDR" |
|---|
|
| type | "source" |
|---|
| detail | "PNG_COLOR_MASK_PALETTE 1, _COLOR 2, _ALPHA 4; PNG_COMPRESSION_TYPE_BASE 0; PNG_FILTER_TYPE_BASE 0; PNG_INTRAPIXEL_DIFFERENCING 64; PNG_INTERLACE_ADAM7 1" |
|---|
| repo | "https://github.com/pnggroup/libpng" |
|---|
| commit | "cd952f49f95bb27154ae77dbb103032d95f6e580" |
|---|
| path | "png.h" |
|---|
| lines | "661-687" |
|---|
|
| type | "source" |
|---|
| detail | "png_check_IHDR: width/height limits, 'Invalid bit depth in IHDR', 'Invalid color type/bit depth combination in IHDR', 'Invalid IHDR data'" |
|---|
| repo | "https://github.com/pnggroup/libpng" |
|---|
| commit | "cd952f49f95bb27154ae77dbb103032d95f6e580" |
|---|
| path | "png.c" |
|---|
| lines | "1961-2121" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "IHDR" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T08:50:44.323Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-17T08:51:35.466Z" |
|---|
| summary | "Use C types (values are big-endian, noted per field) so export_header emits typed fields" |
|---|
| changed | |
|---|
|
| by | "PatientStepper99" |
|---|
| date | "2026-10-19T12:25:13.551Z" |
|---|
| summary | "Add data.endianness big (was only in field notes)." |
|---|
| changed | |
|---|
|
|
|---|