I would like to know if there is a way in Python to measure the memory consumption of a PNG image.
For my test I've to Images normal.png
and evil.png
. Let's say both images are 100kb in size.
normal.png
consists of data represented by 1 byte per pixel.
evil.png
consists of \x00
bytes and a PLTE
. chunk - 3 bytes per Pixel.
For normal.png
I could decompress the IDAT
data chunk, measure the size and compare it with the original file size to get an approximate memory consumption.
But how to proceed with evil.png
?
width*height*depth
? – Antti Haapala