All Projects → shakiba → Svgexport

shakiba / Svgexport

SVG to PNG/JPEG command-line tool and Node.js module

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Svgexport

Density Converter
A multi platform image density converting tool converting single or batches of images to Android, iOS, Windows or CSS specific formats and density versions given the source scale factor or width/height in dp. It has a graphical and command line interface and supports many image types (svg, psd, 9-patch, etc.) aswell as some lossless compressors like pngcrush.
Stars: ✭ 222 (-69.63%)
Mutual labels:  cli, svg, png, jpeg
Pixterm
Draw images in your ANSI terminal with true color
Stars: ✭ 782 (+6.98%)
Mutual labels:  cli, png, jpeg
Libvips
A fast image processing library with low memory needs.
Stars: ✭ 6,094 (+733.65%)
Mutual labels:  svg, png, jpeg
Optimizt
CLI image optimization tool
Stars: ✭ 594 (-18.74%)
Mutual labels:  svg, png, jpeg
Stegify
🔍 Go tool for LSB steganography, capable of hiding any file within an image.
Stars: ✭ 927 (+26.81%)
Mutual labels:  cli, png, jpeg
Pyecharts Snapshot
renders the output of pyecharts as png, jpeg, gif, svg, eps, pdf and raw base64
Stars: ✭ 142 (-80.57%)
Mutual labels:  svg, png, jpeg
Protodot
transforming your .proto files into .dot files (and .svg, .png if you happen to have graphviz installed)
Stars: ✭ 107 (-85.36%)
Mutual labels:  cli, svg, png
Convert Svg
Node.js packages for converting SVG into other formats using headless Chromium
Stars: ✭ 133 (-81.81%)
Mutual labels:  svg, png, jpeg
Androidsvgdrawable Plugin
Gradle plugin that generates qualified, density specific PNG drawables from SVG files at build time for your Android projects.
Stars: ✭ 263 (-64.02%)
Mutual labels:  svg, png, jpeg
Leanify
lightweight lossless file minifier/optimizer
Stars: ✭ 694 (-5.06%)
Mutual labels:  svg, png, jpeg
Compress Images
Minify size your images. Image compression with extension: jpg/jpeg, svg, png, gif. NodeJs
Stars: ✭ 331 (-54.72%)
Mutual labels:  svg, png, jpeg
Automator Workflows
A collection of Automator workflows (services) that speed up your design / development process. Compatible with LaunchBar 6 and 7 Actions
Stars: ✭ 439 (-39.95%)
Mutual labels:  svg, png, jpeg
Sharp
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
Stars: ✭ 21,131 (+2790.7%)
Mutual labels:  svg, png, jpeg
Govips
A lightning fast image processing and resizing library for Go
Stars: ✭ 442 (-39.53%)
Mutual labels:  svg, png, jpeg
Sultan
Sultan: Command and Rule over your Shell
Stars: ✭ 625 (-14.5%)
Mutual labels:  cli, command-line
Rhubarb Lip Sync
Rhubarb Lip Sync is a command-line tool that automatically creates 2D mouth animation from voice recordings. You can use it for characters in computer games, in animated cartoons, or in any other project that requires animating mouths based on existing recordings.
Stars: ✭ 623 (-14.77%)
Mutual labels:  cli, command-line
Dataproofer
A proofreader for your data
Stars: ✭ 628 (-14.09%)
Mutual labels:  cli, command-line
Papis
Powerful and highly extensible command-line based document and bibliography manager.
Stars: ✭ 636 (-13%)
Mutual labels:  cli, command-line
Micro Dev
The development environment for `micro`
Stars: ✭ 630 (-13.82%)
Mutual labels:  cli, command-line
Terjira
Terjira is a very interactive and easy to use CLI tool for Jira.
Stars: ✭ 713 (-2.46%)
Mutual labels:  cli, command-line

svgexport

svgexport is a Node.js module and command-line tool for exporting SVG files to PNG and JPEG, it uses Puppeteer for rendering SVG files.

Command Line

Installation

npm install svgexport -g

Usage

svgexport <input file> <output file> <options>
svgexport <datafile>

<options>        [<format>] [<quality>] [<input viewbox>] [<output size>] [<resize mode>] [<styles>]

<format>         png|jpeg|jpg
                 If not specified, it will be inferred from output file extension or defaults to "png".
                 
<quality>        1%-100%

<input viewbox>  <left>:<top>:<width>:<height>|<width>:<height>
                 If input viewbox is not specified it will be inferred from input file.
                 
<output size>    <scale>x|<width>:<height>|<width>:|:<height>
                 If output size is specified as width:height, <viewbox mode> is used.

<viewbox mode>   crop|pad
                 Crop (slice) or pad (extend) input to match output aspect ratio, default mode is "crop".

<datafile>       Path of a JSON file with following content:
                 [ {
                   "input" : ["<input file>", "<option>", "<option>", ...],
                   "output": [ ["<output file>", "<option>", "<option>", ...] ]
                 }, ...]
                 Input file options are merged with and overridden by output file options.
                 Instead of a JSON file, a Node module which exports same content can be provided.

Examples

Scale 1.5x proportionally:

svgexport input.svg output.png 1.5x

Scale proportionally to set output width to 32px:

svgexport input.svg output.png 32:

Scale proportionally and pad output to set output width:height to 32px:54px:

svgexport input.svg output.png pad 32:54

Export -1👎24:24 (left🔝width:height) of input.svg to output.png:

svgexport input.svg output.png -1👎24:24 1x

Set output JPEG quality:

svgexport input.svg output.jpg 80%

Use a CSS to style input SVG:

svgexport input.svg output.jpg "svg{background:silver;}"

By default, Puppeteer has a page load timeout of 30 seconds. This might not be enough for large SVG files. If you want to change the page timeout, set the SVGEXPORT_TIMEOUT environment variable to the desired number of seconds.

// One minute timeout
SVGEXPORT_TIMEOUT=60 svgexport input.svg output.png

Node.js Module

Installation

npm install svgexport --save

Usage

var svgexport = require('svgexport');

svgexport.render(datafile, callback);

datafile can be an object, an array of objects or a JSON file path, see command line usage for its format.

Contributors

svgexport was migrated from PhantomJS to Puppeteer by Michael Heerklotz.

License

Copyright (c) 2016 Ali Shakiba
Available under the MIT license

Keywords: svg, export, rasterize, converter, png, jpeg, jpg, cli, command-line, inkscape, illustrator, coreldraw

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].