Image Transforms

Crop Image

Crop a rectangular region out of an image.

GET/api/crop?url=&left=&top=&width=&height=

Query parameters

NameTypeRequiredDescription
urlstringRequiredPublic http(s) URL of the source image (max 10 MB).
leftintegerOptionalLeft edge of the crop area in pixels. Default 0.
topintegerOptionalTop edge of the crop area in pixels. Default 0.
widthintegerRequiredWidth of the crop area.
heightintegerRequiredHeight of the crop area.
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/crop

Example request

curl "https://your-app.com/api/crop?url=https%3A%2F%2Fexample.com%2Fphoto.jpg&left=50&top=50&width=100&height=100" \
  -H "x-api-key: YOUR_API_KEY" \
  --output cropped.png

Response

Content-Type: image/png (or the requested format) — the cropped image. Returns 400 if the area exceeds the image.