67 Bytes - The Smallest Possible PNG (And How It Works)

preview_player
Показать описание
What an article. The png image format is a beautiful mess of miracles in computing. I hope this video helps you better understand the standard and how we ended up in this mess with the smallest png in the world.

S/O Ph4se0n3 for the awesome edit 🙏
Рекомендации по теме
Комментарии
Автор

I would also higly recommend reading "Lossless Image Compression in O(n) Time", which is about how the author (who didn't have that much knowledge about compression at the time) created a really effective image format called QOI that in many cases rivals PNG performance

spicybaguette
Автор

about the signature, this is very common for many, many fileformats especially on Linux and it's one of the main elements used by the file command to identify the file type. Linux doesn't decide file type by extension.

LaPingvino
Автор

Yep, would be interested in that compression algs video, LZ77 especially

TheDIL
Автор

Something i quite appreciate about PNG is how simple it is to implement

rbrickproductions
Автор

7:30 “this is where 8-bit kind-of came from, originally”

That “kind-of” is doing a lot of work there

NateVolker
Автор

7:35 I remember back in the days, game developers used tricks like swapping the color palette during horizontal or vertical blanking intervals so that they could draw each line with its own set of colors rather than having one palette for the whole frame.

SebastianMares
Автор

That's cool. In one of my projects at my work I had to make the smallest TIF and PDF files. I ended up creating a 46 bytes TIF file and 135 bytes PDF file. These were the minimum possible versions that can properly open without any errors for their file type that I managed to find.

niomeda
Автор

Trailers used to be shown at the end of a movie. I know this because my parents are old and they said they would always be shown at the end of a movie. We’re used to seeing a separate movie trailer as its own distinct thing these days but its actually our current usage of movie trailer that is out of date with its corresponding english language usage. Most usages of the word trail imply an end e.g trailing comma.

TheOmfg
Автор

And the package-bloat for how a png is handled depending on what you actually need to do...is amazing.

onoff
Автор

Thank you for the detailed erratum interjection, very helpful and much much better than the common text-overlay-correction.

geoffreygordonashbrook
Автор

Just here to say I'm enjoying it a lot! Would've never read it by myself but reading it with you and diving deeper into details is awesome

Melvinx
Автор

yep you should definetly do more of these

randomkid
Автор

I personally like niche/specific stuff about how something works. Its always satisfying

alexdefoc
Автор

color palettes are a really cool solution in some cases, for example, for the old game Guilty Gear XXR there is a mod for online play and there you can edit the palette of your character, despite the fact that the sprite itself does not change by customizing the palette you can stand out among thousands of players and they will remember you according to your palette if you played cool

vrnehot
Автор

Well, TECHNICALLY it is a smallest "valid" png, but what is the smallest png that would be rendered? Like if the "checksum" that comes after main data doesn't arrive, isn't there a chance that it'll still be shown? So, while according the W3C standard this is smallest, I would say there could probably be smaller displayable pngs. Everything starting from zlib checksum can be "cut off", so that's 16 bytes. So, 51 bytes would deterministically encode a PNG.

not_a_human_being
Автор

You absolutely can have a transparency channel that's one bit wide, on or off. For example OpenGL defines a color format GL_RGB5_A1, which allocates 5 bits for each color channel and 1 bit for alpha. It's not very common though.

DeuxisWasTaken
Автор

More of this please, I'm the only one at work who has to know about & cares about this stuff, it's nice to see someone else discuss it :D.

iamnietzsche
Автор

That was incredibly fascinating. Really makes you think about how to optimize loads even more.

sammavrs
Автор

Interesting, would be cool to see a video on which use cases to use JPG, PNG, WEBP or GIF specifically on webpages.

cassiosouza
Автор

8-bit has nothing to do with palettes. And 8-bit wouldn't be 1 out of 8, it would be 1 out of 256 (2^8)- 1 out of 8 is only 3 bits (2^3)
8-bit refers to how many data lines the CPU and memory have. Each data line can transmit 1 bit of data at a time, higher bit count means more data can be transferred simultaneously, in the same amount of time, without increasing the number of CPU clock cycles required, providing an overall improvement to performance. This becomes important if we want to do high color graphics or 3D since those require a lot more data to be processed in the same amount of time or it will lead to slowdowns.

Jdbye