A fast and lightweight command-line tool for converting SVG files to platform-specific icon formats. Generates high-quality ICO files for Windows and ICNS files for macOS from SVG sources.
- Cross-platform support: Windows, macOS, and Linux
- Multiple output formats: ICO (Windows) and ICNS (macOS)
- High-quality rendering: Vector-based conversion with anti-aliasing
- Multiple resolutions: Generates all standard icon sizes automatically
- Retina support: Includes high-DPI variants for modern displays
- Simple interface: Single command with flexible output options
- No dependencies: Standalone binary with no external requirements
Unix/Linux/macOS:
curl -sSL https://raw.githubusercontent.com/julian-bruyers/svg2icon/main/scripts/install.sh | bashWindows PowerShell:
iwr -useb https://raw.githubusercontent.com/julian-bruyers/svg2icon/main/scripts/install.ps1 | iex- Download the appropriate binary from the releases page
- Rename it to
svg2icon(orsvg2icon.exeon Windows) - Place it in your PATH
Prerequisites:
- Go 1.21 or later
Clone and build:
git clone https://github.com/julian-bruyers/svg2icon.git
cd svg2icon
go build -o svg2icon .Unix/Linux/macOS
./scripts/build.shWindows
scripts\build.batBasic Syntax
svg2icon <input.svg> <output>Generate ICO file only:
svg2icon input.svg output.icoGenerate ICNS file only:
svg2icon input.svg output.icnsGenerate both formats in directory:
svg2icon input.svg ./icons/
# Creates: icons/input.ico and icons/input.icnsGenerate both formats with custom name:
svg2icon input.svg myicon.icon
# Creates: myicon.ico and myicon.icns# Convert app icon for Windows
svg2icon app-icon.svg app.ico
# Convert app icon for macOS
svg2icon app-icon.svg app.icns
# Generate both formats
svg2icon app-icon.svg ./build/icons/
# Convert with custom naming
svg2icon logo.svg brand.icon- Sizes: 16x16, 24x24, 32x32, 48x48, 64x64, 128x128, 256x256
- Format: PNG-encoded images within ICO container
- Color depth: 32-bit RGBA
- Standard sizes: 16x16, 32x32, 64x64, 128x128, 256x256, 512x512, 1024x1024
- Retina variants: 32x32 (16x16@2x), 64x64 (32x32@2x), 256x256 (128x128@2x), 512x512 (256x256@2x)
- Format: PNG-encoded images with Apple OSType identifiers
- Color depth: 32-bit RGBA
Build for all platforms:
./scripts/build.sh # Creates binaries in ./build/
scripts\build.bat # Windows equivalentInstall locally:
./scripts/install.sh # Unix/Linux/macOS
scripts\install.ps1 # WindowsUninstall:
./scripts/uninstall.sh # Unix/Linux/macOS
scripts\uninstall.bat # WindowsThis project is licensed under the MIT License - see the LICENSE file for details.