gifencoderv2
v1.0.0
Published
Streaming server-side animated (and non-animated) GIF generation for Node.js — republished fork for modern Node and ST BOT messenger integration.
Downloads
293
Maintainers
Readme
gifencoderv2
A republished fork of the original gifencoder package for modern Node.js and easier use in messenger bot projects.
About
This repository is maintained by Sheikh Tamim and republished from the original project at https://github.com/eugeneware/gifencoder.
The fork is intended to support newer Node.js usage scenarios and to make the package more reliable for bot integrations such as the ST BOT project.
Install
npm install gifencoderv2Or install directly from GitHub:
npm install github:sheikhtamimlover/gitencoderv2Usage
const GIFEncoder = require('gifencoderv2');
const { createCanvas } = require('canvas');
const width = 320;
const height = 240;
const canvas = createCanvas(width, height);
const ctx = canvas.getContext('2d');
ctx.fillStyle = '#3498db';
ctx.fillRect(0, 0, width, height);
const encoder = new GIFEncoder(width, height);
encoder.start();
encoder.setRepeat(0);
encoder.setDelay(500);
encoder.setQuality(10);
encoder.addFrame(ctx);
encoder.finish();
const fs = require('fs');
const out = fs.createWriteStream('output.gif');
encoder.createReadStream().pipe(out);Why this fork?
- Original package: https://github.com/eugeneware/gifencoder
- Fork maintained by: Sheikh Tamim
- Republished for newer Node.js compatibility and messenger bot use.
- Good fit for projects like ST BOT: https://github.com/sheikhtamimlover/ST-BOT
Notes for ST BOT users
If you are building a messenger bot or using the ST BOT repository, this package can help generate GIFs server-side with canvas support.
License
MIT
