---
name: amt-compress-image
description: Compress JPEG, PNG, WebP images via free API while preserving format. Use when the user needs smaller file size without necessarily changing dimensions.
---

# Compress images (Agent Media Tools)

## When to use
- Shrink image file size for web, email, or agent pipelines
- Preserve original format (JPEG stays JPEG, PNG stays PNG)

## API
`POST https://agentmediatools.com/api/compress-image`

Multipart: `image` (file), optional `quality` (default ~70)

**Response JSON** (not raw binary):
```json
{
  "success": true,
  "originalSize": 4281042,
  "compressedSize": 621884,
  "savingsPercent": 85,
  "downloadUrl": "/downloads/d4e5f6.jpg"
}
```
Download: `https://agentmediatools.com` + `downloadUrl`

## curl
```bash
curl -F "image=@photo.jpg" -F "quality=70" \
  https://agentmediatools.com/api/compress-image
```

## Browser / guides
- Tool: https://agentmediatools.com/tool/compress-image
- Guide: https://agentmediatools.com/blog/free-image-compression-api

## Limits
Free daily shared pool. Founding Pro for production volume: https://agentmediatools.com/pricing
