Socket
Book a DemoInstallSign in
Socket

apng2gif

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apng2gif

Convert APNG images to GIF

1.7.0
latest
Source
npmnpm
Version published
Weekly downloads
7
-58.82%
Maintainers
1
Weekly downloads
 
Created
Source

apng2gif

Node wrapper around apng2gif. Supports Windows, Mac, and Linux.

Usage

const apng2gif = require("apng2gif");

const promise = apng2gif("file.png", "file.gif");
promise.then(() => {
  // file.gif exists
});

apng2gif.sync("file.png", "file2.gif");
// file2.gif exists

const options = {
  backgroundColor: "#ff0000",
};
apng2gif("file.png", "file.gif", options);
// or: apng2gif.sync("file.png", "file.gif", options);

const options2 = {
  transparencyThreshold: 256
};
apng2gif("file.png", "file.gif", options2);
// or: apng2gif.sync("file.png", "file.gif", options2);

API

apng2gif(inputPath[, outputPath[, options]]) => Promise

Convert the animated PNG at inputPath to GIF and write it to outputPath. Returns a Promise which is resolved when outputPath exists.

If outputPath is omitted, it defaults to inputPath but with .gif extension.

options

  • backgroundColor - Background color string to blend semi-transparent pixels with (#rrggbb format).
  • transparencyThreshold - Threshold against which to omit transparent pixels (0-256).

You may also pass any valid child_process.spawn options, notably:

  • cwd - Directory to run apng2gif in

apng2gif.sync(inputPath[, outputPath[, options]]) => undefined

Synchronously convert the animated PNG at inputPath to GIF and write it to outputPath.

If outputPath is omitted, it defaults to inputPath but with .gif extension.

options

  • backgroundColor - Background color string to blend semi-transparent pixels with (#rrggbb format).
  • transparencyThreshold - Threshold against which to omit transparent pixels (0-256).

You may also pass any valid child_process.spawnSync options, notably:

  • cwd - Directory to run apng2gif in

License

MIT

FAQs

Package last updated on 28 Feb 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.