# `GEPA.Image`
[🔗](https://github.com/nshkrdotcom/gepa_ex/blob/v0.3.0/lib/gepa/image.ex#L1)

Image data wrapper for visual side-information in `GEPA.OptimizeAnything`.

Include `%GEPA.Image{}` values anywhere inside evaluator side-info or
reflective-dataset records. `GEPA.Proposer.InstructionProposal` detects these
values, replaces them with `[IMAGE-N]` placeholders in the textual prompt, and
appends OpenAI-compatible multimodal content parts to the reflection LLM call.

Provide exactly one of `:url`, `:path`, or `:base64_data`.

# `t`

```elixir
@type t() :: %GEPA.Image{
  base64_data: String.t() | nil,
  media_type: String.t() | nil,
  path: Path.t() | nil,
  url: String.t() | nil
}
```

# `from_base64`

```elixir
@spec from_base64(String.t(), String.t()) :: t()
```

Create an image wrapper from raw base64 bytes and a MIME type.

# `from_path`

```elixir
@spec from_path(Path.t(), String.t() | nil) :: t()
```

Create an image wrapper from a local path.

# `from_url`

```elixir
@spec from_url(String.t()) :: t()
```

Create an image wrapper from a URL or data URI.

# `media_type`

```elixir
@spec media_type(t()) :: String.t()
```

Return the MIME type for a path-backed image, defaulting to image/png.

# `new`

```elixir
@spec new(keyword() | map()) :: t()
```

Create an image wrapper from keyword or map options.

# `to_openai_content_part`

```elixir
@spec to_openai_content_part(t()) :: map()
```

Convert to an OpenAI-compatible multimodal `image_url` content part.

# `validate!`

```elixir
@spec validate!(t()) :: t()
```

Validate an image wrapper, raising on invalid source combinations.

---

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