QOI codec written in JavaScript.
Install package
yarn add @rickyc0626/qoi.js
const { QOI } = require('@rickyc0626/qoi.js');
const header = { width, height, channels, colorspace };
const encoded = QOI.encode(new Uint8Array(rawPixels), header);
const decoded = QOI.decode(buffer);
qoi.js CLI for PNG <--> QOI conversion
Usage:
qoi encode <infile> [outfile]
qoi decode <infile> [outfile]
Examples:
qoi encode input.png output.qoi
qoi decode input.qoi output.png
Run the following, outfile
is optional. By default any encoded / decoded files will be generated in /out
.
node src/qoi encode file.png
node src/qoi decode file.qoi