Skip to main content

resources

Graphics and copy resources for the napari project.

For a quick download link to the up-to-date logos, see the dowload section of the latest release.

Permissions and usage guidelines

License

The resources in this repo are available under a CC-BY-NC-ND 4.0 license. The package source code is available under a BSD 3-Clause license.

We further kindly request that you follow the guidelines below when using the logo.

Usage guidelines

You may use the napari logo to describe factual use of the software in your own projects, for example in papers, figures, posters, conference talks, and project websites. Examples:

  • ✅ We explored the data in napari and came to the conclusion that…
  • ✅ We provide a reader for napari to visualize our novel data…
  • ✅ In addition to our standalone library, we provide a napari plugin to…
  • ✅ We provide training and consultation in the use of napari for…
  • ✅ We intend to analyze the resulting data by using napari with the following plugins…

You should not use the napari logo to imply endorsement of your project by napari without prior written permission by the napari Steering Council. Examples:

  • 🚫 The napari team will support this effort with…
  • 🚫 The napari community needs this functionality because…
  • 🚫 napari supports this proposed standard…

Conjecture is allowed when clearly marked as such:

  • ✅ We believe that the napari project would benefit from these changes…

You may use the napari logo in swag (pens, pins, stickers, etc) for personal or small group usage, as long as that use is not for fundraising.

logos

The napari logos are generated from a set of variants (the logo icon) and templates (the arrangement of icon and text). The SVGs that ship in the package are regenerated automatically whenever it is built or installed (see hatch_build.py), so there is nothing to run to use them.

Installation

uv pip install napari-resources

For local development, pip install -e . triggers the same build hook and writes the generated assets into your source tree. uv sync also works, but it is incremental — it won't rebuild an already-installed project, so use uv sync --reinstall-package napari-resources to force the hook to re-run.

Usage

Get a generated logo with logo_path:

from napari_resources import logo_path

svg = logo_path("gradient-plain-dark.svg")
svg.read_bytes()  # the raw SVG

logo_path returns a pathlib.Path to the logo, which you can read, open, or hand to a GUI — e.g. QPixmap(str(svg)), or render it to a QIcon with QSvgRenderer (the same pattern napari uses for its window icon in napari/_qt/qt_event_loop.py). It resolves napari_resources/resources/logos/generated/<name> via importlib.resources, so it behaves identically from an installed wheel or an editable install. If the asset isn't present (e.g. a fresh checkout that hasn't been installed), it raises FileNotFoundError with instructions.

Rasterizing a logo (making an image / PNG)

The logo SVGs are vector graphics, so getting an image (a numpy array or a PNG) requires rendering them to pixels — there's no way around that. Three options, depending on what you need:

  • In a Qt app (napari already ships Qt), render with a small helper:

    import numpy as np
    from qtpy.QtGui import QImage, QPixmap
    
    
    def logo_rgba(name):
        image = QPixmap(str(logo_path(name))).toImage().convertToFormat(QImage.Format.Format_RGBA8888)
        ptr = image.constBits()
        if hasattr(ptr, "setsize"):
            ptr.setsize(image.sizeInBytes())
        return np.frombuffer(ptr, dtype=np.uint8).reshape((image.height(), image.width(), 4)).copy()
    
    
    array = logo_rgba("gradient-plain-dark.svg")  # (824, 824, 4) uint8
    
  • With cairosvg (works out of the box on macOS/Linux; needs libcairo on Windows), decode the PNG with imageio (which napari already ships):

    import cairosvg
    import imageio.v3 as iio
    
    png = cairosvg.svg2png(url=str(logo_path("gradient-plain-dark.svg")))
    array = iio.imread(png)  # (824, 824, 4) uint8
    
  • For a PNG file with no code, download the pre-built PNGs from the GitHub releases (CI builds them), or run the generator locally with -p (needs inkscape): uv run python -m napari_resources.generate_logos generated -p.

The same lookup with importlib.resources directly:

from importlib import resources

path = resources.files("napari_resources.resources.logos") / "generated" / "gradient-plain-dark.svg"

To enumerate the available logos (e.g. to build a picker), use logo_variants and logo_templates. Generated filenames are <variant>-<template>-<mode>.svg:

from napari_resources import logo_path, logo_templates, logo_variants

for variant in logo_variants():
    for template in logo_templates():
        for mode in ("light", "dark"):
            logo_path(f"{variant}-{template}-{mode}.svg")

Adding or editing logos

Logos are generated by combining a variant (the icon) with a template (the arrangement). To add a new logo, add a variant to variants/ that follows the same structure as the existing ones: group hierarchy and labels in inkscape must be maintained (such as outer-border and logo).

[!IMPORTANT] If you add text to a variant or template, convert the Object to Path before saving it, so it will work even on systems where the font is not available! Also, use the custom AlataPlus font when appropriate.

The SVGs are regenerated into src/napari_resources/resources/logos/generated/ whenever the package is built or (re)installed. After editing a template or variant, either force a rebuild with uv sync --reinstall-package napari-resources (or pip install -e .), or regenerate straight into that directory — editable installs read directly from the source tree, so the new logos are picked up immediately without reinstalling:

mkdir -p src/napari_resources/resources/logos/generated
uv run python -m napari_resources.generate_logos src/napari_resources/resources/logos/generated

The -p -i --montage flags (which require inkscape/imagemagick/icnsutils) are only used in CI to build the release assets into ./generated; omit them for a plain SVG preview.

You can also pass custom files to variant and templates and a custom color to mode to try out new versions without adding them to the package; see the -h for all options.

fonts

The "napari" font AlataPlus is a merge of Alata with glyphs from M_PLUS_1p. The compiled font ships with the package, so it is available automatically; it is only regenerated from its sources when the underlying fonts change (uv run python -m napari_resources.generate_font <dest_dir>).

Download files

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

Source Distribution

napari_resources-1.0.1.tar.gz (2.4 MB view details)

Uploaded Source

Built Distribution

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

napari_resources-1.0.1-py3-none-any.whl (2.7 MB view details)

Uploaded Python 3

File details

Details for the file napari_resources-1.0.1.tar.gz.

File metadata

  • Download URL: napari_resources-1.0.1.tar.gz
  • Upload date:
  • Size: 2.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for napari_resources-1.0.1.tar.gz
Algorithm Hash digest
SHA256 78985f16dee0732ecf344430aa594eb77fe778e1ea63e7c24b33b016b5e6e858
MD5 9ba148ab4e9cc6dde7f7ae91fa4ef248
BLAKE2b-256 6b7ff84883d292a80a6c83d560300e2ae2a4cca613f80d61fb67061e0f0c07be

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_resources-1.0.1.tar.gz:

Publisher: build_and_release.yml on napari/napari-resources

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

File details

Details for the file napari_resources-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for napari_resources-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 23eb212d1b577e6c8d2fc7fe93e83a2b5d4a2b1a4b46c1767bce454171eff70e
MD5 c2325a3b44ae3f96a9d3749846629274
BLAKE2b-256 cf7cadfefa9b43da78d44decf5ce3cabefdfaa56008275e7e5b896a009824c46

See more details on using hashes here.

Provenance

The following attestation bundles were made for napari_resources-1.0.1-py3-none-any.whl:

Publisher: build_and_release.yml on napari/napari-resources

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

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 files

1.0.0

2 files

0.0.5

2 files

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