This little utility script, svg-to-icons.sh
, is designed to automate the conversion of an SVG file into multiple PNG files, tailored for use as icons in a Chrome extension. It generates PNG files in the standard sizes required by Chrome (16x16, 48x48, and 128x128 pixels).
- ImageMagick
- A Unix-like environment (Linux, MacOS)
-
Ensure ImageMagick is installed on your system. If not, install it using:
sudo apt-get update sudo apt-get install imagemagick
-
Clone or download this script into your local machine.
- Place your SVG file in the same directory as the script or provide the relative path.
- Make the script executable:
chmod +x svg-to-icons.sh
- Run the script with the SVG file as an argument:
./svg-to-icons.sh your-icon.svg
The script will create a directory named icons
and generate PNG files (icon16.png
, icon48.png
, icon128.png
) with the corresponding sizes from the provided SVG file.
This project is licensed under the MIT License - see the LICENSE file for details.
William Owen (wo.dev)