Re: Colour me impressed...
> I'm fed up of seeing jpeg compression artefacts on images; I shall have to play with this and see what happens
It's a nice bit of work, and as other people have said, it's nice having a image-compression spec which is easy to read.
But at the same time, it's pretty much just Run Length Encoding (RLE) with a couple of tricks thrown in. And that means that while it's great for encoding "drawings" (e.g. the Register logo at the top of this page, or a screenshot of my browser), it'll be significantly less good at encoding photographs.
Because photographs very rarely have long sequences of a single colour, unless you perform some sort of lossy transform on them.
Then too, part of the reason for other image formats being so "bloated" is that they have a lot of other useful features. Which admittedly, don't always get used that much. But they do get used.
E.g. PNG has transparency, and an option to create animated images. Which admittedly/sadly, never really got anywhere against the almighty gif.
Similarly, when it comes to JPG, I know few websites use things like the interlaced-progressive download option.
And both PNG and JPG offer metadata features, which can be very useful. E.g. width/height, date taken (both useful when searching in Windows Explorer), camera make/model, image orientation, geo-coordinates, etc.
Also, out of curiosity, I grabbed the test archives from the website, to see how well the compression fares against standard compression tools such as gzip and 72.
I can't comment on the performance, since I CBA compiling up a qoi executable and going through the faff of doing lots of benchmarking tests.
But this is what I got from a few quick tests (assuming I can use lists in El Reg comments):
I.e. 7z and gzip are generally as effective if not more so than PNG and QOI!
Admittedly, they're also far more complex to implement, and have the benefits of decades of tuning, but by the same token, reference implementations are far more widely available, and 7z in particular has lots of useful features such as multi-core processing.
For a final bit of fun, I grabbed a recent street-art photo from my phone: it's bright, colourful, lots of details and comes in the shape of a 4.3mb 4000x3000 JPG which decompresses into a 36mb BMP.
And with that image, PNG clocked in at 19mb, and 7z came in at 20.5mb.
Which means that even with the most optimistic "20%" improvement over PNG, QOI would come in at around 16mb, or around four times larger than the JPG. Which most definitely does not have any visible artefacts :)
So, yeah. A small and clever RLE algorithm is a good thing, and that sort of thing definitely has uses in certain niches (e.g. video games, 64kb demo competitions, etc). And the author definitely deserves credit for making it clear, simple and competitive with PNG when it comes to performance and compression ratios.
But it's not a replacement for JPG and it'd arguably need at least some extra features added to be truly competitive with PNG. At which point, the number of lines of code would start to grow...