skan
Skeleton analysis in Python
What it is and what it does
skan is a Python library for analyzing skeleton images—binary images where objects have been reduced to their thin, one-pixel-wide centerlines. It extracts topological and morphological information from these skeletons, such as branch points, endpoints, and path lengths, representing them as graph structures. The package is built on established scientific libraries (NumPy, SciPy, scikit-image, NetworkX) and integrates with napari for visualization.
Typical use is in biomedical imaging (analyzing blood vessel networks, neuron morphology), materials science (fiber networks, crack patterns), and any domain where understanding the connectivity and geometry of thin structures matters. You load a binary skeleton image, convert it to a graph representation, and query its structural properties.
Use it for:
- Quantify branching patterns and connectivity in microscopy images of blood vessels or neural networks.
- Extract path lengths and tortuosity metrics from fiber or crack networks in materials.
- Identify and classify junction types and endpoints in road or river network maps.
- Measure skeleton robustness by analyzing how removal of nodes affects network connectivity.
- Generate summary statistics on skeleton morphology for automated image classification tasks.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Analyzes skeleton (thin object) images to extract and characterize their structure, connectivity, and morphological properties using Python.
Yes. The package is actively maintained, has no security vulnerabilities, installs cleanly, and fills a specific niche in skeleton image analysis with a mature dependency stack. It is appropriate for research and production use in image analysis pipelines. The Alpha status reflects ongoing development but not instability.
Install
skan on PyPI
pip
pip install skanuv
uv add skanpoetry
poetry add skanInstalling skan
Before you install
Low friction: pure Python wheel with no compiled dependencies. Active maintenance with recent commits and a stable dependency stack of well-established scientific libraries.
License in practice
BSD 3-Clause is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
import skan
import imageio
# Load a binary skeleton image
image = imageio.imread('skeleton.png')
# Analyze the skeleton
results = skan.csr.summarise(skan.csr.skeleton_to_csgraph(image))
Requires Python 3.9 or later; input images should be binary (foreground/background) skeletons.
Verify before relying
- Whether the package handles 3D skeleton images or is limited to 2D
- Performance characteristics on very large images or complex skeleton networks
- Specific output metrics and how they relate to standard morphological descriptors
Package facts
| License | BSD 3-Clause (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 11 — imageio, matplotlib, networkx, numba, numpy, pandas, openpyxl, scikit-image, scipy, toolz, tqdm |
| Maintenance | actively maintained — 189 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 130,711/month — #11,629 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: skan-0.13.1-py3-none-any.whl
Keywords: image processing, skeletons
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
scikit-imagescikit-image provides algorithms for image…
permissive · top 1,000 on PyPI
shapely-polyskelComputes the straight skeleton of a polygon, a…
copyleft · top 15,000 on PyPI
momepyMomepy quantifies urban form through…
permissive · top 15,000 on PyPI
pymupdf-layoutPyMuPDF Layout analyzes PDF structure and…
agpl · top 1,000 on PyPI
connected-components-3dLabels connected components in 2D and 3D images…
copyleft · top 15,000 on PyPI
anastructAnalyzes 2D frames and trusses to compute…
copyleft · top 15,000 on PyPI
imutilsimutils provides convenience wrappers around…
unclear · top 15,000 on PyPI
naparinapari is an interactive, multi-dimensional…
permissive · top 15,000 on PyPI
pycat-napariPyCAT-Napari is a napari-based desktop…
permissive · top 15,000 on PyPI
imagesizeReads image file headers to extract dimensions,…
permissive · top 1,000 on PyPI