The PNG structure
A PNG starts with the 8-byte signature 89 50 4E 47 0D 0A 1A 0A, followed by a series of chunks. Each chunk has a 4-byte length, a 4-byte type, the data and a 4-byte CRC32. The first chunk is always IHDR, which holds the width, height, bit depth and color type; image data lives in IDAT, and IEND closes the file.
Why changing the height gives it away
The IHDR CRC32 is computed over the chunk type and data. If the author changes the height without recomputing the CRC, most viewers still show the (cropped) image, but the CRC no longer matches. Because the width and height are only 8 bytes, we can brute-force size combinations until the CRC matches — that's the original size.
Even if the CRC was recomputed too, there's another clue: the size of the inflated IDAT data. Each image row is one filter byte plus the pixel data, so dividing the total length by the row length gives the real height.
Repair steps
- Drop the PNG into the PNG CRC & dimension fixer and check whether the IHDR CRC is valid
- If the CRC is wrong, the tool brute-forces the matching size and fills it in
- If the CRC is valid but the IDAT size implies a different height, the tool suggests it
- Click Repair and preview to see the full image, then download the repaired PNG
Other common PNG challenges
If the size is fine, check for files appended after IEND, hints in tEXt chunks, and text or QR codes hidden in the LSB bit planes.
FAQ
How long does the size brute force take?
Usually only the height is changed, and searching one dimension takes under a second. If both were modified, the tool searches up to 4096 × 4096, which still takes only a few seconds.
Does changing the height damage the image?
No. The image data stays intact in IDAT; only the height declared in IHDR is smaller. Restore the correct value and the full image shows again.
Can JPEGs be modified the same way?
A JPEG's size lives in its SOF segment and can be changed too, but JPEG has no CRC, so you have to try values and check the decoded result by hand.