Skip to content

Images

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

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
draw_order Optional[float]

An optional floating point value that specifies the 2D drawing order. Objects with higher values are drawn on top of those with lower values. The default for images is -10.0.

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
recording Optional[RecordingStream]

Specifies the rerun.RecordingStream to use. If left unspecified, defaults to the current active data recording, if there is one. See also: rerun.init, rerun.set_global_data_recording.

None

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

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

You must pass either img_bytes or img_path.

Only JPEGs and PNGs are supported right now.

JPEGs will be stored compressed, saving memory, whilst PNGs will currently be decoded before they are logged. This may change in the future.

If no img_format is specified, rerun will try to 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
recording Optional[RecordingStream]

Specifies the rerun.RecordingStream to use. If left unspecified, defaults to the current active data recording, if there is one. See also: rerun.init, rerun.set_global_data_recording.

None

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

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
draw_order Optional[float]

An optional floating point value that specifies the 2D drawing order. Objects with higher values are drawn on top of those with lower values. The default for images is -10.0.

None
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
recording Optional[RecordingStream]

Specifies the rerun.RecordingStream to use. If left unspecified, defaults to the current active data recording, if there is one. See also: rerun.init, rerun.set_global_data_recording.

None

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

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
draw_order Optional[float]

An optional floating point value that specifies the 2D drawing order. Objects with higher values are drawn on top of those with lower values. The default for images is -10.0.

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
recording Optional[RecordingStream]

Specifies the rerun.RecordingStream to use. If left unspecified, defaults to the current active data recording, if there is one. See also: rerun.init, rerun.set_global_data_recording.

None