SloppyQOI is a small QOI image format encoder and decoder library for the LÖVE game framework. The library is a single file with no external dependencies other than LÖVE. MIT license.
I mostly just made this for fun, but it seems using QOI and this library actually may be beneficial.
local qoi = require("qoi")
local playerImage = qoi.load("images/player.qoi")
love.graphics.draw(playerImage)
See the top of qoi.lua for documentation.
Running the library on the 2848 images in qoi_benchmark_suite.tar (on my crappy computer) reveals these things:
- Both decoding and encoding QOI files is for the most part a fair bit faster than decoding and encoding PNGs.
- QOI files are mostly somewhere between 0 and 1 times larger than (optimized) PNGs, but sometimes a lot more.
Not perfect, but not bad!