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

Star History

Star History Chart

๐Ÿ“„ 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.1.tar.gz (6.7 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.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: svg_icon_gen-0.3.1.tar.gz
  • Upload date:
  • Size: 6.7 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.1.tar.gz
Algorithm Hash digest
SHA256 c00602214bf210a9edbdea186a392319af8181550c97b2bad25cd7e23f89041d
MD5 74159d283b09683cdbc607cd82e79bd1
BLAKE2b-256 18321e47bf9156b346b64c2ee31c2e3fa20f486e4fd659c00d5a5227bb20c16f

See more details on using hashes here.

Provenance

The following attestation bundles were made for svg_icon_gen-0.3.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: svg_icon_gen-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8440a19c66051e6d39a5ee7f0d9aca2b87cee1b7edc8513e4c91b701c34302ce
MD5 3577a1365d8fcfa4880e5e3321ab2ba1
BLAKE2b-256 bd846250c61af7b6b92fcf1120e576a8f4e60ac968d781349184f77b28975541

See more details on using hashes here.

Provenance

The following attestation bundles were made for svg_icon_gen-0.3.1-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