Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/le0developer/vqoi
V: QOI - The "Quite OK Image" format for fast, lossless image compression
https://github.com/le0developer/vqoi
qoi v vlang
Last synced: 20 days ago
JSON representation
V: QOI - The "Quite OK Image" format for fast, lossless image compression
- Host: GitHub
- URL: https://github.com/le0developer/vqoi
- Owner: Le0Developer
- License: mit
- Created: 2022-04-01T20:39:36.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-07-18T19:00:07.000Z (over 1 year ago)
- Last Synced: 2024-11-17T13:39:02.080Z (3 months ago)
- Topics: qoi, v, vlang
- Language: V
- Homepage:
- Size: 15.6 KB
- Stars: 11
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# vqoi
[QOI](https://qoiformat.org/) imlementation in pure V.
> QOI is fast. It losslessy compresses images to a similar size of PNG, while offering 20x-50x faster encoding and 3x-4x faster decoding.
>
> QOI is simple. The reference en-/decoder fits in about 300 lines of C. The file format specification is a single page PDF.## Usage
```v
import vqoi
import osfn main() {
width := 500
height := 400
rgba := [][4]u8{len: width * height, init: [u8(255), 0, 0, 255]!}
metadata := vqoi.ImageMetadata{u32(width), u32(height), .rgba, .srgb}
image := vqoi.Image{rgba, metadata}
data := vqoi.encode(image)
os.write_file('hello.qoi', data.bytestr()) !decoded_image := vqoi.decode(data) !
assert decoded_image == image
}
```