https://github.com/xeeo/svg2pngs
This is a command-line tool for converting SVG to PNG in multiple resolutions (@1x @2x @3x)
https://github.com/xeeo/svg2pngs
converter images png react-native svg svg2png
Last synced: 12 months ago
JSON representation
This is a command-line tool for converting SVG to PNG in multiple resolutions (@1x @2x @3x)
- Host: GitHub
- URL: https://github.com/xeeo/svg2pngs
- Owner: xeeo
- License: apache-2.0
- Created: 2017-11-29T00:26:11.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-05-03T14:16:45.000Z (about 3 years ago)
- Last Synced: 2025-03-25T15:49:06.964Z (over 1 year ago)
- Topics: converter, images, png, react-native, svg, svg2png
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 14
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
# SVG to PNG (@1x @2x @3x)
This is a command-line tool for converting SVG to PNG in multiple resolutions (@1x @2x @3x)
## Install
```sh
npm install -g svg2pngs
```
or
```sh
yarn global add svg2pngs
```
## Usage
Let's assume you have a project with multiple *.svg files in multiple sub-folders like this:
```sh
app
├── images
│ └── Image1.svg
└── main-images
├── small-images
│ └── Image2.svg
└── Image3.svg
```
You have to cd into the main folder and run the following command:
```sh
cd app
svg2pngs
```
This will walk though the entire folder structure and create the associated *png files in 3 resolutions @1x, @2x and @3x.
The end result would be something like this:
```sh
app
├── images
│ ├── Image1.svg
│ ├── Image1.png
│ ├── Image1@2x.png
│ └── Image1@3x.png
└── main-images
├── small-images
│ ├── Image2.svg
│ ├── Image2.png
│ ├── Image2@2x.png
│ └── Image2@3x.png
├── Image3.svg
├── Image3.png
├── Image3@2x.png
└── Image3@3x.png
```
Enjoy !
#### Disclosure
This project is based on * [Rebar's tool](http://codefoundries.com/developer/rebar-architecture/units/tools/build-app-images.html).