Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/10maurycy10/libqoi
A basic QOI (https://qoiformat.org/) decoder/encoder
https://github.com/10maurycy10/libqoi
Last synced: 2 months ago
JSON representation
A basic QOI (https://qoiformat.org/) decoder/encoder
- Host: GitHub
- URL: https://github.com/10maurycy10/libqoi
- Owner: 10maurycy10
- License: lgpl-2.1
- Created: 2022-05-03T18:58:08.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-23T22:14:30.000Z (almost 2 years ago)
- Last Synced: 2024-10-29T07:49:58.418Z (3 months ago)
- Language: Rust
- Size: 545 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# libqoi
[![crates.io badge](https://img.shields.io/crates/v/libqoi)](https://crates.io/crates/libqoi) [![docs.rs badge](https://img.shields.io/docsrs/libqoi)](https://docs.rs/libqoi/latest/libqoi/)
A basic rust [QOI](https://qoiformat.org/) decoder/encoder.
## Why QOI
QOI is a lossless image format with a [one page specification](https://qoiformat.org/qoi-specification.pdf). 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.