# Image Convert

> Converts an image to a different format (PNG, JPG, WebP). Use when you need to change image formats, optimize for web, or prepare images for specific applications.

- Skill: `agntswrm/image-convert` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agntswrm/image-convert`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agntswrm/image-convert/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: agntswrm (https://skillmd.com/u/agntswrm)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/agntswrm/image-convert

---


# Image Convert

Converts an image to a different format (PNG, JPG, or WebP).

## Command

```bash
npx agent-media@latest image convert --in <path> --format <format> [options]
```

## Inputs

| Option | Required | Description |
|--------|----------|-------------|
| `--in` | Yes | Input file path or URL |
| `--format` | Yes | Output format: `png`, `jpg`, `webp` |
| `--quality` | No | Quality for lossy formats (1-100, default: 80) |
| `--out` | No | Output path, filename or directory (default: ./) |
| `--provider` | No | Provider to use (default: auto-detect) |

## Output

Returns a JSON object with the converted image path:

```json
{
  "ok": true,
  "media_type": "image",
  "action": "convert",
  "provider": "local",
  "output_path": "converted_123_abc.webp",
  "mime": "image/webp",
  "bytes": 23456
}
```

## Examples

Convert PNG to WebP:
```bash
npx agent-media@latest image convert --in photo.png --format webp
```

Convert to high-quality JPEG:
```bash
npx agent-media@latest image convert --in photo.png --format jpg --quality 95
```

Convert with custom output directory:
```bash
npx agent-media@latest image convert --in image.png --format webp --out ./converted
```

## Providers

- **local** (default) - Uses sharp library, no API key required

