0.1.5 • Published 1 year ago

gif-tool v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

node-gif-tool

NPM \ GitHub

About

WARNING! This module is maintaned by one person yet. Great maintenance is not guaranteed. There are some plans on it though

This module is mainly written in Rust and bound to NAPI using ffi-napi*. Image processing is implemented through image-rs/gif

  • Easy to use
  • Declaration files included
  • Simple. Easy to learn

Installation

npm: npm i gif-tool\ yarn: yarn add gif-tool\ pnpm: pnpm add gif-tool

The binaries are built-in

Inspiration

The idea of this module is to make an ease to use and performant gif encoder/decoder. No absurd amount of huge functions

Examples

Could be found in examples/ folder

const { GifEncoder, GifDecoder } = require("gif-tool");
const { writeFileSync } = require("fs");

/* explode */
const decoder = new GifDecoder("mygif.gif");
let i = 0;
for (const frame of decoder.frames) {
  writeFileSync(`./frames/frame_rgba_uncompressed_${i}`, frame.buffer());
  i += 1;
}

// simple single-pixel RGBA frames
const frames = [
  // red
  255, 0, 0, 255,

  // green
  0, 255, 0, 255,

  // blue
  0, 0, 255, 255
];

/* merge */
const encoder = new GifEncoder();
encoder.setDelay(10);

frames.forEach(frame => encoder.writeFrame(frame));
writeFileSync("./out.gif", encoder.buffer());

It's that simple!

References:

Roadmap:

  • Compare current implementation with gifski
  • Handle more existing image processing methods
    • Get in use more existing options
  • Implement different image loading methods into GifDecoder, such as raw buffer. Currently only file path is supported
  • Built-in GIF manipulation functionality
  • Add some paragraphs to the roadmap. lol

Contributions are appreciated

0.1.6-rc1

1 year ago

0.1.5

1 year ago

0.1.5-rc3

1 year ago

0.1.5-rc2

1 year ago

0.1.5-rc1

1 year ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago