@rickyc0626/qoi.js

1.0.2 • Public • Published

qoi.js

QOI codec written in JavaScript.

Installation

Install package

yarn add @rickyc0626/qoi.js

Using the QOI API

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);

Using the PNG <--> QOI Converter

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

Package Sidebar

Install

npm i @rickyc0626/qoi.js

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

26.1 kB

Total Files

15

Last publish

Collaborators

  • rickyc0626