📅  最后修改于: 2023-12-03 15:20:23.805000             🧑  作者: Mango
Do you need to convert an SVG image to PNG format? Look no further than our SVG to PNG converter tool! This simple program allows you to quickly and easily convert your SVG files to PNG images that you can use in your projects.
Our SVG to PNG converter tool is available as a module on npm, so you can easily install it using:
npm install svg-to-png-converter
The SVG to PNG converter tool is easy to use. Simply require the module and call the convert
function with the path to your SVG file and the desired output PNG file name.
const { convert } = require('svg-to-png-converter');
convert('path/to/my/image.svg', 'output.png')
.then(() => console.log('Conversion complete!'))
.catch((err) => console.error(`Conversion failed: ${err}`));
You can also specify additional options when calling the convert
function. These include:
convert('path/to/my/image.svg', 'output.png', {
width: 800,
height: 600,
quality: 0.8,
backgroundColor: '#fff'
});
Our SVG to PNG converter tool is an easy and reliable way to convert your SVG images to PNG format. With simple installation and usage, it's the perfect solution for all your image conversion needs.