Send images to the immdebug viewer for visual debugging — from any Python process
Project description
immdebug
Visual image debugger for Python — inspect images from any running process with zoom, pan, pixel values, and colormaps.
Part of the immvision / Dear ImGui Bundle ecosystem.
Install
pip install immdebug
This installs both the client (for sending images) and the viewer (for displaying them).
Quick start
1. Start the viewer (in a terminal):
immdebug-viewer
# or: python -m immdebug
2. Send images (from your code, a script, a notebook, ...):
import numpy as np
from immdebug import immdebug
image = np.random.randint(0, 255, (480, 640, 3), dtype=np.uint8)
immdebug(image, "random noise")
The image appears in the viewer immediately.
How it works
immdebug() serializes the image to a temp directory (<tempdir>/ImmDebug/). The viewer polls this directory and displays incoming images using immvision's inspector.
This is the same protocol used by the C++ ImmDebug() function, so the Python client works with both the Python and C++ viewers.
Use with OpenCV
OpenCV uses BGR channel order. Use immdebug_bgr for correct colors:
import cv2
from immdebug import immdebug, immdebug_bgr
image = cv2.imread("photo.jpg")
immdebug_bgr(image, "original") # BGR image from OpenCV
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
immdebug(gray, "grayscale") # single-channel, order doesn't matter
edges = cv2.Canny(gray, 100, 200)
immdebug(edges, "edges")
Use with PIL, matplotlib, etc.
Most other libraries (PIL/Pillow, matplotlib, stb) use RGB order. Use immdebug (the default):
from PIL import Image
from immdebug import immdebug
import numpy as np
image = np.array(Image.open("photo.jpg"))
immdebug(image, "original")
API
def immdebug(image, legend="", zoom_center=(0.0, 0.0), zoom_ratio=-1.0,
zoom_key="", color_adjustments_key="") -> None:
"""Send an RGB image to the viewer."""
def immdebug_bgr(image, legend="", zoom_center=(0.0, 0.0), zoom_ratio=-1.0,
zoom_key="", color_adjustments_key="") -> None:
"""Send a BGR image (OpenCV) to the viewer."""
| Parameter | Description |
|---|---|
image |
numpy array — HxW (grayscale) or HxWxC (color). Supports uint8, int8, uint16, int16, int32, float32, float64. |
legend |
Display name in the viewer |
zoom_center |
Initial zoom center (x, y) |
zoom_ratio |
Initial zoom ratio (-1 for auto-fit) |
zoom_key |
Link zoom/pan across images sharing this key |
color_adjustments_key |
Link color adjustments across images sharing this key |
Features
- Non-blocking:
immdebug()just writes a file and returns immediately - Post-mortem: images persist in the temp directory for 1 hour — start the viewer after your script finishes
- Single instance: launching a second viewer brings the existing one to the front
- Cross-language: works with both the Python and C++ immdebug viewers
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file immdebug-1.92.601.tar.gz.
File metadata
- Download URL: immdebug-1.92.601.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ff715a8aac626fcc8ff9101bf687260b84674214d0140bf282b20a0ceb5af273
|
|
| MD5 |
3c29045e2f654af9b6c752ae2b2815ed
|
|
| BLAKE2b-256 |
c6d603b0d43bf8be48328e5455c7f3070c5ae83df8fe7c5e6daed09eda15b02b
|
File details
Details for the file immdebug-1.92.601-py3-none-any.whl.
File metadata
- Download URL: immdebug-1.92.601-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f894a258a3d600daf402c616b8634b03b828a156989ae10c0a882dc07a3eb419
|
|
| MD5 |
44211011a1f5b97d1658b79cd981ebdd
|
|
| BLAKE2b-256 |
4e69452f5de57ac28b50625860768f0a8bf6a6e0c50042c62405d3c81a4f17d9
|