A QOI image encoder and decoder.
First, A FOIFile type is defined with sturcture as below.
export declare type QOIFile = {
width: number;
height: number;
channels: number;
colorspace: number;
pixels: Uint8Array;
};Then the encode function accept the raw binary data(rgba or rgb) and returns the QOI image binary data.
export declare const encode: (qoiFile: QOIFile) => Uint8Array;Lastly, a decode function is provded for decoding QOI image data into raw binary data.
export declare const decode: (qoiBytes: Uint8Array) => QOIFile;See index.html file for details.
- Install
$ npm install
- Build
$ npm run build
- Test
$ npm test