# Image Compression & WebP Converter

Image optimizer: compress, resize and convert images to WebP, JPEG or PNG in one call, up to 16 megapixels, with the bytes saved.

Send a PNG, JPEG or WebP of up to 16 megapixels, by link or as base64. You get it back as WebP, JPEG or PNG at the quality and size you ask for, with the bytes saved. Images are processed in memory and never stored.

- Every answer says how many bytes were saved, with the size before and after.
- Convert, compress and fit inside a maximum width and height in one call, up to 16 megapixels.
- Images are processed in memory and never stored; an image we cannot read is not charged.

## Calls

### `POST https://readymadeapi.com/v1/image/optimize`

Convert and compress one image, optionally fitting it inside a maximum width and height.

- Price: $0.001 per image
- MCP tool: `image_optimizer_optimize`
- Answers in the same call.

Request:

```json
{
  "format": "webp",
  "image_url": "https://readymadeapi.com/samples/product.jpg",
  "max_width": 1600,
  "quality": 80
}
```

Answer:

```json
{
  "format": "webp",
  "width": 1600,
  "height": 1600,
  "bytes_in": 111336,
  "bytes_out": 21736,
  "saved_percent": 80.5,
  "image_base64": "UklGRuBUAABXRUJQVlA4INRUAABwSAOdASpABkAGPm02m0mkIyMhIPNYWIAN... (28984 characters)"
}
```

## Limits

- Up to 16 megapixels; by link, up to 15 MB.

## Questions

**Which formats?**

PNG, JPEG or WebP in, by link or as base64; WebP, JPEG or PNG out at the quality you ask for.

**Does it take HEIC, AVIF or GIF?**

No. PNG, JPEG or WebP in and out.

## Using it

- Send `Authorization: Bearer <key>` and a JSON body. Keys and credit: https://readymadeapi.com/account
- Every answer carries `X-Request-Id`, `X-Units` and `X-Charged-Usd`.
- An error is a JSON problem with a `title` to act on and a `detail` in plain words; nothing is charged for it.
- Full schema: https://readymadeapi.com/openapi.json
