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.2.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.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: svg_icon_gen-0.3.2.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.2.tar.gz
Algorithm Hash digest
SHA256 b48e1d9e13cacd9554f88b1beaadcdf718f77d6a62fe7801f58a0459306134e3
MD5 f60eb09da798f458c55ef19730388660
BLAKE2b-256 cee3780e563d45a2273fa9205cc948f76d91b4eab1861d371c2ca8cf42ae51ed

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: svg_icon_gen-0.3.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 41bf1baeeb4db7c002f8c726c49ac7ebff555b65aabfe1a700cc9ddf6791b0e2
MD5 c42fa0ba61c992e6966e0449c7d82a01
BLAKE2b-256 b7f4b8fc57ad8fc3494981037c50ce8ff667edfaa839135ad4bb2db8299e330e

See more details on using hashes here.

Provenance

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