napari-svg is a plugin for the napari viewer that enables exporting layers as SVG (Scalable Vector Graphics) files. It integrates directly into napari's file saving mechanism, allowing users to save their viewer's contents as vector graphics. The current version is 0.2.1, and being a napari plugin, its release cadence often aligns with napari's ecosystem updates, offering stability for its core functionality.
pip install napari-svgNo compatibility data collected yet for this library.
This quickstart demonstrates how to launch a napari viewer, add some sample layers, and then explains how to use the napari-svg plugin via the napari GUI's 'Save As...' dialog. The plugin automatically registers itself with napari's file writer system upon installation. While programmatic saving is also possible through `viewer.save()`, the GUI method ensures the plugin's writer is correctly invoked and provides direct user control over export options.
Be aware of this limitation when expecting pixel-perfect image or label representation. This plugin is best suited for vector-like layers (e.g., shapes, points). For raster data, consider taking screenshots or using other napari export methods.
Avoid using text layers if SVG export is critical, or add text annotations manually to the SVG after export using a vector graphics editor.
Ensure napari is updated to `0.4.19` or newer (`pip install --upgrade napari`). Verify `napari-svg` is installed in the same environment as napari (`pip list | grep napari-svg`). Restart napari after installation.
Recognize that this plugin primarily handles vector-based layers (shapes, points) effectively. For raster data, consider taking a direct screenshot of the napari viewer or using other export methods designed for pixel-based output.
Install the package using `pip install napari-svg`. Ensure you are running napari from the same environment where the plugin was installed. If using anaconda, activate the correct environment first.
1. Ensure `napari-svg` is installed (`pip install napari-svg`). 2. Update napari to a recent version (`pip install --upgrade napari`). 3. Restart napari after installation/update to allow plugin discovery.