Skip to content

orellazri/qoi-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🖼️ qoi-rs

Rust implementation of the QOI (Quite OK) Image Format following the File Format Specifications.

Usage

Build with cargo build. Run with cargo run or with the executable generated from the build.

./qoi-rs <action - encode/decode> <input file> <width> <height> <channels (3/4)>

(NOTE: When decoding, only the input file argument matters. width, height, and channels can be arbitrary).

Generate test images

To turn a png into a raw image, use qoiconv.c from the reference implementation, but add these lines to the last conditions that check the file format:

} else if (STR_ENDS_WITH(argv[2], ".raw")) {
    FILE* fp = fopen(argv[2], "wb");
    fwrite(pixels, w * h * channels, 1, fp);
    fclose(fp);
    encoded = 1;
}

About

QOI Image Format implementation in Rust

Topics

Resources

License

Stars

Watchers

Forks

Languages