yr.image

image(
    content: bytes,
    media_type: ImageMediaType = 'image/png',
    alt: str | None = None,
) → None

Render an image from image-file bytes.

The image is fitted responsively to the available display width while preserving its intrinsic aspect ratio. PNG, JPEG, WebP, GIF, and SVG images are supported. Rendering depends on the active output environment.

Parameters

content
type: bytes

Raw contents of a PNG, JPEG, WebP, GIF, or SVG image file.

media_type
type: ImageMediaType = 'image/png'

MIME type identifying the supplied image format.

alt
type: str | None = None

Optional accessible description of the image.