Skip to main content

SVG Sprite Viewer

CI Release License Python PySide6 Linux macOS Windows

A small, clean PySide6 desktop app that opens an SVG sprite (e.g. icons.svg), extracts icons from symbol, defs, stack, and view sprites, and presents them in a responsive tile grid.

Sprite Viewer screenshot

Features

  • Parses an SVG sprite and shows all icons as a tile grid; each icon's id is shown as a tooltip on hover
  • Fast QtSvg (SVG Tiny) rendering by default, with optional full SVG 1.1 via resvg (gradients, filters, masks, …) — switchable live from the toolbar and via the --renderer flag, so sprites like the Tango icon set render exactly (but slower).
  • Toolbar dropdown to switch the icon size: 16, 32, 64, 128 or 256 px
  • Icons are rendered asynchronously in the background, so the UI stays responsive
  • Right-click → Copy id or Copy SVG puts the fragment id(s) or the standalone SVG code on the clipboard (works for single and multi-selection). You can select multiple icons with Ctrl + click.
  • Open Sprite button in the status bar loads a different SVG sprite at runtime
  • Status bar shows the selection / icon count
  • Cross-platform, installable via a one-line installer or pip

Requirements

  • Python 3.10+
  • PySide6 6.12+
  • resvg-py 0.5+ (optional but recommended; falls back to QtSvg when missing)

Quick start (from source)

python3 -m venv --system-site-packages .venv   # project-local virtualenv
.venv/bin/python -m pip install -r requirements.txt   # PySide6 + resvg-py
./main.py                                      # opens the default sprite at 64 px
./main.py --size 32                            # same sprite, sized 32 px
./main.py icons.svg --size 64                  # a different sprite file
./main.py --renderer qtsvg                     # fast QtSvg backend (default)
./main.py --renderer resvg                     # full SVG 1.1 (slower, higher fidelity)

./main.py automatically re-executes itself with .venv/bin/python when that virtualenv exists, so icons always render with the full resvg feature set (gradients, filters, …) instead of the reduced QtSvg fallback. Starting via .venv/bin/python main.py (or an activated venv) works the same way.

Command-line options

Option Values Description
-h, --help — show help and exit
-V, --version — show the version and exit
-S, --size 16, 32, 64, 128, 256 (default 64) icon edge length in pixels
-R, --renderer qtsvg (default), resvg, auto SVG rendering backend

All forms work per GNU getopt: -S 32, -S32, --size 32, --size=32 (and the same for --renderer). The sprite path is purely positional and may appear before, between or after the options (-- ends option parsing).

  • qtsvg (default) — Qt's built-in SVG Tiny renderer. Much faster, because it draws straight into the icon image through Qt's native, accelerated raster path (no PNG round-trip), but supports only a subset — gradients, filters, masks and other advanced features are dropped.
  • resvg — full SVG 1.1 via the resvg library: gradients, filters, masks, markers, … render exactly (e.g. the Tango icon set). It rasterises the complete spec and hands the result back as a PNG that still has to be decoded, so it is noticeably slower — especially with large sprites.
  • auto — use resvg when installed, otherwise QtSvg.

Rule of thumb: for normal, simple icons (flat fills, paths, plain shapes) keep the default qtsvg; reach for resvg only when the sprite relies on gradients, filters, masks or other advanced SVG features.

At runtime the toolbar shows a “Full SVG (resvg)” checkbox (only when resvg-py is installed). It switches the backend live and re-renders the current sprite — unchecked means qtsvg. The --renderer flag sets the initial state of that checkbox.

The optional --size flag accepts 16, 32, 64, 128 or 256 (default 64).

Installation

install.py installs the app (pip) and registers it in your desktop session:

python3 install.py

It installs into the first of these that works:

  1. an active virtual environment,
  2. the current user's site-packages (pip --user),
  3. a dedicated venv under ~/.local/share/spriteviewer/venv (standard for PEP 668 managed systems).

Afterwards the app is registered platform-dependent:

Platform Registration
Linux .desktop entry + hicolor icon in ~/.local/share
macOS app bundle in ~/Applications/Sprite Viewer.app
Windows Start Menu shortcut

System-wide installation (requires root/admin):

python3 install.py --system

Via pip

pip install .
spriteviewer            # launch the installed command

Usage

  • Tile thumbnails load asynchronously and scale to the selected size.
  • Open Sprite in the status bar lets you load another SVG sprite without restarting the app (a file picker opens where you last loaded from).
  • Right-click an icon for the context menu: Copy id puts the SVG fragment id(s) on the clipboard, Copy SVG the complete, self-contained SVG document of the selected icon(s).
  • Multi-select icons (Ctrl/Shift + click) to copy several at once.

Any SVG file passed as an argument is used as the sprite, which also lets you hand it files from your file manager. python -m spriteviewer works the same way as ./main.py.

Compressed sprites are read transparently: gzip-packed files (.svgz or .svg.gz) and zip archives containing a single .svg (.svg.zip) work exactly like plain .svg files. A zip with several .svg members is rejected with a clear error — an icon pack is not a sprite.

Project structure

.
├── main.py                  # development entry point (adds src/, re-execs into .venv)
├── install.py               # cross-platform installer
├── pyproject.toml           # packaging + `spriteviewer` console script
├── requirements.txt         # runtime dependencies (PySide6, resvg-py)
├── spriteviewer.desktop     # desktop entry template (Linux)
├── docs/
│   └── screenshot.png
└── src/
    └── spriteviewer/        # the package (PEP 517 src layout)
        ├── __init__.py      # package exports
        ├── __main__.py      # `python -m spriteviewer`
        ├── app.py           # installed entry point / CLI parsing
        ├── icon_store.py    # sprite parsing + SVG rendering (resvg/QtSvg)
        ├── main_window.py   # toolbar, tile view, context menu
        ├── icons.svg        # bundled sprite (package data)
        └── spriteviewer.svg # bundled app icon (package data)

License

GPL-3.0-or-later — see LICENSE.

Metadata

Release files for spriteviewer 0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for spriteviewer 0.3
File Size Uploaded Provenance Actions
spriteviewer-0.3.tar.gz 76.8 kB Without provenance Details for spriteviewer-0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spriteviewer 0.3
File Interpreter ABI Platform Actions
spriteviewer-0.3-py3-none-any.whl Python 3 none any Details for spriteviewer-0.3-py3-none-any.whl

Total release size: 147.2 kB

Release files / spriteviewer-0.3.tar.gz

Download URL spriteviewer-0.3.tar.gz
Size 76.8 kB
Tags Source
SHA-256 checksum
How to use checksums
473d065d21c59f8c6474edaafe89ea7efab6bc1d13edc196c6c4584bfd56c6d8
BLAKE2b-256 checksum
How to use checksums
5ec2f1d07902b4d62261e1f3ece081fae5dc0f002b666552518e92236a44a9b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / spriteviewer-0.3-py3-none-any.whl

Download URL spriteviewer-0.3-py3-none-any.whl
Size 70.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70568a6991fc50c5baad967fd4e309deab3b19d4ce28d16040f1e50b4d7de647
BLAKE2b-256 checksum
How to use checksums
73493f8a91d3c1706ffc3362d4c930a3b430b52853c742abffdbcda4ad3ccfeb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for spriteviewer 0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page