> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Image Agent

> Agent for image analysis and generation

Analyse and generate images with a dedicated vision Agent.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
graph LR
    Agent[Image Agent] --> Vision([Analysis])

    classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
    classDef tool fill:#189AB4,stroke:#7C90A0,color:#fff

    class Agent agent
    class Vision tool
    classDef agent fill:#8B0000,color:#fff
    classDef tool fill:#189AB4,color:#fff

```

## Quick Start

**1. Simple Usage**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
npm install praisonai
```

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { ImageAgent } from 'praisonai';

const agent = new ImageAgent();

const analysis = await agent.analyze({
  imageUrl: 'https://example.com/image.jpg',
  prompt: 'Describe this image in detail'
});

console.log(analysis);
```

**2. With Configuration**

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { ImageAgent } from 'praisonai';

const agent = new ImageAgent({
  name: 'VisionAgent',
  llm: 'openai/gpt-4o',
  verbose: true
});
```

## Analyze Image

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { ImageAgent } from 'praisonai';

const agent = new ImageAgent();

const result = await agent.analyze({
  imageUrl: 'https://example.com/photo.jpg',
  prompt: 'What objects are in this image?',
  detail: 'high'
});

console.log(result);
```

## Chat with Image Context

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { ImageAgent } from 'praisonai';

const agent = new ImageAgent();

// Chat with image
const response = await agent.chat(
  'What colors are prominent in this image?',
  'https://example.com/image.jpg'
);

// Chat without image
const textResponse = await agent.chat('What is machine learning?');
```

## Compare Images

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { ImageAgent } from 'praisonai';

const agent = new ImageAgent();

const comparison = await agent.compare(
  'https://example.com/image1.jpg',
  'https://example.com/image2.jpg',
  'What are the differences between these images?'
);

console.log(comparison);
```

## Detail Levels

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { ImageAgent } from 'praisonai';

const agent = new ImageAgent();

// Low detail - faster, less tokens
await agent.analyze({
  imageUrl: 'https://example.com/image.jpg',
  detail: 'low'
});

// High detail - more accurate
await agent.analyze({
  imageUrl: 'https://example.com/image.jpg',
  detail: 'high'
});

// Auto - let the model decide
await agent.analyze({
  imageUrl: 'https://example.com/image.jpg',
  detail: 'auto'
});
```

## Factory Function

```typescript theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
import { createImageAgent } from 'praisonai';

const agent = createImageAgent({
  name: 'MyImageAgent',
  verbose: true
});
```

## Related

> [card] [Image Agent CLI](https://praison.ai/docs/js/image-agent-cli.md)
>
> Command-line image tools

> [card] [Multi-Modal Agent](https://praison.ai/docs/js/multimodal-agent.md)
>
> Images, PDFs, and files


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.