One resized image is a chore. A thousand product photos is a pipeline. The difference isn't effort โ it's chaining API calls so your agent or cron job runs unattended while you sleep.
This guide walks through a real-world pipeline on Agent Media Tools: ingest images, resize to a standard width, convert to WebP, optionally compress, then deliver via webhook or Discord.
curl -X POST https://agentmediatools.com/api/resize-image \ -F "image=@product-raw.jpg" \ -F "width=1200" \ -F "format=webp" \ -o step1.webp
Setting format=webp on resize combines two steps in one call โ resize and convert. For large batches, use POST /api/jobs with batch-resize (Premium) to queue work asynchronously.
curl -X POST https://agentmediatools.com/api/compress-image \ -F "image=@step1.webp" \ -F "quality=80" \ -o final.webp
Quality 75โ85 is the sweet spot for e-commerce โ visually identical, 40โ60% smaller files.
import requests, pathlib
BASE = "https://agentmediatools.com"
INPUT_DIR = pathlib.Path("products/raw")
OUTPUT_DIR = pathlib.Path("products/webp")
OUTPUT_DIR.mkdir(exist_ok=True)
for img in INPUT_DIR.glob("*.jpg"):
with open(img, "rb") as f:
r = requests.post(f"{BASE}/api/resize-image",
files={"image": f},
data={"width": "1200", "format": "webp", "quality": "82"},
)
r.raise_for_status()
out = OUTPUT_DIR / (img.stem + ".webp")
out.write_bytes(r.content)
print(f"OK {img.name} โ {out.name}")
Run with cron: 0 2 * * * python3 pipeline.py โ processes overnight at 2 AM.
Register a webhook in your account settings. When async jobs finish, Agent Media Tools POSTs the result URL to your endpoint:
POST /api/jobs
{
"type": "batch-convert",
"files": [...],
"webhook_url": "https://yoursite.com/hooks/image-done"
}
Poll GET /api/jobs/:id or wait for the webhook โ your agent never blocks on long jobs.
After processing, post to a Discord webhook:
curl -X POST "https://discord.com/api/webhooks/YOUR_WEBHOOK" \ -F "content=Batch complete: 47 images โ WebP" \ -F "file=@final.webp"
This is the exact flow shown in the homepage demo: Claude โ Resize โ Convert โ Upload โ Discord.
See pricing for the full breakdown.
Start building: Open Pipeline Builder ยท Go Premium โ $5/mo
Built at agentmediatools.com