Skip to content

Image

A component for rendering images:

  • From external URLs
  • From a local path

Usage

Register an image with an id example_image:

Register image request

POST: /api/image/example_image/register
Content-Type: application/json
{
"asset_type": "svg",
"url": "https://example.com/image.svg"
}

Update output with a new scene that is using image example_image:

Update request

POST: /api/output/example_output/update
Content-Type: application/json
{
"video": {
"root": {
"type": "view",
"background_color": "#52505b",
"children": [
{
"type": "image",
"image_id": "example_image"
}
]
}
}
}

Example output

Reference

Type definitions

type Image = {
id?: string;
image_id: string;
width?: f32;
height?: f32;
}

Properties

id

ID of a component.

  • Type: string

image_id

ID of an image. It identifies an image registered using a register image request.

  • Type: string

width

Width of the image in pixels. If height is not explicitly provided, the image will automatically adjust its height to maintain its original aspect ratio relative to the width.

  • Type: f32

height

Height of the image in pixels. If width is not explicitly provided, the image will automatically adjust its width to maintain its original aspect ratio relative to the height.

  • Type: f32