Skip to content
forked from Le0Developer/vqoi

V: QOI - The "Quite OK Image" format for fast, lossless image compression

License

Notifications You must be signed in to change notification settings

ArcOfDream/vqoi

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vqoi

QOI 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

import vqoi
import os

fn 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
}

About

V: QOI - The "Quite OK Image" format for fast, lossless image compression

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • V 100.0%