Skip to content

image element

Image from an external file (PNG, JPEG, SVG, …).

Fields

Field Type Default Description
image path required Path to the image file, relative to the slide source file.
object_fit "cover" | "contain" | "fill" (optional) null How the image fills its box. Required when both size dimensions are numeric (or animated), forbidden when one is "auto". "cover" fills the box (may crop), "contain" fits inside (may letterbox), "fill" stretches to fill exactly.

Every element also shares the common fields — position, size, anchor, opacity, scale, and angle.

Example

{
  // Centered image, preserving its aspect ratio (height "auto").
  image: "assets/diagram.png",
  position: [50, 50],
  anchor: [50, 50],
  width: 60,
}