Skip to content

Latest commit

 

History

History
70 lines (51 loc) · 1.56 KB

README.md

File metadata and controls

70 lines (51 loc) · 1.56 KB

main pre-commit.ci status Nuget GitHub

QOI.Net

A C# implementation of the Quite OK Image Format for Fast, Lossless Compression.

Installation

$ dotnet add package Rkm.QOI.Net

Usage

Encoder

var data = File.ReadAllBytes("scotland-edinburgh-castle-day.bin");

var qoi = QOIEncoder.Encode(
    data,
    width: 730,
    height: 487,
    channels: 4,
    colourSpace: 1,
    out var outLen
);

Decoder

var qoi = File.ReadAllBytes("scotland-edinburgh-castle-day.qoi");

var decoded = QOIDecoder.Decode(
    qoi,
    out var width,
    out var height,
    out var channels,
    out var colourSpace
);

Development

pre-commit

This repo uses pre-commit to manage and automatically run a series of linters and code formatters. After cloning the repo and changing into the directory, run this once to setup pre-commit.

$ pip install pre-commit
$ pre-commit install

This will then run the checks before every commit. It can also be run manually at any time:

$ pre-commit run [<hook>] (--all-files | --files <file list>)