🚀 DAY 5 OF LAUNCH WEEK: Introducing Socket Firewall Enterprise.Learn more →
Socket
Book a DemoInstallSign in
Socket

@volue/wasm-codecs-gifsicle

Package Overview
Dependencies
Maintainers
2
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@volue/wasm-codecs-gifsicle

Gifsicle codec in WebAssembly.

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
2
Created
Source

@wasm-codecs/gifsicle npm version license downloads

Gifsicle WebAssembly Codec

Table of contents

Installation

npm install @wasm-codecs/gifsicle

Requirements:

  • Node.js 10 or later

Usage

import encode from '@wasm-codecs/gifsicle';

(async () => {
  const encodedImage = await encode(image, encodeOptions);
})();

API

encode(image, encodeOptions?): Buffer

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.

type EncodeOptions = {
  optimizationLevel?: number;
  interlaced?: boolean;
  colors?: number;
  width?: number;
  height?: number;
}

Examples

Using Node.js

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

License

Licensed under the MIT license.

© Copyright Cyril Wanner

Keywords

wasm

FAQs

Package last updated on 22 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts