@lesjoursfr/gifsicle-wrapper
TypeScript icon, indicating that this package has built-in type declarations

4.1.6 • Public • Published

NPM version QC Checks

@lesjoursfr/gifsicle-wrapper

Gifsicle wrapper

Usage

Resize a Gif :

const Gifsicle = require("@lesjoursfr/gifsicle-wrapper");

(async () => {
	await Gifsicle(path.join(__dirname, "test.gif"))
		.resize(600, 600, {
			kernel: gifsicle.kernel.lanczos3,
			withoutEnlargement: true,
		})
		.toFile(path.join(__dirname, "test-resized.gif"));
})();

Change colors to greyscale :

const Gifsicle = require("@lesjoursfr/gifsicle-wrapper");

(async () => {
	await Gifsicle(path.join(__dirname, "test.gif"))
		.greyscale(true)
		.toFile(path.join(__dirname, "test-resized.gif"));
})();

Optimize the output :

const Gifsicle = require("@lesjoursfr/gifsicle-wrapper");

(async () => {
	await Gifsicle(path.join(__dirname, "test.gif"))
		.optimize({ level: gifsicle.level.O2, lossiness: 20 })
		.toFile(path.join(__dirname, "test-optimized.gif"));
})();

Package Sidebar

Install

npm i @lesjoursfr/gifsicle-wrapper

Weekly Downloads

2

Version

4.1.6

License

MIT

Unpacked Size

517 kB

Total Files

34

Last publish

Collaborators

  • e-adrien