Image
A monochrome or color image.
The order of dimensions in the underlying components.TensorData
follows the typical
row-major, interleaved-pixel image format. Additionally, Rerun orders the
datatypes.TensorDimension
s within the shape description from outer-most to inner-most.
As such, the shape of the components.TensorData
must be mappable to:
- A
HxW
tensor, treated as a grayscale image. - A
HxWx3
tensor, treated as an RGB image. - A
HxWx4
tensor, treated as an RGBA image.
Leading and trailing unit-dimensions are ignored, so that
1x480x640x3x1
is treated as a 480x640x3
RGB image.
Rerun also supports compressed image encoded as JPEG, N12, and YUY2. Using these formats can save a lot of bandwidth and memory.
Components components
Required: TensorData
Shown in shown-in
- Spatial2DView
- Spatial3DView (if logged under a projection)
API reference links api-reference-links
Example example
image_simple imagesimple
"""Create and log an image."""
import numpy as np
import rerun as rr
# Create an image with numpy
image = np.zeros((200, 300, 3), dtype=np.uint8)
image[:, :, 0] = 255
image[50:150, 50:150] = (0, 255, 0)
rr.init("rerun_example_image", spawn=True)
rr.log("image", rr.Image(image))