# Sandbox.Services.Ai.Query.AddImage

## Overload 1

```csharp
Query AddImage(string url)
```

Adds an HTTP(S) image URL or a base64 image data URL in JPEG, PNG, WebP or GIF format.
HTTP(S) URLs are forwarded to the AI provider without downloading them locally.

### Parameters

- `url` (`string`)

### Returns

`Query`

## Overload 2

```csharp
Query AddImage(Bitmap bitmap, bool lossless = False)
```

Copies and encodes a bitmap now, so the caller can dispose it after this call.
Automatically resizes and encodes the image. Use lossless for text, diagrams or transparency.

### Parameters

- `bitmap` (`Bitmap`)
- `lossless` (`bool`), default `False`

### Returns

`Query`

## Overload 3

```csharp
Query AddImage(Texture texture, bool lossless = False)
```

Adds a 2D texture. Keep it alive until submission reads it asynchronously from the GPU.
Its first encoded image is cached for reuse and retries. Uses the same sizing and encoding as bitmaps.

### Parameters

- `texture` (`Texture`)
- `lossless` (`bool`), default `False`

### Returns

`Query`

Declared in [Sandbox.Services.Ai.Query](/api/Sandbox.Services.Ai.Query).
Assembly: `Sandbox.Engine`.
