What’s inside a PNG file? Graphics, sure. But how is that graphic encoded? [Evan Hahn] shows you what goes into a single black pixel inside a 67-byte file. Why so many bytes? Well, that is exactly what the post is about.
You had to guess there is some overhead, right? There is an 8-byte header. Next up is a 25-byte metadata block. That single pixel takes 22 bytes, and then there is a 12-byte marker for the end of file. Turns out, you could put a bit more in the file, and would still take 67 bytes. The metadata is in a chunk — a block of data with a type, length, and CRC. That’s why it takes 25 bytes to store the dimensions of the image. A chunk has to be at least 12 bytes long. The metadata includes the image dimensions, the bit depth, and so on.
The next chunk, of course, is the data. The data is compressed, but in the case of one pixel, compression is a misnomer. There will be ten data bytes in the data chunk. That doesn’t include the 12 bytes of the chunk overhead so that one pixel takes a whopping 22 bytes.
The end of file marker is another chunk with no data. The total? 67 bytes. However, you can add more than one bit and still wind up with 67 bytes. For all the details, check out the post.
Luckily, it is easy to pronounce PNG. You can even use the format for circuit simulation.
So what is the biggest, or most interesting, image you can fit in the same 67 bytes?
Philosophical question: At which point do a bunch of pixels start being a image?
Hmmm…
7.
42. Always 42.
Not only a literary reference, but also a 5×7 character set with a space between letters.
its also just about enough space to draw a recognizable stick figure. beyond the reference i do actually think 42 is a good answer
Ha Ha!
Thanks for that.
Four.
You need at least two parallel lines of different value to define an edge, which is the least amount of “detail” you can encode. Since one line consists of at least two points, the minimum number is four.
A single pixel is not meaningful by itself without contrast to other pixels. If you only care about the 1D case, then the minimum number is two.
Well the famous 1990 Pale Blue Dot image filled less than a pixel on the sensor, but the receptor still read it as pale blue. It may have been more vivid if Voyager were closer to Earth- enough to fill that single pixel.
Considering all the proper awe and wonder generated, I would say that 1 pixel counts as an image. Though, it was in the context of the blackness of space and reflections inside of Voyager’s vidicon camera lenses. And, we had Carl Sagan’s genius assessment of the image put into such beautiful prose.
Come to think of it, try to torrent the audiobook that came from that single pixel. It’s called “The Pale Blue Dot”.
Is it pronounced PEE-EN-GEE or PING?
I thought it was PONG
The P is silent 🤫
B^)
First one? It rimes better to that song:
https://www.youtube.com/watch?v=NhsK5WExrnE
“[..] Cause I’m P.N.G. I′m dynamite
P.N.G. and I′ll win the fight
P.N.G. I’m a power load
P.N.G. watch me explode! [..]”
The word “rimes” is spelled “rhymes.”
So that must be why I never did like LeAnn’s music?!
considering its portable network graphics it is pronounced ponejif
not to be confused with the long-term storage media, Poneglyphs
Looks like it could be an art ntf, which could sould by an gallery to a stupid collector. I can imagine when he screams: ‘lock at my grey pixel, its grey, and its huge, and it only costs 10.000 €’
But this would restart the question, can you get a Patent on our air that we breath, or like the telekom got an trademark for the base color magenta…. Or like the american company get a patent on the real basics how a fungus works, and stopped so the innovation in rest of the world. But hey money above human life, yesterday again a Boing 737 max 9 case in the media.
kinda fun. MSPaint saves the 1px PNG at 120 bytes. Monochrome BMP: 66 bytes. 24-bit BMP: 58 bytes. I expected simpler == smaller but in BMP’s case it’s eaten up by byte padding