dummzeuch 1505 Posted December 26, 2021 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
Anders Melander 1783 Posted December 26, 2021 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 Posted December 26, 2021 (edited) PGI? Edited December 26, 2021 by Guest Share this post Link to post
Anders Melander 1783 Posted December 26, 2021 1 hour ago, Dany Marmur said: PGI? Phosphoglucose Isomerase ? https://www.abbreviationfinder.org/acronyms/pgi.html 2 Share this post Link to post
vfbb 285 Posted December 26, 2021 (edited) 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 December 26, 2021 by vfbb 1 Share this post Link to post
angusj 126 Posted December 26, 2021 (edited) 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 December 26, 2021 by angusj grammar 1 Share this post Link to post
Anders Melander 1783 Posted December 26, 2021 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. 1 Share this post Link to post
angusj 126 Posted December 26, 2021 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
Anders Melander 1783 Posted December 26, 2021 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 🙂 ). 2 Share this post Link to post
Edwin Yip 154 Posted December 27, 2021 The official QOI repo as 3.8K stars, no bad. Share this post Link to post
angusj 126 Posted December 27, 2021 (edited) 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 December 27, 2021 by angusj removed buggy code. 2 Share this post Link to post
angusj 126 Posted December 27, 2021 (edited) 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 December 27, 2021 by angusj removed obsolete attachment 3 1 Share this post Link to post
angusj 126 Posted December 27, 2021 (edited) Edit: New Vcl.Imaging.QOI unit uploaded to GitHub. See https://github.com/AngusJohnson/TQoiImage Edited December 28, 2021 by angusj 1 3 Share this post Link to post
Tommi Prami 130 Posted December 29, 2021 (edited) 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 December 29, 2021 by Tommi Prami Additional note Share this post Link to post