Skip to main content

Convert SVG files into production-ready icon sets for Windows and macOS

Project description

svg-icon-gen

PyPI License

Convert a single SVG into a complete icon set โ€” ICO, ICNS, macOS menu bar templates, and PNG exports โ€” in one command.

svg-icon-gen logo.svg

๐Ÿ”ง Installation

pip install svg-icon-gen

Note: svg-icon-gen depends on Cairo via cairosvg. If the install fails, install Cairo first:

Platform Command
macOS brew install cairo
Ubuntu / Debian sudo apt install libcairo2
Windows Install GTK for Windows

โฌ†๏ธ Output

Running svg-icon-gen logo.svg produces:

logo/
โ”œโ”€โ”€ logo.ico                          # Windows icon (16โ€“256px, multi-res)
โ”œโ”€โ”€ logo_dark.ico                     # Inverted variant
โ”œโ”€โ”€ logo.icns                         # macOS app icon (16โ€“1024px)
โ”œโ”€โ”€ logo_mac_template.png             # Menu bar icon, black 1x
โ”œโ”€โ”€ logo_mac_template@2x.png          # Menu bar icon, black 2x
โ”œโ”€โ”€ logo_mac_template_dark.png        # Menu bar icon, white 1x
โ”œโ”€โ”€ logo_mac_template_dark@2x.png     # Menu bar icon, white 2x
โ””โ”€โ”€ png/
    โ”œโ”€โ”€ light/
    โ”‚   โ”œโ”€โ”€ logo_16x16.png
    โ”‚   โ”œโ”€โ”€ logo_32x32.png
    โ”‚   โ””โ”€โ”€ ...
    โ””โ”€โ”€ dark/
        โ””โ”€โ”€ ...

โš™๏ธ Usage

# Single file
svg-icon-gen logo.svg

# Multiple files
svg-icon-gen icon1.svg icon2.svg icon3.svg

# Glob
svg-icon-gen assets/*.svg

# Watch mode โ€” regenerate on save
svg-icon-gen logo.svg --watch

# Custom output directory
svg-icon-gen logo.svg --out-dir ./dist/icons

# Custom PNG sizes
svg-icon-gen logo.svg --png-sizes 16,32,128,512

๐Ÿšฉ Flags

Flag Description
--watch Watch for changes and regenerate automatically
--ico-only Generate ICO only
--icns-only Generate ICNS only
--mac-only Generate macOS Template PNGs only
--png-only Generate PNGs only
--no-dark Skip dark/inverted variants
--png-sizes SIZES Comma-separated sizes (default: 16,32,64,128,256,512)
--out-dir DIR Output directory root (default: same folder as SVG)

Platform Notes

๐ŸชŸ Windows โ€” ICO

Standard multi-resolution .ico containing 16, 32, 48, 64, 128, and 256px layers.

๐Ÿ’ป macOS โ€” ICNS

Full Apple-spec .icns for app icons, containing all required sizes from 16px to 1024px. Uses icnsutil (pure Python, cross-platform). On macOS without icnsutil, falls back to the native iconutil CLI.

๐ŸŽ macOS โ€” Menu Bar Template Icons

*Template.png files follow Apple's naming convention โ€” the system automatically inverts them for light/dark menu bars. The _dark white variant is provided for frameworks that require an explicit white icon (Electron, Tauri, SwiftUI NSStatusItem).

File Use case
*Template.png / *Template@2x.png Native macOS apps, system auto-adapts
*Template_dark.png / *Template_dark@2x.png Electron / Tauri explicit dark mode

๐Ÿ”ญ Watch Mode

Install watchdog for instant file-system event detection. Without it, --watch falls back to polling every second.

pip install watchdog

๐Ÿ“„ License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

svg_icon_gen-0.3.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

svg_icon_gen-0.3.0-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

Details for the file svg_icon_gen-0.3.0.tar.gz.

File metadata

  • Download URL: svg_icon_gen-0.3.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for svg_icon_gen-0.3.0.tar.gz
Algorithm Hash digest
SHA256 f3c782ee08a1cc2d76a59f3817fe106e521166bb57107404421751eeb5c5d4f5
MD5 5e704828e1ee31221cd77d557ef22528
BLAKE2b-256 e0ad3a2aab944d80193ecd59c3adc1190841df7ac316e2cad958facbc2c79273

See more details on using hashes here.

Provenance

The following attestation bundles were made for svg_icon_gen-0.3.0.tar.gz:

Publisher: publish.yml on Kookiejarz/svg-icon-gen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file svg_icon_gen-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: svg_icon_gen-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for svg_icon_gen-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5f1989b07157d3c568b731d7dbec17ab38dade7d0fe92031dfe32dbf335a4f6b
MD5 17d4f02a2df295861e109114f7cc676f
BLAKE2b-256 48e0139435ba1fef3bf8411a75ddfdab15d685b1fee67a692047bed595914513

See more details on using hashes here.

Provenance

The following attestation bundles were made for svg_icon_gen-0.3.0-py3-none-any.whl:

Publisher: publish.yml on Kookiejarz/svg-icon-gen

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page