Image Transforms

Resize Image

Resize an image. Provide width, height, or both.

GET/api/resize?url=&width=&height=

Query parameters

NameTypeRequiredDescription
urlstringRequiredPublic http(s) URL of the source image (max 10 MB).
widthintegerOptionalTarget width (1-4000).
heightintegerOptionalTarget height (1-4000).
fitstringOptionalcover (default), contain, fill, inside or outside.
backgroundstringOptionalHex color used for padding with fit=contain. Default transparent.
formatstringOptionalOutput format: png, jpeg, webp, avif or gif.
qualityintegerOptional1-100 for jpeg/webp/avif. Default 80.

Try it

Saved only in this browser. Requests use your key and count toward your quota. Get a key

GET /api/resize

Example request

curl "https://your-app.com/api/resize?url=https%3A%2F%2Fexample.com%2Fphoto.jpg&width=300&height=200&fit=cover&format=webp" \
  -H "x-api-key: YOUR_API_KEY" \
  --output resized.webp

Response

Content-Type: image/png (or the requested format) — the resized image.