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