Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
gifsicle wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows
The gifsicle npm package is a Node.js wrapper for the Gifsicle command-line tool, which is used for manipulating GIF images. It allows you to optimize, resize, and edit GIFs programmatically.
Optimize GIF
This feature allows you to optimize a GIF file to reduce its size. The code sample demonstrates how to use the gifsicle package to optimize an input GIF and save the optimized version as output.gif.
const gifsicle = require('gifsicle');
const execFile = require('child_process').execFile;
execFile(gifsicle, ['--optimize', '--output', 'output.gif', 'input.gif'], (err) => {
if (err) throw err;
console.log('GIF optimized');
});
Resize GIF
This feature allows you to resize a GIF to specified dimensions. The code sample demonstrates how to resize an input GIF to 200x200 pixels and save the resized version as output.gif.
const gifsicle = require('gifsicle');
const execFile = require('child_process').execFile;
execFile(gifsicle, ['--resize', '200x200', '--output', 'output.gif', 'input.gif'], (err) => {
if (err) throw err;
console.log('GIF resized');
});
Extract Frames
This feature allows you to extract individual frames from a GIF. The code sample demonstrates how to extract frames from an input GIF, which will be saved as separate files.
const gifsicle = require('gifsicle');
const execFile = require('child_process').execFile;
execFile(gifsicle, ['--explode', 'input.gif'], (err) => {
if (err) throw err;
console.log('Frames extracted');
});
The gifencoder package is used for creating GIFs from a series of images or canvas frames. Unlike gifsicle, which focuses on optimizing and editing existing GIFs, gifencoder is more suited for generating new GIFs programmatically.
The gif-frames package allows you to extract frames from a GIF as images. While gifsicle can also extract frames, gif-frames provides more control over the extraction process, such as selecting specific frames or ranges.
The sharp package is a high-performance image processing library that supports multiple image formats, including GIF. It can resize, crop, and manipulate images, but it is more general-purpose compared to gifsicle, which is specialized for GIFs.
gifsicle 1.71 Node.js wrapper that makes it seamlessly available as a local dependency on OS X, Linux and Windows.
gifsicle manipulates GIF image files in many different ways. Depending on command line options, it can merge several GIFs into a GIF animation; explode an animation into its component frames; change individual frames in an animation; turn interlacing on and off; add transparency and much more.
Install with npm: npm install --save gifsicle
var execFile = require('child_process').execFile;
var gifsiclePath = require('gifsicle').path;
execFile(gifsiclePath, ['-o', 'output.gif', 'input.gif'], function() {
console.log('Image minified');
});
Can also be run directly from ./node_modules/.bin/gifsicle
.
Note to self on how to update the binaries.
Run npm install
on a OS X 10.7 machine to build the binary.
Run npm install
to build the binary.
bin
folder at the destination and copy gifsicle.exe
.Everything excluding the binaries licensed under the BSD license and copyright Google.
gifsicle licensed under the GNU General Public License, Version 2.
FAQs
gifsicle wrapper that makes it seamlessly available as a local dependency
The npm package gifsicle receives a total of 424,040 weekly downloads. As such, gifsicle popularity was classified as popular.
We found that gifsicle demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.