Install & Compatibility
Where this runs
tested against v2.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.524s · 124.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 5.4s · import 0.546s · 121MB
136MB installed
● package 136MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
imgviz
✓ import imgviz
✗ from imgviz import something_old
After v2.0.0, many function arguments renamed (e.g., 'img' -> 'image', 'src' -> 'image', 'imgs' -> 'images'). Check docs for new signatures.
Depth2Rgb
✓ from imgviz import Depth2Rgb
✗ from imgviz import Depth2RGB
Class renamed from Depth2RGB to Depth2Rgb in v2.0.0.
Nchannel2Rgb
✓ from imgviz import Nchannel2Rgb
✗ from imgviz import Nchannel2RGB
Class renamed from Nchannel2RGB to Nchannel2Rgb in v2.0.0.
Label-to-RGB conversion and saving.
import numpy as np
import imgviz
# Create a sample segmentation mask
mask = np.zeros((100, 100), dtype=np.int32)
mask[20:40, 30:70] = 1
mask[60:80, 10:90] = 2
# Convert label image to RGB visualization
rgb = imgviz.label2rgb(mask)
# Show or save
# import matplotlib.pyplot as plt
# plt.imshow(rgb)
# plt.show()
# Save an image with labels
imgviz.io.lblsave('output.png', rgb)
Errors
Common errors & fixes
TypeError: label2rgb() got an unexpected keyword argument 'img'
Parameter renamed from 'img' to 'image' in v2.0.0.
fixUse `image=...` instead of `img=...`.
ImportError: cannot import name 'Depth2RGB' from 'imgviz'
Class renamed to Depth2Rgb in v2.0.0.
fixUse `from imgviz import Depth2Rgb`.
FileNotFoundError: [Errno 2] No such file or directory: '...' (when using imread)
OpenCV and pyglet backends for I/O removed in v2.0.0. Default backend may be missing.
fixUse imgviz.io.imread only with imageio backend (or install optional dependencies). Alternatively, use imageio directly.
Upgrade
Version history
2.1.0latest on PyPI · released Jun 10, 2026
Audit
Dependencies
No dependency data recorded yet.