Now let me start saying jpeg is a giant pile of crap that couldn't be fully implemented by anybody but PNG is actually great. It's simple, highly extensible, lets you ignore stuff, has different bit structures, outsources the compression and is perfectly easy to understand. There is literally nothing in this format that isn't already part of PNG. And even putting JPEG and PNG in the same realm is in error, PNG is superior in literally every way. But, saying this Qoi format is as good is both wrong and seriously problematic. You can quite literally write a PNG writer in like 7 lines of code.
return b"".join(
[
b"\x89PNG\r\n\x1a\n",
png_pack(b"IHDR", struct.pack("!2I5B", width, height, 8, 6, 0, 0, 0)),
png_pack(b"IDAT", zlib.compress(raw_data, 9)),
png_pack(b"IEND", b""),
]
)
Also, the biggest deficit here is that it's focusing on the original code writer for the library not for the user of that library. I don't care what's in the magic stuff Pillow does to process .save("myfile.png") -- I care that it's not lossy, I care that you could extend it to include other things not originally given in the spec, but somebody is going to write that code 1 time, and people are going to use the features in that code a million times. --- Making the former improved at the cost of the latter is a serious problem. We would be much better off if we could focus our efforts and killing non-png type formats.