Jump to content
dummzeuch

Quite OK Image (QOI) image format

Recommended Posts

There seems to be a new lossless image compression format called "Quite OK Image" or QOI in short, which according to its creators not only compresses better but is also faster than PNG in compression and decompression.

There are various implementations on Github https://github.com/phoboslab/qoi , one of them is even for Turbo Pascal.

Is anybody maybe already working on a 32 bit Pascal/Delphi implementation?

Share this post


Link to post

Meh. As far as I can see it just does RLE and Delta compression so it's no wonder it's faster. It's also no wonder that it doesn't compress as good as PNG (look at the benchmark numbers). Also it only handles 32 bit RGBA image data.

 

I guess it's fine for internal application use but it's definitely not a general purpose image format.

Share this post


Link to post
Guest

PGI?

Edited by Guest

Share this post


Link to post

I believe that for general purposes, a great image format option would be WebP. It has the same performance as PNG but compresses 30% more in lossless mode. In lossy mode, it compresses 30% more than jpeg (with same quality) and still allows transparencies. It is a format that also allows animated images such as gif. It is supported by all browsers, many softwares, and even Windows 10 already displays thumbnails in folders.

 

As for the future, I would bet on Heif. There are already many libraries that support it but most in beta mode, like skia.

 

Compatibility is very important, I wouldn't bet on a format that image editors, viewers or browsers can't open.

Edited by vfbb
  • Thanks 1

Share this post


Link to post
30 minutes ago, vfbb said:

Compatibility is very important, I wouldn't bet on a format that image editors, viewers or browsers can't open.

QOI is certainly very late to the dance but she's very pretty (very simple to implement and good compression).

So I wouldn't be surprised if browsers quickly supported this new format too.

Edited by angusj
grammar
  • Like 1

Share this post


Link to post
1 minute ago, angusj said:

So I wouldn't be surprised if browsers quickly supported this new format too.

Why should they? I mean, what's the benefit? It compresses worse than PNG and WebP and only supports 32-bit RGB(A).

I agree that "it's pretty" but that's irrelevant when they already have the other formats implemented. It's even irrelevant if they hadn't.

  • Like 1

Share this post


Link to post
1 minute ago, Anders Melander said:

Why should they? I mean, what's the benefit?

Persisting with my dance analogy, being so late to the dance everyone has partnered up.

IOW, browers must support formats that webpages use, and webpages will use what browsers support.

But as I said above, there's little cost to browsers supporting QOI given the simplicity of the compression and decompression algorithms.

Time will tell.

Share this post


Link to post
1 minute ago, angusj said:

But as I said above, there's little cost to browsers supporting QOI given the simplicity of the compression and decompression algorithms.

Time will tell.

That didn't answer my question: Why should they?

"There's little cost" isn't a reason because there's even less cost in not doing it.

IMO nobody will benefit from browsers supporting this format (apart from the authors ego 🙂 ).

  • Like 2

Share this post


Link to post
23 hours ago, dummzeuch said:

Is anybody maybe already working on a 32 bit Pascal/Delphi implementation?

The following seems OK reading QOI files/streams ...

 

 

Edit: Just spotted an occassional artefact in the rendered images that I'm now chasing.

I've also written the WriteToStream code (that seems bug free) that I'll upload once I've found and fixed the bug in the ReadFromStream code above.

 

Edit2: Code sample above deleted. See bugfixed version in zip package below.

Edited by angusj
removed buggy code.
  • Thanks 2

Share this post


Link to post

OK, all fixed now. I've attached a working example.

The  example loads a QOI file and saves it to BMP, then loads the saved BMP and saves that to a second QOI, and finally loads the second QOI and saves as a second BMP.

 

Edit: Another minor bugfix (with thanks to feedback from kadaif).

Edit2: Deleted obsolete attachment. See post below.

 

Edited by angusj
removed obsolete attachment
  • Like 3
  • Thanks 1

Share this post


Link to post

IMHO this seems to be image format that could stick. Fast and simple. 

Not super good compression, but not always that important. Depending on things. There seems to be some kind of Turbo Pascal implementation, which is quite weird. But Pascal port anyways. 

And what I looked at the GIT repo, people are making highly tuned Assembler code for it also.

 

Let's see what happens. There already seems to be plugins for Windows Explorer and Paint.net, which is pretty cool it self.

 

-Tee-

 

PS did not see the post by Angus just before 🙂 Thanks for that!!

Edited by Tommi Prami
Additional note

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×