4 releases (2 breaking)

Uses new Rust 2021

0.3.1 May 31, 2022
0.2.1 May 4, 2022
0.2.0 May 4, 2022
0.1.1 May 3, 2022
0.1.0 May 3, 2022

#229 in Images

Download history 37/week @ 2022-04-28 56/week @ 2022-05-05 54/week @ 2022-05-12 17/week @ 2022-05-19 24/week @ 2022-05-26 47/week @ 2022-06-02 3/week @ 2022-06-09 14/week @ 2022-06-16 4/week @ 2022-06-23 2/week @ 2022-06-30 12/week @ 2022-07-07 7/week @ 2022-07-14 17/week @ 2022-07-21 13/week @ 2022-07-28 11/week @ 2022-08-04

54 downloads per month
Used in qoiconv

LGPL-2.0-or-later

17KB
372 lines

libqoi

crates.io badge docs.rs badge

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.

No runtime deps