Gifsicle codec in WebAssembly.
npm install @volue/wasm-codecs-gifsicle@wasm-codecs/gifsicle   > Gifsicle WebAssembly Codec
1. Installation
1. Usage
1. API
1. Examples
1. License
``bash`
npm install @wasm-codecs/gifsicle
Requirements:
- Node.js 10 or later
`typescript
import encode from '@wasm-codecs/gifsicle';
(async () => {
const encodedImage = await encode(image, encodeOptions);
})();
`
Returns a buffer containing the compressed image data.
##### image: Buffer
Buffer of a GIF image.
##### encodeOptions?: EncodeOptions
All encoding options are optional and fall back to the default values.
`typescript`
type EncodeOptions = {
optimizationLevel?: number;
interlaced?: boolean;
colors?: number;
width?: number;
height?: number;
}
`typescript
import fs from 'fs';
import encode from '@wasm-codecs/gifsicle';
(async () => {
// read input image as a buffer
const data = fs.readFileSync('in.gif');
// encode the image using @wasm-codecs/gifsicle
const output = await encode(data);
// save the image to the file system
fs.writeFileSync('out.png', output);
})();
``
Licensed under the MIT license.
© Copyright Cyril Wanner