neocotic / convert-svg

Node.js packages for converting SVG into other formats using headless Chromium
MIT License
200 stars 47 forks source link

Add convert-svg-to-jpeg package to convert SVG to JPEG #18

Closed neocotic closed 7 years ago

neocotic commented 7 years ago

This PR takes advantage of the new modular packages (see #17) and adds a new SVG converter for JPEG.

Since JPEGs do not support transparency, any transparent regions on the SVG will be white. This will be controllable further when #14 has been implemented.

A new quality API and CLI option is also available for this converter alone (i.e. not applicable for convert-svg-to-png). It accepts a value between 0-100 (inclusive) that can be used to control the quality of the JPEG output, with a default value of 100, for maximum quality.