5 unstable releases
0.3.2 | Jan 23, 2023 |
---|---|
0.3.1 | May 31, 2022 |
0.2.1 | May 4, 2022 |
0.1.1 | May 3, 2022 |
#973 in Images
35 downloads per month
Used in qoiconv
1MB
373 lines
libqoi
A basic rust QOI decoder/encoder.
Why QOI
QOI is a lossless image format with a one page specification. It can achieve better compression than PNG, while being much faster than PNG.
The best possible time complexity is O(n) where n is the amount of pixels, and space is O(1). This encoder has O(n) time and O(n) space complexity
Demo
This cat photo from https://commons.wikimedia.org/wiki/File:Cat_poster_1.jpg (5935 × 3898) is 29,291,338 bytes as PNG but 27,960,953 as QOI.
QOI also takes >.2 seconds to compress and decompress (on my machine), but PNG takes one second just to compress.