@wasm-codecs/mozjpeg

MozJPEG WebAssembly Codec
Table of contents
Installation
npm install @wasm-codecs/mozjpeg
Requirements:
- Node.js 10 or later
Usage
; ;
API
encode(image, inputInfo, encodeOptions?): Buffer
Returns a buffer containing the compressed image data.
image: Buffer
A raw RGB image input buffer.
inputInfo: InputInfo
Those are required informations about the raw input image.
Channels specifies the amount of channels in the image: Buffer
param and defaults to 3
(RGB).
encodeOptions?: EncodeOptions
All encoding options are optional and fall back to the default values.
Examples
Using sharp in Node.js
;;; ;
License
Licensed under the MIT license.
© Copyright Cyril Wanner