--- id: cmap version: "0.7.2" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # cmap — Scientific colormaps for python, without dependencies License: permissive · Maintenance: active · Downloads: 161.4K/mo ## What it is and what it does cmap is a lightweight Python library that bundles scientific colormaps from multiple sources—matplotlib, cmocean, colorbrewer, crameri, seaborn, and others—and makes them available without requiring matplotlib as a dependency. It provides two main objects: Color (a simple RGBA wrapper with conversion methods) and Colormap (a callable that maps scalar or array values to RGBA colors). The Colormap API mimics matplotlib's behavior, making it familiar to users already working with matplotlib, but cmap can be used standalone in any visualization context. The library is designed for projects that need colormap functionality but want to avoid the overhead of installing matplotlib. It includes convenience methods to export colormaps to third-party formats compatible with napari, vispy, pygfx, plotly, bokeh, altair, earthengine-api, and pyqtgraph, making it a bridge between different visualization ecosystems. It requires only numpy at runtime and supports Python 3.9 and later. Use it for: - Use it in a data visualization library that needs colormap support without forcing users to install matplotlib. - Use it to map scientific data (images, arrays) to colors in napari, vispy, or other visualization frameworks. - Use it to access perceptually uniform colormaps from cmocean or crameri in a lightweight, numpy-only context. - Use it to build custom colormaps from color sequences and export them to multiple third-party visualization tools. - Use it in headless or server-side applications where matplotlib's full feature set is unnecessary. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. cmap provides a collection of scientific colormaps (from matplotlib, cmocean, colorbrewer, crameri, seaborn, and others) that work with only numpy as a dependency, without requiring matplotlib. Yes. cmap is actively maintained, has no security vulnerabilities, a permissive license, and solves a real problem—providing scientific colormaps without matplotlib's overhead. It is well-suited for projects that need colormap functionality but want minimal dependencies. Install it if you work with visualization libraries that support cmap exports or if you need colormaps in a lightweight, numpy-only environment. ## Install pip install cmap uv add cmap poetry add cmap ## Installing cmap Before you install: Installation is straightforward with low friction—a pure Python wheel with only numpy as a runtime dependency. The project is actively maintained with recent commits and a stable release history since late 2022. License in practice: BSD-3-Clause is a permissive open-source license; you can use, modify, and distribute cmap freely in commercial and private projects provided you include the license notice. Quickstart: pip install cmap import cmap import numpy as np cmap1 = cmap.Colormap(["red", "green", "blue"]) colors = cmap1(np.linspace(0, 1, 5)) Input arrays passed to a Colormap must be normalized to the range 0–1; raw integer or unbounded data must be rescaled before mapping. Verify before relying: - Whether the package's type annotations and test coverage meet the stated 'strictly typed and fully tested' claim. - Performance characteristics when mapping large numpy arrays to colors. ## Package facts - License: BSD-3-Clause (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 161.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags scientific colormaps numpy, colormap library no matplotlib, color palette management, matplotlib colormap alternative, visualization color schemes, RGBA color mapping, perceptually uniform colormaps, visualization, scientific-computing, color-management [View on SkillFed](https://skillfed.io/packages/cmap) · [View on PyPI](https://pypi.org/project/cmap/)