icon-svg-to-png
v1.0.2
Published
Convert SVG icons to multiple PNG sizes
Downloads
2
Maintainers
Readme
SVG to PNG Icon Converter
This package converts SVG icons to multiple PNG icons with required sizes. (Useful for React-Native applications)
Installation
npm install icon-svg-to-png
Input
- A directory containing a list of svg icons.
- Desired output sizes (optional).
Output
- A directory containing a directory for each icon, each has multiple png icons generated based on required icon sizes.
Usage
Using default output sizes [24, 48, 72]
npm icon-svg-to-png /path/to/svg/icons /path/to/output/png/icons
This command generates the following
───output
│
└───icon-1
│ └───icon-1.png (24x24)
│ └───[email protected] (48x48)
│ └───[email protected] (72x72)
│
└───icon-2
│ └───icon-2.png (24x24)
│ └───[email protected] (48x48)
│ └───[email protected] (72x72)
│
Using custom output sizes (comma separated sizes)
npm icon-svg-to-png /path/to/svg/icons /path/to/output/png/icons 24,48,512
This command generates the following
───output
│
└───icon-1
│ └───icon-1.png (24x24)
│ └───[email protected] (48x48)
│ └───[email protected] (512x512)
│
└───icon-2
│ └───icon-2.png (24x24)
│ └───[email protected] (48x48)
│ └───[email protected] (512x512)
│
Limitation
- Assuming square sized svg icons as an input