drwpow / batch-svg

Take a folder of raster images (JPG, PNG, GIF), and batch them into one SVG file

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Batch SVG

This uses node to take a folder of images (./src), and exports them to ./dist/layout.svg.

Setup

Node.js is required. If you’re on Mac, install Homebrew and then run brew install node from a Terminal.

Navigate to this directory:

cd ~/sites/batch-svg

…or wherever you have it. Then run:

npm i

Note: you can use yarn if you prefer.

Usage

First, place images in the ./src folder (can be JPG, GIF, or PNG). Then, run:

npm run layout

and it will crunch all the images and spit out a ./dist/layout.svg file.

Warning: this will overwrite the previous layout.svg file. Be sure to copy this file elsewhere if you need it for whatever reason.

Note: this embeds all the images in the SVG file, resulting in pretty hefty filesizes. This seemed preferrable to simply linking to images, which are fragile and break easily.

About

Take a folder of raster images (JPG, PNG, GIF), and batch them into one SVG file


Languages

Language:JavaScript 100.0%