LinusU / cwasm-jpeg-turbo

JPEG decoding for Node.js, using libjpeg-turbo compiled to WebAssembly
11 stars 1 forks source link

JPEG

JPEG decoding for Node.js, using libjpeg-turbo compiled to WebAssembly.

Installation

npm install --save @cwasm/jpeg-turbo

Usage

const fs = require('fs')
const jpeg = require('@cwasm/jpeg-turbo')

const source = fs.readFileSync('image.jpg')
const image = jpeg.decode(source)

console.log(image)
// { width: 128,
//   height: 128,
//   data:
//    Uint8ClampedArray [ ... ] }

API

decode(source)