This project is a simple web-based tool that converts SVG code or files into PNG images. It also allows you to download the SVG code as a file. The tool is built using HTML, CSS, and JavaScript, and it provides an easy-to-use interface for users to convert and download images.
- Convert SVG Code to PNG: Paste your SVG code into the input field and download it as a PNG image.
- Upload SVG File: Upload an SVG file from your computer and convert it to a PNG image.
- Download SVG: Option to download the displayed SVG code as an SVG file.
- Custom Dimensions: Specify custom width and height for the PNG output.
- Real-time Preview: Automatically displays the SVG image as you enter the code or upload a file.
To use this tool, simply clone the repository and open the index.html
file in your web browser:
git clone https://github.com/yourusername/svg-to-png-converter.git
cd svg-to-png-converter
open index.html
Alternatively, you can view the live demo here.
-
Enter SVG Code:
- Manually enter SVG code into the "SVG Code" text area.
- Alternatively, upload an SVG file using the "Upload SVG File" button.
-
Set Image Name:
- Provide a name for the image to be downloaded.
-
Set Image Dimensions:
- Set the desired width and height for the PNG image.
-
Download:
- Click "Download PNG" to download the image as a PNG file.
- Click "Download SVG" to download the SVG code as an SVG file.
Contributions are welcome! If you have suggestions or improvements, feel free to create an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for more details.