skillfed

cmap

Scientific colormaps for python, without dependencies

cmap v0.7.2 161.4K downloads/30d#10,634 on PyPI188
Permissive license BSD-3-Clause Active released

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 on this page — 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

cmap on PyPI

pip

pip install cmap

uv

uv add cmap

poetry

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 the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 1 — numpy
Maintenance actively maintained — 171 days since the last release
Last repo commit
First released
Downloads 161,434/month — #10,634 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: cmap-0.7.2-py3-none-any.whl

Development Status :: 4 - BetaLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9

Tags

scientific colormaps numpycolormap library no matplotlibcolor palette managementmatplotlib colormap alternativevisualization color schemesRGBA color mappingperceptually uniform colormaps
visualizationscientific-computingcolor-management

More Graphics packages