Skip to content

Images

def rerun.log_image(entity_path, image, *, ext=None, timeless=False)

Log a gray or color image.

The image should either have 1, 3 or 4 channels (gray, RGB or RGBA).

Supported dtypes
  • uint8: color components should be in 0-255 sRGB gamma space, except for alpha which should be in 0-255 linear space.
  • uint16: color components should be in 0-65535 sRGB gamma space, except for alpha which should be in 0-65535 linear space.
  • float32, float64: all color components should be in 0-1 linear space.

Parameters:

Name Type Description Default
entity_path str

Path to the image in the space hierarchy.

required
image Tensor

A Tensor representing the image to log.

required
ext Optional[Dict[str, Any]]

Optional dictionary of extension components. See rerun.log_extension_components

None
timeless bool

If true, the image will be timeless (default: False).

False

def rerun.log_image_file(entity_path, *, img_bytes=None, img_path=None, img_format=None, timeless=False)

Log an image file given its contents or path on disk.

Only JPEGs are supported right now.

You must pass either img_bytes or img_path.

If no img_format is specified, we will try and guess it.

Parameters:

Name Type Description Default
entity_path str

Path to the image in the space hierarchy.

required
img_bytes Optional[bytes]

Content of an image file, e.g. a .jpg.

None
img_path Optional[Path]

Path to an image file, e.g. a .jpg.

None
img_format Optional[ImageFormat]

Format of the image file.

None
timeless bool

If true, the image will be timeless (default: False).

False

def rerun.log_depth_image(entity_path, image, *, meter=None, ext=None, timeless=False)

Log a depth image.

The image must be a 2D array.

Supported dtypes

uint8, uint16, float32, float64

Parameters:

Name Type Description Default
entity_path str

Path to the image in the space hierarchy.

required
image Tensor

A Tensor representing the depth image to log.

required
meter Optional[float]

How long is a meter in the given dtype? For instance: with uint16, perhaps meter=1000 which would mean you have millimeter precision and a range of up to ~65 meters (2^16 / 1000).

None
ext Optional[Dict[str, Any]]

Optional dictionary of extension components. See rerun.log_extension_components

None
timeless bool

If true, the image will be timeless (default: False).

False

def rerun.log_segmentation_image(entity_path, image, *, ext=None, timeless=False)

Log an image made up of integer class-ids.

The image should have 1 channel, i.e. be either H x W or H x W x 1.

See: rerun.log_annotation_context for information on how to map the class-ids to colors and labels.

Supported dtypes

uint8, uint16

Parameters:

Name Type Description Default
entity_path str

Path to the image in the space hierarchy.

required
image npt.ArrayLike

A Tensor representing the segmentation image to log.

required
ext Optional[Dict[str, Any]]

Optional dictionary of extension components. See rerun.log_extension_components

None
timeless bool

If true, the image will be timeless (default: False).

False