0.1.0 • Published 3 years ago

gif-frame-reducer v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

gif-frame-reducer

Nodejs plugin to reduce gif frames by Gifsicle

Install

$ npm install gif-frame-reducer

Usage

const gifFrameReducer = require("gif-frame-reducer");
const fs = require("fs");

const buf = fs.readFileSync("avocado.gif");
gifFrameReducer({
  width: 200,
  max_frame: 10,
})(buf).then((data) => {
  console.log("'data' contains processed GIF.");
});

API

gifResize(options)(buffer)

Returns a promise for a buffer.

options

Type: Object

width

Type: number

Resize GIF to given width in pixels. It maintains aspect ratio.

height

Type: number

Resize GIF to given height in pixels. It maintains aspect ratio.

stretch

Type: boolean

If this is set, and width and height both are provided, the GIF will be resized such that it exactly matches the dimensions provided. It won't match the aspect ratio.

timeout

Type: number Default: 0

This is process timeout in milliseconds. If set to positive number, it will throw timeout error after that many milliseconds.

max_frame

Type: number Default: null

max_delay

Type: number Default: null

License

MIT

0.1.0

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago