# `Jido.Chat.Content.Image`
[🔗](https://github.com/agentjido/jido_chat/blob/v1.0.0/lib/jido/chat/content/image.ex#L1)

Image content block for messages.

Represents an image attachment in a message. Supports both URL-based
and base64-encoded images.

## Fields

- `url` - URL to the image (optional if data is provided)
- `data` - Base64-encoded image data (optional if url is provided)
- `media_type` - MIME type (e.g., "image/png", "image/jpeg")
- `alt_text` - Alternative text description
- `width` - Image width in pixels (optional)
- `height` - Image height in pixels (optional)

## Examples

    Image.new("https://example.com/photo.jpg")
    Image.new("https://example.com/photo.jpg", media_type: "image/jpeg", alt_text: "A photo")
    Image.from_base64(base64_data, "image/png")

# `t`

```elixir
@type t() :: %Jido.Chat.Content.Image{
  alt_text: nil | nil | binary(),
  data: nil | nil | binary(),
  height: nil | nil | integer(),
  media_type: nil | nil | binary(),
  type: :image,
  url: nil | nil | binary(),
  width: nil | nil | integer()
}
```

# `from_base64`

Creates a new image content block from base64-encoded data.

## Parameters

- `data` - Base64-encoded image data
- `media_type` - MIME type (required for base64 images)
- `opts` - Additional options (alt_text, width, height)

# `new`

Creates a new image content block from a URL.

## Options

- `:media_type` - MIME type of the image
- `:alt_text` - Alternative text description
- `:width` - Image width in pixels
- `:height` - Image height in pixels

# `schema`

Returns the Zoi schema for Image content

---

*Consult [api-reference.md](api-reference.md) for complete listing*
