Socket
Book a DemoInstallSign in
Socket

svg-animation-convert

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svg-animation-convert

Convert animated SVGs to transparent GIF/APNG/MOV/WEBM using Puppeteer + FFmpeg

1.0.3
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

๐Ÿ–ผ๏ธ svg-animation-convert

Convert animated SVGs to high-quality transparent GIF, APNG, MOV, or WEBM โ€” frame-accurate, browser-rendered.
Powered by Puppeteer + FFmpeg. MIT Licensed.

โœจ Features

  • โœ… Converts animated SVGs (SMIL, <animate>, etc.)
  • โœ… Uses a real browser for accurate rendering
  • โœ… Supports transparent backgrounds
  • โœ… Outputs: .gif, .apng, .mov, .webm
  • โœ… Infers viewport size and animation duration from SVG
  • โœ… Fully configurable via CLI

โš™๏ธ Requirements

  • FFmpeg installed and available in $PATH
  • Node.js โ‰ฅ 18
  • Bun or npm

๐Ÿ“ฆ Installation

No install needed โ€” use with bunx or npx:

bunx svg-animation-convert --input=animate.svg --output=out.apng
# or
npx svg-animation-convert --input=animate.svg --output=out.apng

๐Ÿš€ Usage

bunx svg-animation-convert --input=animate.svg --output=out.gif [options]

Required:

  • --input=... โ€” Path to animated SVG
  • --output=... โ€” Output file path (must end in .gif, .apng, .mov, or .webm)

Optional:

FlagDescriptionDefault
--durationDuration in ms (inferred from SVG if omitted)โ€”
--fpsFrames per second24
--loopLooping (-1 once, 0 infinite, N loops)0
--framesTemp frame directoryframes

๐Ÿ” Loop Behavior

--loopMeaning.gif.apng
-1Play once-loop -1-plays 1
0Loop forever-loop 0-plays -1
N > 0Loop N times-loop N-plays N+1

๐Ÿ“‚ Example

bunx svg-animation-convert \
  --input=animate.svg \
  --output=out.apng \
  --fps=30 \
  --loop=0

This:

  • Loads animate.svg in a headless browser
  • Renders each frame at 30 FPS
  • Outputs a transparent APNG
  • Loops the animation forever

๐Ÿงช Notes

  • Only supports SMIL-based animations (<animate>, <set>, etc.)
  • Does not evaluate JavaScript-driven SVG animations
  • Resolution is auto-detected from viewBox, width, or height

๐Ÿ“ License

MIT โ€” ยฉ Almog Baku

Keywords

svg

FAQs

Package last updated on 13 Apr 2025

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.