fastremap
Remap, mask, renumber, unique, and in-place transposition of 3D labeled images. Point cloud too.
Decision gist · record as of 2026-08-14
Yes, if you work with large labeled NumPy arrays (segmentations, connectomics, image analysis) and need fast remapping, renumbering, or transposition. The LGPL-3.0 copyleft license is permissive for open-source use but requires careful review in proprietary contexts. Install friction is moderate due to the C++ extension, but pre-built wheels cover common platforms. No known security vulnerabilities.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires NumPy; if pre-built wheels are unavailable for your platform, a C++ compiler is needed to build from source.
- Medium install friction due to compiled C++ extension; pre-built wheels available for Python 3.10–3.13 on macOS, Linux, and Windows.
- Actively maintained with a recent release (64 days ago).
License · maintenance · safety
LGPL-3.0 (copyleft) — LGPL-3.0 copyleft license requires derivative works to be distributed under the same license and provide source code; acceptable for most open-source projects but may conflict with proprietary software licensing.
last release 2026-06-11 (64 days) · last repo commit 2026-06-11 · 65 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 172,921 downloads/mo, #10,321 on PyPI
Alternatives
Verify before relying
pip install fastremap
import fastremap
import numpy as np
labels = np.array([1, 3, 5, 5, 10])
uniq, cts = fastremap.unique(labels, return_counts=True)
labels, remapping = fastremap.renumber(labels, in_place=True)- Whether the performance gains over NumPy operations scale predictably with array size or are most significant for specific data types or dimensions.
- Compatibility and performance characteristics on platforms beyond the listed wheel distributions.
What it is and what it does
fastremap is a C++-accelerated library for fast array manipulation on labeled NumPy arrays, designed for image processing and connectomics workflows. It provides optimized implementations of common operations like finding unique values, remapping labels via dictionary, renumbering to smaller data types, and extracting point clouds—operations that would be slow in pure Python or inefficient in NumPy for large sparse label spaces.
The package trades install complexity (compiled extension) for speed on bulk array operations. Its main use case is handling large labeled images (hundreds of megabytes to gigabytes) where Python loops or naive NumPy indexing become impractical. It also offers in-place transposition and memory-efficient array format conversions (C to Fortran order), useful when moving data between CPU, GPU, or disk.
Use it for
- Renumber a 64-bit segmentation label array down to 8-bit to save memory and fit smaller data types.
- Remap arbitrary label values via dictionary on huge arrays without materializing an intermediate lookup table.
- Extract coordinates of all voxels belonging to each label in a 3D image as a point cloud.
- Count unique labels and their frequencies much faster than np.unique on large labeled arrays.
- Physically transpose rectangular arrays in-place to convert between C and Fortran memory order before GPU upload or serialization.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you work with large labeled NumPy arrays (segmentations, connectomics, image analysis) and need fast remapping, renumbering, or transposition.
The LGPL-3.0 copyleft license is permissive for open-source use but requires careful review in proprietary contexts. Install friction is moderate due to the C++ extension, but pre-built wheels cover common platforms. No known security vulnerabilities.
Install
fastremap on PyPI
Before you install
Medium install friction due to compiled C++ extension; pre-built wheels available for Python 3.10–3.13 on macOS, Linux, and Windows. Actively maintained with a recent release (64 days ago).
Requires NumPy; if pre-built wheels are unavailable for your platform, a C++ compiler is needed to build from source.
License in practice
LGPL-3.0 copyleft license requires derivative works to be distributed under the same license and provide source code; acceptable for most open-source projects but may conflict with proprietary software licensing.
Quickstart
pip install fastremap
import fastremap
import numpy as np
labels = np.array([1, 3, 5, 5, 10])
uniq, cts = fastremap.unique(labels, return_counts=True)
labels, remapping = fastremap.renumber(labels, in_place=True)
Verify before relying
- Whether the performance gains over NumPy operations scale predictably with array size or are most significant for specific data types or dimensions.
- Compatibility and performance characteristics on platforms beyond the listed wheel distributions.
Package facts
| License | LGPL-3.0 copyleft |
| Python support | Supports the current Python release <4.0,>=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packagenumpy |
| Maintenance | Actively maintained 64 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 172,921 / month, #10,321 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Utilities |
Evidence: fastremap-1.20.0-cp310-cp310-macosx_10_9_x86_64.whl; fastremap-1.20.0-cp310-cp310-macosx_11_0_arm64.whl; fastremap-1.20.0-cp310-cp310-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; fastremap-1.20.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; fastremap-1.20.0-cp310-cp310-win32.whl; fastremap-1.20.0-cp310-cp310-win_amd64.whl; fastremap-1.20.0-cp311-cp311-macosx_10_9_x86_64.whl; fastremap-1.20.0-cp311-cp311-macosx_11_0_arm64.whl; fastremap-1.20.0-cp311-cp311-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; fastremap-1.20.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; fastremap-1.20.0-cp311-cp311-win32.whl; fastremap-1.20.0-cp311-cp311-win_amd64.whl; fastremap-1.20.0-cp312-cp312-macosx_10_13_x86_64.whl; fastremap-1.20.0-cp312-cp312-macosx_11_0_arm64.whl; fastremap-1.20.0-cp312-cp312-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl; fastremap-1.20.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; fastremap-1.20.0-cp312-cp312-win32.whl; fastremap-1.20.0-cp312-cp312-win_amd64.whl; fastremap-1.20.0-cp313-cp313-macosx_10_13_x86_64.whl; fastremap-1.20.0-cp313-cp313-macosx_11_0_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “fast array remapping”
- fastremapRemap, renumber, and relabel NumPy arrays at C++ speed, plus perform…
- pyvrlExposes Vector's VRL (Vector Remap Language) to Python, enabling fast…
- floxFlox provides fast GroupBy reduction operations for arrays using dask…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also numpy-minmax · pyvrl · awkward0 · edt · numpy-rms · color-operations · fill-voids · spatial_image · numexpr · xarray